com.atlassian.bonnie.index
Class TempDirectoryDocumentWritingScheme

java.lang.Object
  extended bycom.atlassian.bonnie.index.BaseDocumentWritingScheme
      extended bycom.atlassian.bonnie.index.TempDirectoryDocumentWritingScheme
All Implemented Interfaces:
BatchOpIndexer.DocumentWritingScheme

public class TempDirectoryDocumentWritingScheme
extends BaseDocumentWritingScheme

Each thread has its own IndexWriter which writes to a temp directory.


Field Summary
protected  TempIndexWriter tempIndexWriter
           
 
Fields inherited from class com.atlassian.bonnie.index.BaseDocumentWritingScheme
progress
 
Constructor Summary
TempDirectoryDocumentWritingScheme(BatchOpIndexer indexer)
           
TempDirectoryDocumentWritingScheme(BatchOpIndexer indexer, java.lang.String tmpDir)
           
 
Method Summary
 void close(LuceneConnection luceneConnection)
          Merge the temp indices into the final index, deleting the temp directories.
protected  java.lang.String getDocumentTitle(org.apache.lucene.document.Document doc)
           
protected  java.lang.String getWriterKey(org.apache.lucene.document.Document doc)
           
 void runComplete()
          Signify that the QueueProcessingRunnableImpl has completed.
 void write(org.apache.lucene.document.Document doc)
          Write a created document.
 
Methods inherited from class com.atlassian.bonnie.index.BaseDocumentWritingScheme
setProgressWrapper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tempIndexWriter

protected final TempIndexWriter tempIndexWriter
Constructor Detail

TempDirectoryDocumentWritingScheme

public TempDirectoryDocumentWritingScheme(BatchOpIndexer indexer)

TempDirectoryDocumentWritingScheme

public TempDirectoryDocumentWritingScheme(BatchOpIndexer indexer,
                                          java.lang.String tmpDir)
Method Detail

write

public void write(org.apache.lucene.document.Document doc)
Description copied from interface: BatchOpIndexer.DocumentWritingScheme
Write a created document.

Parameters:
doc -

getWriterKey

protected java.lang.String getWriterKey(org.apache.lucene.document.Document doc)

getDocumentTitle

protected java.lang.String getDocumentTitle(org.apache.lucene.document.Document doc)

runComplete

public void runComplete()
Description copied from interface: BatchOpIndexer.DocumentWritingScheme
Signify that the QueueProcessingRunnableImpl has completed.


close

public void close(LuceneConnection luceneConnection)
           throws java.io.IOException
Merge the temp indices into the final index, deleting the temp directories.

Throws:
java.io.IOException


Copyright © 2006-2009 Atlassian Software Systems Pty Ltd. All Rights Reserved.