final class DocumentsWriterPerThread
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
DocumentsWriterPerThread.DocState |
(package private) static class |
DocumentsWriterPerThread.FlushedSegment |
(package private) static class |
DocumentsWriterPerThread.IndexingChain
The IndexingChain must define the
DocumentsWriterPerThread.IndexingChain.getChain(DocumentsWriterPerThread) method
which returns the DocConsumer that the DocumentsWriter calls to process the
documents. |
private static class |
DocumentsWriterPerThread.IntBlockAllocator |
Constructor and Description |
---|
DocumentsWriterPerThread(int indexVersionCreated,
java.lang.String segmentName,
Directory directoryOrig,
Directory directory,
LiveIndexWriterConfig indexWriterConfig,
InfoStream infoStream,
DocumentsWriterDeleteQueue deleteQueue,
FieldInfos.Builder fieldInfos,
java.util.concurrent.atomic.AtomicLong pendingNumDocs,
boolean enableTestPoints) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
abort()
Called if we hit an exception at a bad time (when
updating the index files) and must discard all
currently buffered docs.
|
(package private) long |
bytesUsed() |
(package private) void |
deleteDocID(int docIDUpto) |
private long |
finishDocument(DocumentsWriterDeleteQueue.Node<?> deleteNode) |
(package private) DocumentsWriterPerThread.FlushedSegment |
flush(DocumentsWriter.FlushNotifications flushNotifications)
Flush all pending docs to a new segment
|
FieldInfos.Builder |
getFieldInfosBuilder() |
int |
getIndexCreatedVersionMajor() |
int |
getNumDocsInRAM()
Returns the number of RAM resident documents in this
DocumentsWriterPerThread |
(package private) SegmentInfo |
getSegmentInfo()
Get current segment info we are writing.
|
(package private) boolean |
hasHitAbortingException() |
(package private) boolean |
isAborted() |
private void |
maybeAbort(java.lang.String location,
DocumentsWriter.FlushNotifications flushNotifications) |
(package private) void |
onAbortingException(java.lang.Throwable throwable) |
java.util.Set<java.lang.String> |
pendingFilesToDelete() |
(package private) FrozenBufferedUpdates |
prepareFlush()
Prepares this DWPT for flushing.
|
private void |
reserveOneDoc()
Anything that will add N docs to the index should reserve first to
make sure it's allowed.
|
(package private) void |
sealFlushedSegment(DocumentsWriterPerThread.FlushedSegment flushedSegment,
Sorter.DocMap sortMap,
DocumentsWriter.FlushNotifications flushNotifications)
Seals the
SegmentInfo for the new flushed segment and persists
the deleted documents FixedBitSet . |
private FixedBitSet |
sortLiveDocs(Bits liveDocs,
Sorter.DocMap sortMap) |
(package private) void |
testPoint(java.lang.String message) |
java.lang.String |
toString() |
long |
updateDocument(java.lang.Iterable<? extends IndexableField> doc,
Analyzer analyzer,
DocumentsWriterDeleteQueue.Node<?> deleteNode,
DocumentsWriter.FlushNotifications flushNotifications) |
long |
updateDocuments(java.lang.Iterable<? extends java.lang.Iterable<? extends IndexableField>> docs,
Analyzer analyzer,
DocumentsWriterDeleteQueue.Node<?> deleteNode,
DocumentsWriter.FlushNotifications flushNotifications) |
private java.lang.Throwable abortingException
static final DocumentsWriterPerThread.IndexingChain defaultIndexingChain
private static final boolean INFO_VERBOSE
final Codec codec
final TrackingDirectoryWrapper directory
final Directory directoryOrig
final DocumentsWriterPerThread.DocState docState
final DocConsumer consumer
final Counter bytesUsed
final BufferedUpdates pendingUpdates
final SegmentInfo segmentInfo
private boolean aborted
private final FieldInfos.Builder fieldInfos
private final InfoStream infoStream
private int numDocsInRAM
final DocumentsWriterDeleteQueue deleteQueue
private final DocumentsWriterDeleteQueue.DeleteSlice deleteSlice
private final java.text.NumberFormat nf
final ByteBlockPool.Allocator byteBlockAllocator
final IntBlockPool.Allocator intBlockAllocator
private final java.util.concurrent.atomic.AtomicLong pendingNumDocs
private final LiveIndexWriterConfig indexWriterConfig
private final boolean enableTestPoints
private final int indexVersionCreated
private final java.util.Set<java.lang.String> filesToDelete
static final int BYTE_BLOCK_NOT_MASK
static final int MAX_TERM_LENGTH_UTF8
public DocumentsWriterPerThread(int indexVersionCreated, java.lang.String segmentName, Directory directoryOrig, Directory directory, LiveIndexWriterConfig indexWriterConfig, InfoStream infoStream, DocumentsWriterDeleteQueue deleteQueue, FieldInfos.Builder fieldInfos, java.util.concurrent.atomic.AtomicLong pendingNumDocs, boolean enableTestPoints) throws java.io.IOException
java.io.IOException
final void onAbortingException(java.lang.Throwable throwable)
final boolean hasHitAbortingException()
final boolean isAborted()
void abort() throws java.io.IOException
java.io.IOException
public FieldInfos.Builder getFieldInfosBuilder()
public int getIndexCreatedVersionMajor()
final void testPoint(java.lang.String message)
private void reserveOneDoc()
public long updateDocument(java.lang.Iterable<? extends IndexableField> doc, Analyzer analyzer, DocumentsWriterDeleteQueue.Node<?> deleteNode, DocumentsWriter.FlushNotifications flushNotifications) throws java.io.IOException
java.io.IOException
public long updateDocuments(java.lang.Iterable<? extends java.lang.Iterable<? extends IndexableField>> docs, Analyzer analyzer, DocumentsWriterDeleteQueue.Node<?> deleteNode, DocumentsWriter.FlushNotifications flushNotifications) throws java.io.IOException
java.io.IOException
private long finishDocument(DocumentsWriterDeleteQueue.Node<?> deleteNode)
void deleteDocID(int docIDUpto)
public int getNumDocsInRAM()
DocumentsWriterPerThread
FrozenBufferedUpdates prepareFlush() throws java.io.IOException
DocumentsWriterDeleteQueue
s global buffer and apply all pending
deletes to this DWPT.java.io.IOException
DocumentsWriterPerThread.FlushedSegment flush(DocumentsWriter.FlushNotifications flushNotifications) throws java.io.IOException
java.io.IOException
private void maybeAbort(java.lang.String location, DocumentsWriter.FlushNotifications flushNotifications) throws java.io.IOException
java.io.IOException
public java.util.Set<java.lang.String> pendingFilesToDelete()
private FixedBitSet sortLiveDocs(Bits liveDocs, Sorter.DocMap sortMap) throws java.io.IOException
java.io.IOException
void sealFlushedSegment(DocumentsWriterPerThread.FlushedSegment flushedSegment, Sorter.DocMap sortMap, DocumentsWriter.FlushNotifications flushNotifications) throws java.io.IOException
SegmentInfo
for the new flushed segment and persists
the deleted documents FixedBitSet
.java.io.IOException
SegmentInfo getSegmentInfo()
long bytesUsed()
public java.lang.String toString()
toString
in class java.lang.Object