public class IdolCommitter extends AbstractBatchCommitter
Commits documents to IDOL Server/DIH or Connector Framework Server (CFS). Specifying either the index port or the cfs port determines which of the two will be the documents target.
Optionally apply a committer only to certain type of documents. Documents are restricted based on their metadata field names and values. This option can be used to perform document routing when you have multiple committers defined.
By default, this abstract class applies field mappings for metadata fields, but leaves the document reference and content (input stream) for concrete implementations to handle. In other words, they only apply to a committer request metadata. Field mappings are performed on committer requests before upserts and deletes are actually performed.
<committer
class="com.norconex.committer.idol.IdolCommitter">
<url>(IDOL/DIH/CFS index action URL. Default is "http://localhost:9001")</url>
<cfs>[false|true](whether URL points to a Connector Framework Server)</cfs>
<databaseName>
(Optional IDOL Database Name where to store documents)
</databaseName>
<dreAddDataParams>
<param
name="(parameter name)">
(parameter value)
</param>
</dreAddDataParams>
<dreDeleteRefParams>
<param
name="(parameter name)">
(parameter value)
</param>
</dreDeleteRefParams>
<sourceReferenceField>
(Optional name of the field holding the value to be stored in the
IDOL "DREREFERENCE" field. Default is the document reference.)
</sourceReferenceField>
<sourceContentField>
(Optional name of the field holding the value to be stored in the
IDOL "DRECONTENT" field. Default is the document content stream.)
</sourceContentField>
<!-- multiple "restrictTo" tags allowed (only one needs to match) -->
<restrictTo>
<fieldMatcher
method="[basic|csv|wildcard|regex]"
ignoreCase="[false|true]"
ignoreDiacritic="[false|true]"
partial="[false|true]">
(field-matching expression)
</fieldMatcher>
<valueMatcher
method="[basic|csv|wildcard|regex]"
ignoreCase="[false|true]"
ignoreDiacritic="[false|true]"
partial="[false|true]">
(value-matching expression)
</valueMatcher>
</restrictTo>
<fieldMappings>
<!-- Add as many field mappings as needed -->
<mapping
fromField="(source field name)"
toField="(target field name)"/>
</fieldMappings>
<!-- Settings for default queue implementation ("class" is optional): -->
<queue
class="com.norconex.committer.core3.batch.queue.impl.FSQueue">
<batchSize>
(Optional number of documents queued after which we process a batch.
Default is 20.)
</batchSize>
<maxPerFolder>
(Optional maximum number of files or directories that can be queued
in a single folder before a new one gets created. Default is 500.)
</maxPerFolder>
<commitLeftoversOnInit>
(Optionally force to commit any leftover documents from a previous
execution. E.g., prematurely ended. Default is "false").
</commitLeftoversOnInit>
<onCommitFailure>
<splitBatch>[OFF|HALF|ONE]</splitBatch>
<maxRetries>(Max retries upon commit failures. Default is 0.)</maxRetries>
<retryDelay>
(Delay in milliseconds between retries. Default is 0.)
</retryDelay>
<ignoreErrors>
[false|true]
(When true, non-critical exceptions when interacting with the target
repository won't be thrown to try continue the execution with other
files to be committed. Instead, errors will be logged.
In both cases the failing batch/files are moved to an
"error" folder. Other types of exceptions may still be thrown.)
</ignoreErrors>
</onCommitFailure>
</queue>
</committer>
XML configuration entries expecting millisecond durations
can be provided in human-readable format (English only), as per
DurationParser
(e.g., "5 minutes and 30 seconds" or "5m30s").
<committer
class="com.norconex.committer.idol.IdolCommitter">
<url>http://some_host:9100</url>
<databaseName>some_database</databaseName>
</committer>
Constructor and Description |
---|
IdolCommitter() |
Modifier and Type | Method and Description |
---|---|
protected void |
commitBatch(Iterator<ICommitterRequest> it) |
boolean |
equals(Object other) |
IdolCommitterConfig |
getConfig() |
int |
hashCode() |
protected void |
initBatchCommitter() |
protected void |
loadBatchCommitterFromXML(XML xml) |
protected void |
saveBatchCommitterToXML(XML xml) |
String |
toString() |
closeBatchCommitter, consume, doClean, doClose, doDelete, doInit, doUpsert, getCommitterQueue, loadCommitterFromXML, saveCommitterToXML, setCommitterQueue
accept, addRestriction, addRestrictions, applyFieldMappings, clean, clearFieldMappings, clearRestrictions, close, delete, fireDebug, fireDebug, fireError, fireError, fireInfo, fireInfo, getCommitterContext, getFieldMappings, getRestrictions, init, loadFromXML, removeFieldMapping, removeRestriction, removeRestriction, saveToXML, setFieldMapping, setFieldMappings, upsert
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
loadFromXML, saveToXML
public IdolCommitterConfig getConfig()
protected void initBatchCommitter() throws CommitterException
initBatchCommitter
in class AbstractBatchCommitter
CommitterException
protected void commitBatch(Iterator<ICommitterRequest> it) throws CommitterException
commitBatch
in class AbstractBatchCommitter
CommitterException
protected void loadBatchCommitterFromXML(XML xml)
loadBatchCommitterFromXML
in class AbstractBatchCommitter
protected void saveBatchCommitterToXML(XML xml)
saveBatchCommitterToXML
in class AbstractBatchCommitter
public boolean equals(Object other)
equals
in class AbstractBatchCommitter
public int hashCode()
hashCode
in class AbstractBatchCommitter
public String toString()
toString
in class AbstractBatchCommitter
Copyright © 2013–2022 Norconex Inc.. All rights reserved.