Class ContentFeeder
- java.lang.Object
-
- com.attivio.client.ContentFeeder
-
- All Implemented Interfaces:
DocumentOutputClient,IndexCommitter,IngestClient,SecurityFeeder,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
MockPublisher
public class ContentFeeder extends java.lang.Object implements SecurityFeeder, IngestClient, IndexCommitter
Sends content (documents, deletes, index messages) to an Attivio instance.- See Also:
IngestClient
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_BATCH_SIZE_COUNTDefault batch size.static intDEFAULT_BATCH_SIZE_MBDefault batch size in megabytes.static java.lang.StringDEFAULT_WORKFLOWprotected AttivioLoggerlogThe Attivio loggerstatic java.lang.StringORIGINAL_CLIENT_ID
-
Constructor Summary
Constructors Constructor Description ContentFeeder()Create aContentFeeder()that automatically determines endpoints for required services via service discovery.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStaticField(java.lang.String name, java.lang.Object value)Add a field to apply to all documents.protected voidbatchDocument(IngestDocument doc)Adddocto the current batch, flushing batch if any limit exceeded.voidbulkUpdate(BulkUpdate message)Sendmessageto AIE.voidclientHeartbeat()Send a client heartbeat to keep the client alive (only if active).voidclose()voidcommit(java.lang.String... zones)Sends internal queue of documents and commits all documents sent to AIE.voiddelete(java.lang.String... ids)Delete a series of documents from AIE by document id.voiddelete(java.util.Collection<java.lang.String> ids)SeeDocumentOutputClient.delete(String...)for documentation.voiddeleteByQuery(java.lang.String workflow, Query query)Delete all documents that match theQuery.voiddeleteByQuery(java.lang.String workflow, java.lang.String queryString, java.lang.String queryLanguage)voiddeletePrincipal(AttivioPrincipalKey key)Deletes a principal from the index.intdetermineMessageSize(PlatformMessage msg)protected voiddispatchDocumentsInQueue()Perform an internal batching of docs and feeds any queued documentsvoidendMessageGroup()Ends the current message group (if any).voidfeed(IngestDocument... docs)Senddocsto AIE.voidfeed(IngestDocument doc, AttivioAcl acl)Sendsdocto the document receiver with the given ACL.voidfeed(AttivioPrincipal principal)Ingests an AttivioPrincipal.voidfeed(java.lang.Iterable<IngestDocument> docs)Senddocsto AIE.protected AuditReaderApigetAuditReader()java.util.UUIDgetClientId()This id will change after any calls toIngestClient.waitForCompletion()orIngestClient.waitForCompletion(long).intgetCommitInterval()protected ContentStoreProvidergetContentStore()longgetContentStoreCnt()Experimental -- unsupported APIintgetContentStoreThresholdKB()Gets the minimum size required (in kilobytes) for content to be stored in the content store.protected longgetDocSize(IngestDocument doc)Estimate the size ofdocincluding content pointers.intgetDocumentBatchSize()Gets current documentBatchSize set.longgetDocumentsFed()Return the number of documents fed to this feeder since the connect.longgetDocumentsQueued()longgetDocumentsSent()java.lang.StringgetIngestWorkflowName()longgetInMemCnt()Experimental -- unsupported APIintgetMaxBatchSizeMB()Gets the maximum size of documents (in megabytes) that will ever be sent as part of a singleDocumentList.java.lang.StringgetMessageDefaultDomain()Returns the default message domain.intgetOptimizeInterval()protected SystemEvent.SeveritygetSeverity(AuditClientSummary summary)java.util.Map<java.lang.String,java.lang.String>getSizeToDomain()java.util.Map<java.lang.String,java.lang.Object>getStaticFields()longgetWaitForCompletionTimeout()protected voidinitializeServiceFactory()booleanisCompleted()True is all messages sent have been fully processed by AIE.booleanisMessageGroupInProgress()booleanisOrderedCommits()protected voidmakeInactive()voidoptimize()Sends internal queue of documents and optimizes the AIE index and associated data structures.ContentPointerput(java.lang.String id, byte[] bytes)Put the contents of a byte array into the content store.ContentPointerput(java.lang.String id, InputStreamBuilder builder)Stores binary data in the ContentStore.ContentPointerput(java.lang.String id, java.io.File f)Put the contents of a File into the content store.ContentPointerput(java.lang.String id, java.io.InputStream input)Put a resource into the Content Store.voidrefresh()Sends internal queue of documents and commits all partial update documents sent to AIE.voidsendIndexMessage(IndexMessage msg)Sends an arbitrary IndexMessage into the engine.protected voidsendMessageInternal(PlatformMessage message)Internal method to send amessageto theIngestApi.voidsendQueuedDocuments()Send the documents in the queue to the enginevoidsetCommitInterval(int commitInterval)Sets the interval on which an automaticCommitwill be sent to AIE.voidsetContentStoreThresholdKB(int value)Sets the minimum size required (in kilobytes) for content to be stored in the content store.voidsetDefaultMessageDomain(java.lang.String defaultDomain)voidsetDocumentBatchSize(int batchSize)Sets the maximum number of documents that will ever be sent as a part of a singleDocumentList.voidsetIngestWorkflowName(java.lang.String value)Set ingest workflow namevoidsetMaxBatchSizeMB(int value)Sets the maximum size of documents (in megabytes) that will ever be sent as part of a singleDocumentList.voidsetOptimizeInterval(int optimizeInterval)Sets the interval on which an automaticOptimizewill be sent to AIE.voidsetOrderedCommits(boolean orderedCommits)Enable or disable "Ordered Commits".voidsetSizeToDomain(java.util.Map<java.lang.String,java.lang.String> sizeToDomainMap)Sets the size to message domain map for this client.voidsetStaticFields(java.util.Map<java.lang.String,java.lang.Object> fields)Set a map of fields to apply to all documents.voidsetWaitForCompletionTimeout(long waitForCompletionTimeout)voidstartMessageGroup()Starts a group of messages that will be processed together.java.lang.StringtoString()booleanwaitForCompletion()Wait for all documents and messages to be fully processed.booleanwaitForCompletion(boolean changeClientId)Wait the specified number of milliseconds for all MessageResults to be processed.booleanwaitForCompletion(long timeoutMillis)Wait the specified number of milliseconds for all MessageResults to be processed.booleanwaitForCompletion(long timeout, boolean changeClientId)Wait the specified number of milliseconds for all MessageResults to be processed.
-
-
-
Field Detail
-
DEFAULT_WORKFLOW
public static final java.lang.String DEFAULT_WORKFLOW
- See Also:
- Constant Field Values
-
ORIGINAL_CLIENT_ID
public static final java.lang.String ORIGINAL_CLIENT_ID
- See Also:
- Constant Field Values
-
DEFAULT_BATCH_SIZE_COUNT
public static final int DEFAULT_BATCH_SIZE_COUNT
Default batch size.- See Also:
- Constant Field Values
-
DEFAULT_BATCH_SIZE_MB
public static final int DEFAULT_BATCH_SIZE_MB
Default batch size in megabytes.- See Also:
- Constant Field Values
-
log
protected final AttivioLogger log
The Attivio logger
-
-
Constructor Detail
-
ContentFeeder
public ContentFeeder()
Create aContentFeeder()that automatically determines endpoints for required services via service discovery. If HTTP authentication is configured for the system, authorization parameters will be automatically set unless they have already been set by alternate means.
-
-
Method Detail
-
initializeServiceFactory
protected void initializeServiceFactory()
-
getContentStore
protected ContentStoreProvider getContentStore() throws AttivioException
- Throws:
AttivioException
-
getAuditReader
protected AuditReaderApi getAuditReader() throws AttivioException
- Throws:
AttivioException
-
getClientId
public java.util.UUID getClientId()
This id will change after any calls toIngestClient.waitForCompletion()orIngestClient.waitForCompletion(long). Note thatwaitForCompletionis implicitly called or when commits or optimizes occur ifIngestClient.isOrderedCommits()istrue.- Specified by:
getClientIdin interfaceIngestClient- Returns:
- the client ID used for this feeder
-
getDocumentsSent
public long getDocumentsSent()
- Specified by:
getDocumentsSentin interfaceIngestClient- Returns:
- the number of documents sent from this client to AIE.
-
getDocumentsFed
public long getDocumentsFed()
Return the number of documents fed to this feeder since the connect.As a general rule:
IngestClient.getDocumentsFed()-IngestClient.getDocumentsQueued()will equalIngestClient.getDocumentsSent().- Specified by:
getDocumentsFedin interfaceIngestClient- Returns:
- the number of documents that have been fed.
-
getStaticFields
public java.util.Map<java.lang.String,java.lang.Object> getStaticFields()
- Specified by:
getStaticFieldsin interfaceIngestClient- Returns:
- a map of all fields that will be set on every document sent from this feeder.
-
setStaticFields
public void setStaticFields(java.util.Map<java.lang.String,java.lang.Object> fields)
Set a map of fields to apply to all documents.- Specified by:
setStaticFieldsin interfaceIngestClient- Parameters:
fields- the fields and values to set
-
addStaticField
public void addStaticField(java.lang.String name, java.lang.Object value)Add a field to apply to all documents.- Specified by:
addStaticFieldin interfaceIngestClient- Parameters:
name- the name of the fieldvalue- the value of the field
-
feed
public void feed(IngestDocument... docs) throws AttivioException
Senddocsto AIE.- Specified by:
feedin interfaceDocumentOutputClient- Parameters:
docs- the documents to send.- Throws:
AttivioException
-
feed
public void feed(java.lang.Iterable<IngestDocument> docs) throws AttivioException
Senddocsto AIE.- Specified by:
feedin interfaceDocumentOutputClient- Parameters:
docs- the documents to send.- Throws:
AttivioException
-
feed
public void feed(IngestDocument doc, AttivioAcl acl) throws AttivioException
Sendsdocto the document receiver with the given ACL.- Specified by:
feedin interfaceIngestClient- Specified by:
feedin interfaceSecurityFeeder- Parameters:
doc- the documentacl- the ACL- Throws:
AttivioException- if sending of documents fails.
-
feed
public void feed(AttivioPrincipal principal) throws AttivioException
Ingests an AttivioPrincipal. Any existing data for the principal and its associations will be deleted.- Specified by:
feedin interfaceIngestClient- Specified by:
feedin interfaceSecurityFeeder- Parameters:
principal- the principal- Throws:
AttivioException- if sending of documents fails.
-
deletePrincipal
public void deletePrincipal(AttivioPrincipalKey key) throws AttivioException
Deletes a principal from the index.- Specified by:
deletePrincipalin interfaceIngestClient- Specified by:
deletePrincipalin interfaceSecurityFeeder- Parameters:
key- unique ID of the principal- Throws:
AttivioException- if sending of documents fails.
-
sendIndexMessage
public void sendIndexMessage(IndexMessage msg) throws AttivioException
Description copied from interface:IngestClientSends an arbitrary IndexMessage into the engine.If the feeder is batching documents, this method will send any queued documents before sending the index message.
If
IngestClient.isOrderedCommits()is true and this message is aCommitorOptimize, then this method will first ensure all previously sent documents are in the index, before sending this index message.- Specified by:
sendIndexMessagein interfaceIngestClient- Parameters:
msg- the IndexMessage to send.- Throws:
AttivioException- if sending of the message fails.
-
delete
public void delete(java.lang.String... ids) throws AttivioExceptionDelete a series of documents from AIE by document id.If batching is enabled, then these delete messages will be batched along with any fed documents. If these deletes are meant to apply to uncommitted documents previously fed with this ContentFeeder, then those documents must be committed to the index before this delete is called. When ordered commits is enabled, this entails calling:
contentFeeder.commit(); contentFeeder.waitForCompletion(); contentFeeder.delete("id1",...);When ordered commits is disabled, it entails calling:contentFeeder.waitForCompletion(); contentFeeder.commit(); contentFeeder.waitForCompletion(); contentFeeder.delete("id1",...);- Specified by:
deletein interfaceDocumentOutputClient- Parameters:
ids- The document IDs of the documents to delete.- Throws:
AttivioException- if sending of deletes fails.
-
delete
public void delete(java.util.Collection<java.lang.String> ids) throws AttivioExceptionSeeDocumentOutputClient.delete(String...)for documentation.- Specified by:
deletein interfaceDocumentOutputClient- Throws:
AttivioException
-
deleteByQuery
public void deleteByQuery(java.lang.String workflow, Query query) throws AttivioExceptionDelete all documents that match theQuery.If documents are currently batched up, then those documents will be sent along with this delete.
Use
DocumentOutputClient.bulkUpdate(BulkUpdate)to feed more complicated delete queries. If these deletes are meant to apply to uncommitted documents previously fed with this ContentFeeder, then those documents must be committed to the index before this delete is called. When ordered commits is enabled, this entails calling:contentFeeder.commit(); contentFeeder.waitForCompletion(); contentFeeder.delete("id1",...);When ordered commits is disabled, it entails calling:contentFeeder.waitForCompletion(); contentFeeder.commit(); contentFeeder.waitForCompletion(); contentFeeder.delete(...);
- Specified by:
deleteByQueryin interfaceDocumentOutputClient- Parameters:
workflow- the query workflow or null if none neededquery- query to delete by- Throws:
AttivioException
-
bulkUpdate
public void bulkUpdate(BulkUpdate message) throws AttivioException
Sendmessageto AIE.- Specified by:
bulkUpdatein interfaceDocumentOutputClient- Throws:
AttivioException
-
sendMessageInternal
protected void sendMessageInternal(PlatformMessage message) throws AttivioException
Internal method to send amessageto theIngestApi.- Throws:
AttivioException
-
determineMessageSize
public int determineMessageSize(PlatformMessage msg)
-
deleteByQuery
public void deleteByQuery(java.lang.String workflow, java.lang.String queryString, java.lang.String queryLanguage) throws AttivioException- Throws:
AttivioException
-
startMessageGroup
public void startMessageGroup() throws AttivioExceptionStarts a group of messages that will be processed together. All documents and deletes in the group will be processed together and in the order created. NOTE: failure to end a started message group will cause the last message of the group in progress to not be sent.- Specified by:
startMessageGroupin interfaceDocumentOutputClient- Throws:
AttivioException
-
endMessageGroup
public void endMessageGroup() throws AttivioExceptionEnds the current message group (if any). The next feed or delete will not be part of any group unlessDocumentOutputClient.startMessageGroup()is called again.- Specified by:
endMessageGroupin interfaceDocumentOutputClient- Throws:
AttivioException
-
isMessageGroupInProgress
public boolean isMessageGroupInProgress()
- Specified by:
isMessageGroupInProgressin interfaceDocumentOutputClient- Returns:
trueif a message group has been started and not yet ended.
-
commit
public void commit(java.lang.String... zones) throws AttivioExceptionSends internal queue of documents and commits all documents sent to AIE.If
IngestClient.isOrderedCommits()is true (typically the default "Ordered Commits" mode), then wait for all previously fed documents to make it to the index, before committing, thus ensuring all previously fed documents get committed (this may take a while). Additionally, in such a case, the clientId will change for future messages.- Specified by:
commitin interfaceIndexCommitter- Specified by:
commitin interfaceIngestClient- Parameters:
zones- an optional list of zones to commit - if no zones are specified, all zones are committed- Throws:
AttivioException- on failure
-
refresh
public void refresh() throws AttivioExceptionSends internal queue of documents and commits all partial update documents sent to AIE.If
IngestClient.isOrderedCommits()is true (typically the default "Ordered Commits" mode), then wait for all previously fed documents to make it to the index, before refreshing, thus ensuring all previously fed documents get refreshed. (this may take a while)- Specified by:
refreshin interfaceIngestClient- Throws:
AttivioException- on failure
-
optimize
public void optimize() throws AttivioExceptionSends internal queue of documents and optimizes the AIE index and associated data structures.If
IngestClient.isOrderedCommits()is true (typically the default "Ordered Commits" mode), then wait for all previously fed documents to make it to the index, before refreshing, thus ensuring all previously fed documents get optimized (this may take a while). Additionally, in such a case, the clientId will change for future messages.- Specified by:
optimizein interfaceIngestClient- Throws:
AttivioException- on failure
-
getInMemCnt
public long getInMemCnt()
Experimental -- unsupported API
-
getContentStoreCnt
public long getContentStoreCnt()
Experimental -- unsupported API
-
put
public ContentPointer put(java.lang.String id, java.io.InputStream input) throws AttivioException
Put a resource into the Content Store.If no ContentStore is in configured for this ContentFeeder, then a
ByteArrayContentPointeris used and returned.If
inputproduces less thanIngestClient.getContentStoreThresholdKB(), then aByteArrayContentPointerwill be returned.- Specified by:
putin interfaceIngestClient- Parameters:
id- the ID of the resource to put into the Content Store.input- the input stream for the resource's data.- Returns:
- a ContentPointer for the resource.
- Throws:
AttivioException- if putting the resource into the Content Store fails.
-
put
public ContentPointer put(java.lang.String id, byte[] bytes) throws AttivioException
Put the contents of a byte array into the content store.- Specified by:
putin interfaceIngestClient- Parameters:
id- the ID of the resource to put into the Content Store.bytes- data to put.- Returns:
- a ContentPointer for the resource.
- Throws:
AttivioException- if putting the resource into the Content Store fails.- See Also:
IngestClient.put(String, InputStream)
-
put
public ContentPointer put(java.lang.String id, InputStreamBuilder builder) throws AttivioException
Stores binary data in the ContentStore.- Specified by:
putin interfaceIngestClient- Parameters:
id- the ID of the resource to put into the Content Store.builder- the input stream for the resource's data.- Returns:
- a ContentPointer for the resource.
- Throws:
AttivioException- See Also:
IngestClient.put(String, InputStream)
-
put
public ContentPointer put(java.lang.String id, java.io.File f) throws AttivioException
Put the contents of a File into the content store.- Specified by:
putin interfaceIngestClient- Parameters:
id- the ID of the resource to put into the Content Store.f- file with data.- Returns:
- a ContentPointer for the resource.
- Throws:
AttivioException- if putting the resource into the Content Store fails.- See Also:
IngestClient.put(String, InputStream)
-
waitForCompletion
public boolean waitForCompletion() throws AttivioExceptionWait for all documents and messages to be fully processed. If the time is exceeded and not all documents have been processed, then errors will be logged for the missing document results. Note, after a successful waitForCompletion, the ID returned byIngestClient.getClientId()will change to a new random UUID. If changing the ID is not desired behavior, seeIngestClient.waitForCompletion(boolean changeClientId)- Specified by:
waitForCompletionin interfaceIngestClient- Returns:
- true if all outstanding documents and messages were processed before the timeout (or audits are disabled).
- Throws:
AttivioException
-
waitForCompletion
public boolean waitForCompletion(long timeoutMillis) throws AttivioExceptionWait the specified number of milliseconds for all MessageResults to be processed. Note, after a successful waitForCompletion, the ID returned byIngestClient.getClientId()will change to a new random UUID. If changing the ID is not desired behavior, seeIngestClient.waitForCompletion(long timeout, boolean changeClientId)A timeout of
<=0means to wait forever.- Specified by:
waitForCompletionin interfaceIngestClient- Parameters:
timeoutMillis- max time to wait in milliseconds- Returns:
- true if all outstanding documents and messages were processed before the timeout (or audits are disabled).
- Throws:
AttivioException
-
waitForCompletion
public boolean waitForCompletion(boolean changeClientId) throws AttivioExceptionWait the specified number of milliseconds for all MessageResults to be processed. Note, after a successful waitForCompletion, the ID returned byIngestClient.getClientId()will change to a new random UUID if thechangeClientIdparameter provided to this method istrue. Otherwise, the ID will remain consistent.- Specified by:
waitForCompletionin interfaceIngestClient- Parameters:
changeClientId- whether to change the clientId or not- Returns:
- true if all outstanding documents and messages were processed before the timeout (or audits are disabled).
- Throws:
AttivioException
-
getSeverity
protected SystemEvent.Severity getSeverity(AuditClientSummary summary)
-
waitForCompletion
public boolean waitForCompletion(long timeout, boolean changeClientId) throws AttivioExceptionWait the specified number of milliseconds for all MessageResults to be processed. Note, after a successful waitForCompletion, the ID returned byIngestClient.getClientId()will change to a new random UUID if thechangeClientIdparameter provided to this method istrue. Otherwise, the ID will remain consistent.A timeout of
<=0means to wait forever.- Specified by:
waitForCompletionin interfaceIngestClient- Parameters:
timeout- max time to wait in millisecondschangeClientId- whether to change the clientId or not- Returns:
- true if all outstanding documents and messages were processed before the timeout (or audits are disabled).
- Throws:
AttivioException
-
sendQueuedDocuments
public void sendQueuedDocuments() throws AttivioExceptionSend the documents in the queue to the engine- Specified by:
sendQueuedDocumentsin interfaceIngestClient- Throws:
AttivioException
-
getDocSize
protected long getDocSize(IngestDocument doc)
Estimate the size ofdocincluding content pointers.
-
batchDocument
protected void batchDocument(IngestDocument doc) throws AttivioException
Adddocto the current batch, flushing batch if any limit exceeded.- Throws:
AttivioException
-
dispatchDocumentsInQueue
protected void dispatchDocumentsInQueue() throws AttivioExceptionPerform an internal batching of docs and feeds any queued documents- Throws:
AttivioException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setOrderedCommits
public void setOrderedCommits(boolean orderedCommits)
Enable or disable "Ordered Commits". Ordered commits ensure that all content fed to AIE is completed before a commit call is executed. This has the effect of making theIngestClient.commit(String...)a blocking call while a call toIngestClient.waitForCompletion()is called.Please refer to the documentation on ordered commits the developer network for more information.
- Specified by:
setOrderedCommitsin interfaceIngestClient- Parameters:
orderedCommits- set to true to enable this or false to disable it
-
isOrderedCommits
public boolean isOrderedCommits()
- Specified by:
isOrderedCommitsin interfaceIngestClient- Returns:
- true if "Ordered Commits" is enabled
-
getDocumentBatchSize
public int getDocumentBatchSize()
Gets current documentBatchSize set.- Specified by:
getDocumentBatchSizein interfaceIngestClient- Returns:
- the maximum number of documents that will ever be sent as a part of a single
DocumentList.
-
setDocumentBatchSize
public void setDocumentBatchSize(int batchSize)
Sets the maximum number of documents that will ever be sent as a part of a singleDocumentList.This batch size (specified in number of documents) does not guarantee that all DocumentLists will be exactly this size as calls to
IngestClient.commit(String...),IngestClient.optimize()orDocumentOutputClient.startMessageGroup()can cause smaller batches to be sent.- Specified by:
setDocumentBatchSizein interfaceIngestClient- Parameters:
batchSize- in number of documents
-
getMaxBatchSizeMB
public int getMaxBatchSizeMB()
Gets the maximum size of documents (in megabytes) that will ever be sent as part of a singleDocumentList.Document size will be estimated based on field values and the size of any
ContentPointers included in the document.- Specified by:
getMaxBatchSizeMBin interfaceIngestClient
-
setMaxBatchSizeMB
public void setMaxBatchSizeMB(int value)
Sets the maximum size of documents (in megabytes) that will ever be sent as part of a singleDocumentList.Document size will be estimated based on field values and the size of any
ContentPointers included in the document.This batch size (specified in megabytes) does not guarantee that all DocumentLists will be exactly this size as calls to
IngestClient.commit(String...),IngestClient.optimize()orDocumentOutputClient.startMessageGroup()can cause smaller batches to be sent. The specifiedIngestClient.getDocumentBatchSize()will also be used to limit the size of DocumentLists.- Specified by:
setMaxBatchSizeMBin interfaceIngestClient
-
getContentStoreThresholdKB
public int getContentStoreThresholdKB()
Gets the minimum size required (in kilobytes) for content to be stored in the content store.- Specified by:
getContentStoreThresholdKBin interfaceIngestClient- See Also:
IngestClient.put(String, InputStream)
-
setContentStoreThresholdKB
public void setContentStoreThresholdKB(int value)
Sets the minimum size required (in kilobytes) for content to be stored in the content store.- Specified by:
setContentStoreThresholdKBin interfaceIngestClient- See Also:
IngestClient.put(String, InputStream)
-
getDocumentsQueued
public long getDocumentsQueued()
- Specified by:
getDocumentsQueuedin interfaceIngestClient- Returns:
- the number of documents that are batched up in the queue to be sent to AIE.
-
setCommitInterval
public void setCommitInterval(int commitInterval)
Sets the interval on which an automaticCommitwill be sent to AIE.- Specified by:
setCommitIntervalin interfaceIngestClient- Parameters:
commitInterval- in number of documents
-
getCommitInterval
public int getCommitInterval()
- Specified by:
getCommitIntervalin interfaceIngestClient- Returns:
- commit interval in number of documents
-
setOptimizeInterval
public void setOptimizeInterval(int optimizeInterval)
Sets the interval on which an automaticOptimizewill be sent to AIE.- Specified by:
setOptimizeIntervalin interfaceIngestClient- Parameters:
optimizeInterval- in number of documents
-
getOptimizeInterval
public int getOptimizeInterval()
- Specified by:
getOptimizeIntervalin interfaceIngestClient- Returns:
- optimize interval in number of documents
-
setIngestWorkflowName
public void setIngestWorkflowName(java.lang.String value)
Set ingest workflow name- Specified by:
setIngestWorkflowNamein interfaceIngestClient- Parameters:
value- workflow name
-
getIngestWorkflowName
public java.lang.String getIngestWorkflowName()
- Specified by:
getIngestWorkflowNamein interfaceIngestClient- Returns:
- ingest workflow name
-
getSizeToDomain
public java.util.Map<java.lang.String,java.lang.String> getSizeToDomain()
- Specified by:
getSizeToDomainin interfaceIngestClient- Returns:
- return the size to message domain map for this client
-
setSizeToDomain
public void setSizeToDomain(java.util.Map<java.lang.String,java.lang.String> sizeToDomainMap)
Sets the size to message domain map for this client. Message domains allow AIE to devote differing amounts of processing resources to messages from different sources. This facility is generally used to restrict the resources devoted to sources of large documents so that other sources can continue to make progress. Message domains are take effect only when the AIE cluster is configured with matching message domain names. The domain choice offered by this map is represented as a map of minimum size to domain. All batches of documents whose total size is greater than or equal to the minimum size of a domain 'd' but less than any other minimum size for other domains will be mapped to domain 'd'. Any batch smaller than this minimum size will have no domain mapping. Megabytes are used as the unit for the size- Specified by:
setSizeToDomainin interfaceIngestClient
-
makeInactive
protected void makeInactive() throws AttivioException- Throws:
AttivioException
-
clientHeartbeat
public void clientHeartbeat() throws AttivioExceptionSend a client heartbeat to keep the client alive (only if active).- Throws:
AttivioException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
isCompleted
public boolean isCompleted() throws AttivioExceptionTrue is all messages sent have been fully processed by AIE.- Specified by:
isCompletedin interfaceIngestClient- Throws:
AttivioException
-
getWaitForCompletionTimeout
public long getWaitForCompletionTimeout()
-
setWaitForCompletionTimeout
public void setWaitForCompletionTimeout(long waitForCompletionTimeout)
-
getMessageDefaultDomain
public java.lang.String getMessageDefaultDomain()
Returns the default message domain. IfgetSizeToDomain()returnsnullor its size is 0, then the domain will be set to the default message domain. This allows explicit control of the message domain for a particular client. By default, the default message domain isnull, meaning no domain.
-
setDefaultMessageDomain
public void setDefaultMessageDomain(java.lang.String defaultDomain)
-
-