final class DocumentsWriter extends java.lang.Object implements java.io.Closeable, Accountable
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
DocumentsWriter.ApplyDeletesEvent |
(package private) static class |
DocumentsWriter.DeleteNewFilesEvent |
(package private) static class |
DocumentsWriter.FlushFailedEvent |
(package private) static class |
DocumentsWriter.ForcedPurgeEvent |
(package private) static class |
DocumentsWriter.MergePendingEvent |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
closed |
private LiveIndexWriterConfig |
config |
private DocumentsWriterDeleteQueue |
currentFullFlushDelQueue |
(package private) DocumentsWriterDeleteQueue |
deleteQueue |
private Directory |
directory |
private Directory |
directoryOrig |
private java.util.Queue<IndexWriter.Event> |
events |
(package private) DocumentsWriterFlushControl |
flushControl |
(package private) FlushPolicy |
flushPolicy |
private InfoStream |
infoStream |
private java.util.concurrent.atomic.AtomicInteger |
numDocsInRAM |
private boolean |
pendingChangesInCurrentFullFlush |
(package private) DocumentsWriterPerThreadPool |
perThreadPool |
private DocumentsWriterFlushQueue |
ticketQueue |
private IndexWriter |
writer |
| Constructor and Description |
|---|
DocumentsWriter(IndexWriter writer,
LiveIndexWriterConfig config,
Directory directoryOrig,
Directory directory) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
abort(IndexWriter writer)
Called if we hit an exception at a bad time (when
updating the index files) and must discard all
currently buffered docs.
|
private int |
abortThreadState(DocumentsWriterPerThreadPool.ThreadState perThread)
Returns how many documents were aborted.
|
(package private) boolean |
anyChanges() |
boolean |
anyDeletions() |
private boolean |
applyAllDeletes(DocumentsWriterDeleteQueue deleteQueue) |
void |
close() |
(package private) DocumentsWriterDeleteQueue |
currentDeleteSession() |
(package private) boolean |
deleteQueries(Query... queries) |
(package private) boolean |
deleteTerms(Term... terms) |
private boolean |
doFlush(DocumentsWriterPerThread flushingDWPT) |
private void |
ensureInitialized(DocumentsWriterPerThreadPool.ThreadState state) |
private void |
ensureOpen() |
java.util.Queue<IndexWriter.Event> |
eventQueue() |
(package private) void |
finishFullFlush(IndexWriter indexWriter,
boolean success) |
(package private) boolean |
flushAllThreads() |
int |
getBufferedDeleteTermsSize() |
LiveIndexWriterConfig |
getIndexWriterConfig() |
int |
getNumBufferedDeleteTerms() |
(package private) int |
getNumDocs()
Returns how many docs are currently buffered in RAM.
|
(package private) long |
lockAndAbortAll(IndexWriter indexWriter)
Returns how many documents were aborted.
|
private boolean |
postUpdate(DocumentsWriterPerThread flushingDWPT,
boolean hasEvents) |
private boolean |
preUpdate() |
(package private) int |
purgeBuffer(IndexWriter writer,
boolean forced) |
private void |
putEvent(IndexWriter.Event event) |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
private boolean |
setFlushingDeleteQueue(DocumentsWriterDeleteQueue session) |
(package private) void |
subtractFlushedNumDocs(int numFlushed) |
(package private) void |
unlockAllAfterAbortAll(IndexWriter indexWriter) |
(package private) boolean |
updateDocument(java.lang.Iterable<? extends IndexableField> doc,
Analyzer analyzer,
Term delTerm) |
(package private) boolean |
updateDocuments(java.lang.Iterable<? extends java.lang.Iterable<? extends IndexableField>> docs,
Analyzer analyzer,
Term delTerm) |
(package private) boolean |
updateDocValues(DocValuesUpdate... updates) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChildResourcesprivate final Directory directoryOrig
private final Directory directory
private volatile boolean closed
private final InfoStream infoStream
private final LiveIndexWriterConfig config
private final java.util.concurrent.atomic.AtomicInteger numDocsInRAM
volatile DocumentsWriterDeleteQueue deleteQueue
private final DocumentsWriterFlushQueue ticketQueue
private volatile boolean pendingChangesInCurrentFullFlush
final DocumentsWriterPerThreadPool perThreadPool
final FlushPolicy flushPolicy
final DocumentsWriterFlushControl flushControl
private final IndexWriter writer
private final java.util.Queue<IndexWriter.Event> events
private volatile DocumentsWriterDeleteQueue currentFullFlushDelQueue
DocumentsWriter(IndexWriter writer, LiveIndexWriterConfig config, Directory directoryOrig, Directory directory)
boolean deleteQueries(Query... queries) throws java.io.IOException
java.io.IOExceptionboolean deleteTerms(Term... terms) throws java.io.IOException
java.io.IOExceptionboolean updateDocValues(DocValuesUpdate... updates) throws java.io.IOException
java.io.IOExceptionDocumentsWriterDeleteQueue currentDeleteSession()
private boolean applyAllDeletes(DocumentsWriterDeleteQueue deleteQueue) throws java.io.IOException
java.io.IOExceptionint purgeBuffer(IndexWriter writer, boolean forced) throws java.io.IOException
java.io.IOExceptionint getNumDocs()
private void ensureOpen()
throws AlreadyClosedException
AlreadyClosedExceptionvoid abort(IndexWriter writer)
long lockAndAbortAll(IndexWriter indexWriter)
private int abortThreadState(DocumentsWriterPerThreadPool.ThreadState perThread)
void unlockAllAfterAbortAll(IndexWriter indexWriter)
boolean anyChanges()
public int getBufferedDeleteTermsSize()
public int getNumBufferedDeleteTerms()
public boolean anyDeletions()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableprivate boolean preUpdate()
throws java.io.IOException,
AbortingException
java.io.IOExceptionAbortingExceptionprivate boolean postUpdate(DocumentsWriterPerThread flushingDWPT, boolean hasEvents) throws java.io.IOException, AbortingException
java.io.IOExceptionAbortingExceptionprivate void ensureInitialized(DocumentsWriterPerThreadPool.ThreadState state) throws java.io.IOException
java.io.IOExceptionboolean updateDocuments(java.lang.Iterable<? extends java.lang.Iterable<? extends IndexableField>> docs, Analyzer analyzer, Term delTerm) throws java.io.IOException, AbortingException
java.io.IOExceptionAbortingExceptionboolean updateDocument(java.lang.Iterable<? extends IndexableField> doc, Analyzer analyzer, Term delTerm) throws java.io.IOException, AbortingException
java.io.IOExceptionAbortingExceptionprivate boolean doFlush(DocumentsWriterPerThread flushingDWPT) throws java.io.IOException, AbortingException
java.io.IOExceptionAbortingExceptionvoid subtractFlushedNumDocs(int numFlushed)
private boolean setFlushingDeleteQueue(DocumentsWriterDeleteQueue session)
boolean flushAllThreads()
throws java.io.IOException,
AbortingException
java.io.IOExceptionAbortingExceptionvoid finishFullFlush(IndexWriter indexWriter, boolean success)
public LiveIndexWriterConfig getIndexWriterConfig()
private void putEvent(IndexWriter.Event event)
public long ramBytesUsed()
AccountableramBytesUsed in interface Accountablepublic java.util.Queue<IndexWriter.Event> eventQueue()