Package org.apache.lucene.index
Class DocumentsWriterPerThreadPool.ThreadState
- java.lang.Object
-
- java.util.concurrent.locks.ReentrantLock
-
- org.apache.lucene.index.DocumentsWriterPerThreadPool.ThreadState
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.concurrent.locks.Lock
- Enclosing class:
- DocumentsWriterPerThreadPool
static final class DocumentsWriterPerThreadPool.ThreadState extends java.util.concurrent.locks.ReentrantLock
DocumentsWriterPerThreadPool.ThreadState
references and guards aDocumentsWriterPerThread
instance that is used during indexing to build a in-memory index segment.DocumentsWriterPerThreadPool.ThreadState
also holds all flush related per-thread data controlled byDocumentsWriterFlushControl
.A
DocumentsWriterPerThreadPool.ThreadState
, its methods and members should only accessed by one thread a time. Users must acquire the lock viaReentrantLock.lock()
and release the lock in a finally block viaReentrantLock.unlock()
before accessing the state.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) long
bytesUsed
(package private) DocumentsWriterPerThread
dwpt
(package private) boolean
flushPending
(package private) long
lastSeqNo
-
Constructor Summary
Constructors Constructor Description ThreadState(DocumentsWriterPerThread dpwt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBytesUsedPerThread()
Returns the number of currently active bytes in this ThreadState'sDocumentsWriterPerThread
DocumentsWriterPerThread
getDocumentsWriterPerThread()
boolean
isFlushPending()
Returnstrue
iff thisDocumentsWriterPerThreadPool.ThreadState
is marked as flush pending otherwisefalse
(package private) boolean
isInitialized()
private void
reset()
-
Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
-
-
-
-
Field Detail
-
dwpt
DocumentsWriterPerThread dwpt
-
flushPending
volatile boolean flushPending
-
bytesUsed
long bytesUsed
-
lastSeqNo
volatile long lastSeqNo
-
-
Constructor Detail
-
ThreadState
ThreadState(DocumentsWriterPerThread dpwt)
-
-
Method Detail
-
reset
private void reset()
-
isInitialized
boolean isInitialized()
-
getBytesUsedPerThread
public long getBytesUsedPerThread()
Returns the number of currently active bytes in this ThreadState'sDocumentsWriterPerThread
-
getDocumentsWriterPerThread
public DocumentsWriterPerThread getDocumentsWriterPerThread()
-
isFlushPending
public boolean isFlushPending()
Returnstrue
iff thisDocumentsWriterPerThreadPool.ThreadState
is marked as flush pending otherwisefalse
-
-