|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.norconex.committer.BatchableCommitter
com.norconex.committer.FileSystemQueueCommitter
public abstract class FileSystemQueueCommitter
Base batching implementation queuing documents on filesystem.
Nested Class Summary | |
---|---|
class |
FileSystemQueueCommitter.QueuedAddedDocument
|
class |
FileSystemQueueCommitter.QueuedDeletedDocument
|
Field Summary | |
---|---|
static String |
DEFAULT_QUEUE_DIR
|
Fields inherited from class com.norconex.committer.BatchableCommitter |
---|
DEFAULT_BATCH_SIZE |
Fields inherited from interface com.norconex.committer.ICommitter |
---|
DEFAULT_DOCUMENT_REFERENCE |
Constructor Summary | |
---|---|
FileSystemQueueCommitter()
|
|
FileSystemQueueCommitter(int batchSize)
|
Method Summary | |
---|---|
void |
commit()
Commits queued documents. |
protected abstract void |
commitAddedDocument(FileSystemQueueCommitter.QueuedAddedDocument document)
Allow subclasses to commit a file to be added. |
protected abstract void |
commitComplete()
Allow subclasses to operate upon the end of the commit operation. |
protected abstract void |
commitDeletedDocument(FileSystemQueueCommitter.QueuedDeletedDocument document)
Allow subclasses to commit a file to be deleted. |
boolean |
equals(Object obj)
|
String |
getQueueDir()
|
int |
hashCode()
|
protected void |
preCommitAddedDocument(FileSystemQueueCommitter.QueuedAddedDocument document)
Optionally performs operations on a document to be added before actually committing it. |
protected void |
preCommitDeletedDocument(FileSystemQueueCommitter.QueuedDeletedDocument document)
Optionally performs operations on a document to be deleted before actually committing it. |
protected void |
queueBatchableAdd(String reference,
File document,
Properties metadata)
Queues a document to be added. |
protected void |
queueBatchableRemove(String ref,
File document,
Properties metadata)
Queues a document to be deleted. |
void |
setQueueDir(String queueDir)
|
String |
toString()
|
Methods inherited from class com.norconex.committer.BatchableCommitter |
---|
getBatchSize, queueAdd, queueRemove, setBatchSize |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_QUEUE_DIR
Constructor Detail |
---|
public FileSystemQueueCommitter()
public FileSystemQueueCommitter(int batchSize)
Method Detail |
---|
public String getQueueDir()
public void setQueueDir(String queueDir)
protected void queueBatchableAdd(String reference, File document, Properties metadata)
BatchableCommitter
queueBatchableAdd
in class BatchableCommitter
reference
- document referencedocument
- document filemetadata
- document metadataprotected void queueBatchableRemove(String ref, File document, Properties metadata)
BatchableCommitter
queueBatchableRemove
in class BatchableCommitter
document
- document filemetadata
- document metadatapublic void commit()
ICommitter
protected abstract void commitAddedDocument(FileSystemQueueCommitter.QueuedAddedDocument document) throws IOException
Allow subclasses to commit a file to be added.
The subclass has the responsibility of deleting the file once the content
is permanently stored by invoking
FileSystemQueueCommitter.QueuedAddedDocument.deleteFromQueue()
.
The subclass may decide to further batch those documents before
storing them if more efficient this way.
document
- the document to commit
IOException
protected abstract void commitDeletedDocument(FileSystemQueueCommitter.QueuedDeletedDocument document) throws IOException
Allow subclasses to commit a file to be deleted.
The subclass has the responsibility of deleting the file once the content
is permanently stored by invoking
FileSystemQueueCommitter.QueuedDeletedDocument.deleteFromQueue()
. The subclass may
decide to further batch those deletions before storing them if more
efficient that way.
document
- the document to commit
IOException
protected abstract void commitComplete()
protected void preCommitAddedDocument(FileSystemQueueCommitter.QueuedAddedDocument document) throws IOException
document
- document to be added
IOException
protected void preCommitDeletedDocument(FileSystemQueueCommitter.QueuedDeletedDocument document) throws IOException
document
- document to be deleted
IOException
public int hashCode()
hashCode
in class BatchableCommitter
public boolean equals(Object obj)
equals
in class BatchableCommitter
public String toString()
toString
in class BatchableCommitter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |