static final class DocumentsWriterPerThreadPool.ThreadState
extends java.util.concurrent.locks.ReentrantLock
DocumentsWriterPerThreadPool.ThreadState
references and guards a
DocumentsWriterPerThread
instance that is used during indexing to
build a in-memory index segment. DocumentsWriterPerThreadPool.ThreadState
also holds all flush
related per-thread data controlled by DocumentsWriterFlushControl
.
A DocumentsWriterPerThreadPool.ThreadState
, its methods and members should only accessed by one
thread a time. Users must acquire the lock via ReentrantLock.lock()
and release the lock in a finally block via ReentrantLock.unlock()
before accessing the state.
Modifier and Type | Field and Description |
---|---|
(package private) long |
bytesUsed |
(package private) DocumentsWriterPerThread |
dwpt |
(package private) boolean |
flushPending |
(package private) long |
lastSeqNo |
Constructor and Description |
---|
ThreadState(DocumentsWriterPerThread dpwt) |
Modifier and Type | Method and Description |
---|---|
long |
getBytesUsedPerThread()
Returns the number of currently active bytes in this ThreadState's
DocumentsWriterPerThread |
DocumentsWriterPerThread |
getDocumentsWriterPerThread()
|
boolean |
isFlushPending()
Returns
true iff this DocumentsWriterPerThreadPool.ThreadState is marked as flush
pending otherwise false |
(package private) boolean |
isInitialized() |
private void |
reset() |
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
DocumentsWriterPerThread dwpt
volatile boolean flushPending
long bytesUsed
volatile long lastSeqNo
ThreadState(DocumentsWriterPerThread dpwt)
private void reset()
boolean isInitialized()
public long getBytesUsedPerThread()
DocumentsWriterPerThread
public DocumentsWriterPerThread getDocumentsWriterPerThread()
public boolean isFlushPending()
true
iff this DocumentsWriterPerThreadPool.ThreadState
is marked as flush
pending otherwise false