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(IndexWriter writer,
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 void |
finishDocument(Term delTerm) |
(package private) DocumentsWriterPerThread.FlushedSegment |
flush()
Flush all pending docs to a new segment
|
FieldInfos.Builder |
getFieldInfosBuilder() |
int |
getNumDocsInRAM()
Returns the number of RAM resident documents in this
DocumentsWriterPerThread |
(package private) SegmentInfo |
getSegmentInfo()
Get current segment info we are writing.
|
int |
numDeleteTerms()
Returns the number of delete terms in this
DocumentsWriterPerThread |
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)
Seals the
SegmentInfo for the new flushed segment and persists
the deleted documents MutableBits . |
(package private) void |
testPoint(java.lang.String message) |
java.lang.String |
toString() |
void |
updateDocument(java.lang.Iterable<? extends IndexableField> doc,
Analyzer analyzer,
Term delTerm) |
int |
updateDocuments(java.lang.Iterable<? extends java.lang.Iterable<? extends IndexableField>> docs,
Analyzer analyzer,
Term delTerm) |
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
SegmentWriteState flushState
final BufferedUpdates pendingUpdates
private final SegmentInfo segmentInfo
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 IndexWriter indexWriter
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(IndexWriter writer, 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
void abort()
public FieldInfos.Builder getFieldInfosBuilder()
final void testPoint(java.lang.String message)
private void reserveOneDoc()
public void updateDocument(java.lang.Iterable<? extends IndexableField> doc, Analyzer analyzer, Term delTerm) throws java.io.IOException, AbortingException
java.io.IOException
AbortingException
public int updateDocuments(java.lang.Iterable<? extends java.lang.Iterable<? extends IndexableField>> docs, Analyzer analyzer, Term delTerm) throws java.io.IOException, AbortingException
java.io.IOException
AbortingException
private void finishDocument(Term delTerm)
void deleteDocID(int docIDUpto)
public int numDeleteTerms()
DocumentsWriterPerThread
public int getNumDocsInRAM()
DocumentsWriterPerThread
FrozenBufferedUpdates prepareFlush()
DocumentsWriterDeleteQueue
s global buffer and apply all pending
deletes to this DWPT.DocumentsWriterPerThread.FlushedSegment flush() throws java.io.IOException, AbortingException
java.io.IOException
AbortingException
public java.util.Set<java.lang.String> pendingFilesToDelete()
void sealFlushedSegment(DocumentsWriterPerThread.FlushedSegment flushedSegment) throws java.io.IOException
SegmentInfo
for the new flushed segment and persists
the deleted documents MutableBits
.java.io.IOException
SegmentInfo getSegmentInfo()
long bytesUsed()
public java.lang.String toString()
toString
in class java.lang.Object