Class FsQueue
- All Implemented Interfaces:
CommitterQueue,Configurable<FsQueueConfig>,AutoCloseable
File System queue. Queues committer requests as zip files and deletes successfully committed zip files.
The top-level queue directory is the one defined in the
CommitterContext initialization argument or the system
temporary directory if null. A "queue" sub-folder will be
created for queued requests, while an "error" one will also be created
for failed batches.
Handling Failures
Before moving a failed batch to the "error" folder you have the opportunity to have this queue tell the Committer to retry the batch. This can be particularly useful if you experience issues such as:
- The target repository momentarily failed to respond.
- A specific document was rejected by the target repository.
- The batch was too big for the repository to handle.
- Etc.
In addition to specifying how many time to retry and how long to wait between each attempts, you can also break the batch size into smaller chunks. The "splitBatch" setting offers the following options:
- OFF - Default. The failing batch is not split.
- HALF - The batch is split in half at each failure (after maxRetries is reached), up until batches are of size 1 (committing documents individually).
- ONE - Documents from the failing batch are sent one by one.
When "splitBatch" is not OFF and used in combination with a non-zero "maxRetry", the later then represents how many times to retry each new smaller batches created.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.norconex.commons.lang.config.Configurable
PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidclean()Cleans any persisted information specific to this queue.voidclose()booleaninthashCode()voidinit(CommitterContext committerContext, @NonNull BatchConsumer batchConsumer) Initializes the committer queue.voidqueue(CommitterRequest request) Queues a committer request to be later processed in batch.toString()
-
Constructor Details
-
FsQueue
public FsQueue()
-
-
Method Details
-
init
public void init(CommitterContext committerContext, @NonNull @NonNull BatchConsumer batchConsumer) throws CommitterQueueException Description copied from interface:CommitterQueueInitializes the committer queue.- Specified by:
initin interfaceCommitterQueue- Parameters:
committerContext- committer contextbatchConsumer- batch consumer- Throws:
CommitterQueueException- could not initialize committer queue
-
getBatchConsumer
-
queue
Description copied from interface:CommitterQueueQueues a committer request to be later processed in batch.- Specified by:
queuein interfaceCommitterQueue- Parameters:
request- committer request- Throws:
CommitterQueueException- could not queue committer request
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCommitterQueue- Throws:
CommitterQueueException
-
clean
Description copied from interface:CommitterQueueCleans any persisted information specific to this queue.- Specified by:
cleanin interfaceCommitterQueue- Throws:
CommitterQueueException- could not clean queue
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getConfiguration
- Specified by:
getConfigurationin interfaceConfigurable<FsQueueConfig>
-