Class AmazonCloudSearchCommitter
- All Implemented Interfaces:
BatchConsumer,Committer,Configurable<AmazonCloudSearchCommitterConfig>,AutoCloseable
Commits documents to Amazon CloudSearch.
Authentication:
An access key and security key are required to connect to and interact with
CloudSearch. For enhanced security, it is best to use one of the methods
described in DefaultAWSCredentialsProviderChain for setting them
(environment variables, system properties, profile file, etc).
Do not explicitly set "accessKey" and "secretKey" on this class if you
want to rely on safer methods.
CloudSearch ID limitations:
As of this writing, CloudSearch has a 128 characters length limitation
on its "id" field. In addition, certain characters are not allowed.
By default, an error will result from trying to submit
documents with an invalid ID. You can get around this by
setting AmazonCloudSearchCommitterConfig.setFixBadIds(boolean)
to true. It will
truncate references that are too long and append a hash code to it
to keep uniqueness. It will also convert invalid
characters to underscore. This approach is not 100%
collision-free (uniqueness), but it should safely cover the vast
majority of cases.
- Author:
- Pascal Essiembre
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCloudSearch mandatory ID fieldstatic final PatternCouldSearch mandatory field pattern.Fields inherited from interface com.norconex.commons.lang.config.Configurable
PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected voidSubclasses can perform additional closing logic by overriding this method.protected voidCommits the supplied batch.booleaninthashCode()protected voidSubclasses can perform additional initialization by overriding this method.toString()Methods inherited from class com.norconex.committer.core.batch.AbstractBatchCommitter
consume, doClean, doClose, doDelete, doInit, doUpsert, getInitializedQueueMethods inherited from class com.norconex.committer.core.AbstractCommitter
accept, applyFieldMappings, clean, close, delete, fireDebug, fireDebug, fireError, fireError, fireInfo, fireInfo, getCommitterContext, init, upsert
-
Field Details
-
FIELD_PATTERN
CouldSearch mandatory field pattern. Characters not matching the pattern will be replaced by an underscore. -
COULDSEARCH_ID_FIELD
CloudSearch mandatory ID field- See Also:
-
-
Constructor Details
-
AmazonCloudSearchCommitter
public AmazonCloudSearchCommitter()
-
-
Method Details
-
initBatchCommitter
Description copied from class:AbstractBatchCommitterSubclasses can perform additional initialization by overriding this method. Default implementation does nothing. The committer context and committer queue will be already initialized when invokingAbstractCommitter.getCommitterContext()andAbstractBatchCommitter.getInitializedQueue(), respectively.- Overrides:
initBatchCommitterin classAbstractBatchCommitter<AmazonCloudSearchCommitterConfig>- Throws:
CommitterException- error initializing
-
commitBatch
Description copied from class:AbstractBatchCommitterCommits the supplied batch.- Specified by:
commitBatchin classAbstractBatchCommitter<AmazonCloudSearchCommitterConfig>- Parameters:
it- the batch to commit- Throws:
CommitterException- could not commit the batch
-
closeBatchCommitter
Description copied from class:AbstractBatchCommitterSubclasses can perform additional closing logic by overriding this method. Default implementation does nothing.- Overrides:
closeBatchCommitterin classAbstractBatchCommitter<AmazonCloudSearchCommitterConfig>- Throws:
CommitterException- error closing committer
-
equals
- Overrides:
equalsin classAbstractBatchCommitter<AmazonCloudSearchCommitterConfig>
-
canEqual
- Overrides:
canEqualin classAbstractBatchCommitter<AmazonCloudSearchCommitterConfig>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractBatchCommitter<AmazonCloudSearchCommitterConfig>
-
toString
- Overrides:
toStringin classAbstractBatchCommitter<AmazonCloudSearchCommitterConfig>
-
getConfiguration
-