public abstract class AbstractBatchCommitter extends AbstractFileQueueCommitter
AbstractMappedCommitter
.
Subclasses implementing IXMLConfigurable
should allow this inner
configuration:
<commitBatchSize> (max number of documents to send IDOL at once) </commitBatchSize> <queueDir>(optional path where to queue files)</queueDir> <queueSize>(max queue size before committing)</queueSize> <maxRetries>(max retries upon commit failures)</maxRetries> <maxRetryWait>(max delay in milliseconds between retries)</maxRetryWait>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_COMMIT_BATCH_SIZE
Default commit batch size.
|
DEFAULT_QUEUE_DIR, filesCommitting
DEFAULT_QUEUE_SIZE, queueSize
Constructor and Description |
---|
AbstractBatchCommitter()
Constructor.
|
AbstractBatchCommitter(int commitBatchSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
commitAddition(IAddOperation operation)
Allow subclasses to commit a file to be added.
|
protected abstract void |
commitBatch(List<ICommitOperation> batch)
Commits a group of operation.
|
protected void |
commitComplete()
Allow subclasses to operate upon the end of the commit operation.
|
protected void |
commitDeletion(IDeleteOperation operation)
Allow subclasses to commit a file to be deleted.
|
boolean |
equals(Object obj) |
int |
getCommitBatchSize()
Gets the commit batch size.
|
int |
getMaxRetries()
Gets the maximum number of retries upon batch commit failure.
|
long |
getMaxRetryWait()
Gets the maximum wait time before retrying a failed commit.
|
int |
hashCode() |
void |
setCommitBatchSize(int commitBatchSize)
Sets the commit batch size.
|
void |
setMaxRetries(int maxRetries)
Sets the maximum number of retries upon batch commit failure.
|
void |
setMaxRetryWait(long maxRetryWait)
Sets the maximum wait time before retrying a failed commit.
|
String |
toString() |
commit, getInitialQueueDocCount, getQueueDir, prepareCommitAddition, prepareCommitDeletion, queueAddition, queueRemoval, setQueueDir
add, getQueueSize, remove, setQueueSize
public static final int DEFAULT_COMMIT_BATCH_SIZE
public AbstractBatchCommitter()
public AbstractBatchCommitter(int commitBatchSize)
commitBatchSize
- commit batch sizepublic int getCommitBatchSize()
public void setCommitBatchSize(int commitBatchSize)
commitBatchSize
- commit batch sizepublic int getMaxRetries()
public void setMaxRetries(int maxRetries)
maxRetries
- maximum number of retriespublic long getMaxRetryWait()
public void setMaxRetryWait(long maxRetryWait)
maxRetryWait
- maximum wait timeprotected final void commitAddition(IAddOperation operation)
AbstractFileQueueCommitter
Allow subclasses to commit a file to be added.
The subclass has the responsibility of deleting the file once the content is permanently stored. The subclass may decide to further batch those documents before storing them if more efficient this way.
commitAddition
in class AbstractFileQueueCommitter
operation
- the document operation to performprotected final void commitDeletion(IDeleteOperation operation)
AbstractFileQueueCommitter
Allow subclasses to commit a file to be deleted.
The subclass has the responsibility of deleting the file once the content is permanently stored. The subclass may decide to further batch those deletions before storing them if more efficient that way.
commitDeletion
in class AbstractFileQueueCommitter
operation
- the document operation to performprotected void commitComplete()
AbstractFileQueueCommitter
commitComplete
in class AbstractFileQueueCommitter
protected abstract void commitBatch(List<ICommitOperation> batch)
batch
- the group of operationspublic int hashCode()
hashCode
in class AbstractFileQueueCommitter
public boolean equals(Object obj)
equals
in class AbstractFileQueueCommitter
public String toString()
toString
in class AbstractFileQueueCommitter
Copyright © 2009–2020 Norconex Inc.. All rights reserved.