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 int
DEFAULT_BATCH_SIZE_COUNT
Default batch size.static int
DEFAULT_BATCH_SIZE_MB
Default batch size in megabytes.static java.lang.String
DEFAULT_WORKFLOW
protected AttivioLogger
log
The Attivio loggerstatic java.lang.String
ORIGINAL_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 void
addStaticField(java.lang.String name, java.lang.Object value)
Add a field to apply to all documents.protected void
batchDocument(IngestDocument doc)
Adddoc
to the current batch, flushing batch if any limit exceeded.void
bulkUpdate(BulkUpdate message)
Sendmessage
to AIE.void
clientHeartbeat()
Send a client heartbeat to keep the client alive (only if active).void
close()
void
commit(java.lang.String... zones)
Sends internal queue of documents and commits all documents sent to AIE.void
delete(java.lang.String... ids)
Delete a series of documents from AIE by document id.void
delete(java.util.Collection<java.lang.String> ids)
SeeDocumentOutputClient.delete(String...)
for documentation.void
deleteByQuery(java.lang.String workflow, Query query)
Delete all documents that match theQuery
.void
deleteByQuery(java.lang.String workflow, java.lang.String queryString, java.lang.String queryLanguage)
void
deletePrincipal(AttivioPrincipalKey key)
Deletes a principal from the index.int
determineMessageSize(PlatformMessage msg)
protected void
dispatchDocumentsInQueue()
Perform an internal batching of docs and feeds any queued documentsvoid
endMessageGroup()
Ends the current message group (if any).void
feed(IngestDocument... docs)
Senddocs
to AIE.void
feed(IngestDocument doc, AttivioAcl acl)
Sendsdoc
to the document receiver with the given ACL.void
feed(AttivioPrincipal principal)
Ingests an AttivioPrincipal.void
feed(java.lang.Iterable<IngestDocument> docs)
Senddocs
to AIE.protected AuditReaderApi
getAuditReader()
java.util.UUID
getClientId()
This id will change after any calls toIngestClient.waitForCompletion()
orIngestClient.waitForCompletion(long)
.int
getCommitInterval()
protected ContentStoreProvider
getContentStore()
long
getContentStoreCnt()
Experimental -- unsupported APIint
getContentStoreThresholdKB()
Gets the minimum size required (in kilobytes) for content to be stored in the content store.protected long
getDocSize(IngestDocument doc)
Estimate the size ofdoc
including content pointers.int
getDocumentBatchSize()
Gets current documentBatchSize set.long
getDocumentsFed()
Return the number of documents fed to this feeder since the connect.long
getDocumentsQueued()
long
getDocumentsSent()
java.lang.String
getIngestWorkflowName()
long
getInMemCnt()
Experimental -- unsupported APIint
getMaxBatchSizeMB()
Gets the maximum size of documents (in megabytes) that will ever be sent as part of a singleDocumentList
.java.lang.String
getMessageDefaultDomain()
Returns the default message domain.int
getOptimizeInterval()
protected SystemEvent.Severity
getSeverity(AuditClientSummary summary)
java.util.Map<java.lang.String,java.lang.String>
getSizeToDomain()
java.util.Map<java.lang.String,java.lang.Object>
getStaticFields()
long
getWaitForCompletionTimeout()
protected void
initializeServiceFactory()
boolean
isCompleted()
True is all messages sent have been fully processed by AIE.boolean
isMessageGroupInProgress()
boolean
isOrderedCommits()
protected void
makeInactive()
void
optimize()
Sends internal queue of documents and optimizes the AIE index and associated data structures.ContentPointer
put(java.lang.String id, byte[] bytes)
Put the contents of a byte array into the content store.ContentPointer
put(java.lang.String id, InputStreamBuilder builder)
Stores binary data in the ContentStore.ContentPointer
put(java.lang.String id, java.io.File f)
Put the contents of a File into the content store.ContentPointer
put(java.lang.String id, java.io.InputStream input)
Put a resource into the Content Store.void
refresh()
Sends internal queue of documents and commits all partial update documents sent to AIE.void
sendIndexMessage(IndexMessage msg)
Sends an arbitrary IndexMessage into the engine.protected void
sendMessageInternal(PlatformMessage message)
Internal method to send amessage
to theIngestApi
.void
sendQueuedDocuments()
Send the documents in the queue to the enginevoid
setCommitInterval(int commitInterval)
Sets the interval on which an automaticCommit
will be sent to AIE.void
setContentStoreThresholdKB(int value)
Sets the minimum size required (in kilobytes) for content to be stored in the content store.void
setDefaultMessageDomain(java.lang.String defaultDomain)
void
setDocumentBatchSize(int batchSize)
Sets the maximum number of documents that will ever be sent as a part of a singleDocumentList
.void
setIngestWorkflowName(java.lang.String value)
Set ingest workflow namevoid
setMaxBatchSizeMB(int value)
Sets the maximum size of documents (in megabytes) that will ever be sent as part of a singleDocumentList
.void
setOptimizeInterval(int optimizeInterval)
Sets the interval on which an automaticOptimize
will be sent to AIE.void
setOrderedCommits(boolean orderedCommits)
Enable or disable "Ordered Commits".void
setSizeToDomain(java.util.Map<java.lang.String,java.lang.String> sizeToDomainMap)
Sets the size to message domain map for this client.void
setStaticFields(java.util.Map<java.lang.String,java.lang.Object> fields)
Set a map of fields to apply to all documents.void
setWaitForCompletionTimeout(long waitForCompletionTimeout)
void
startMessageGroup()
Starts a group of messages that will be processed together.java.lang.String
toString()
boolean
waitForCompletion()
Wait for all documents and messages to be fully processed.boolean
waitForCompletion(boolean changeClientId)
Wait the specified number of milliseconds for all MessageResults to be processed.boolean
waitForCompletion(long timeout)
Wait the specified number of milliseconds for all MessageResults to be processed.boolean
waitForCompletion(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 thatwaitForCompletion
is implicitly called or when commits or optimizes occur ifIngestClient.isOrderedCommits()
istrue
.- Specified by:
getClientId
in interfaceIngestClient
- Returns:
- the client ID used for this feeder
-
getDocumentsSent
public long getDocumentsSent()
- Specified by:
getDocumentsSent
in 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:
getDocumentsFed
in interfaceIngestClient
- Returns:
- the number of documents that have been fed.
-
getStaticFields
public java.util.Map<java.lang.String,java.lang.Object> getStaticFields()
- Specified by:
getStaticFields
in 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:
setStaticFields
in 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:
addStaticField
in interfaceIngestClient
- Parameters:
name
- the name of the fieldvalue
- the value of the field
-
feed
public void feed(IngestDocument... docs) throws AttivioException
Senddocs
to AIE.- Specified by:
feed
in interfaceDocumentOutputClient
- Parameters:
docs
- the documents to send.- Throws:
AttivioException
-
feed
public void feed(java.lang.Iterable<IngestDocument> docs) throws AttivioException
Senddocs
to AIE.- Specified by:
feed
in interfaceDocumentOutputClient
- Parameters:
docs
- the documents to send.- Throws:
AttivioException
-
feed
public void feed(IngestDocument doc, AttivioAcl acl) throws AttivioException
Sendsdoc
to the document receiver with the given ACL.- Specified by:
feed
in interfaceIngestClient
- Specified by:
feed
in 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:
feed
in interfaceIngestClient
- Specified by:
feed
in 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:
deletePrincipal
in interfaceIngestClient
- Specified by:
deletePrincipal
in 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:IngestClient
Sends 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 aCommit
orOptimize
, then this method will first ensure all previously sent documents are in the index, before sending this index message.- Specified by:
sendIndexMessage
in interfaceIngestClient
- Parameters:
msg
- the IndexMessage to send.- Throws:
AttivioException
- if sending of the message fails.
-
delete
public void delete(java.lang.String... ids) throws AttivioException
Delete 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:
delete
in 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 AttivioException
SeeDocumentOutputClient.delete(String...)
for documentation.- Specified by:
delete
in interfaceDocumentOutputClient
- Throws:
AttivioException
-
deleteByQuery
public void deleteByQuery(java.lang.String workflow, Query query) throws AttivioException
Delete 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:
deleteByQuery
in 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
Sendmessage
to AIE.- Specified by:
bulkUpdate
in interfaceDocumentOutputClient
- Throws:
AttivioException
-
sendMessageInternal
protected void sendMessageInternal(PlatformMessage message) throws AttivioException
Internal method to send amessage
to 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 AttivioException
Starts 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:
startMessageGroup
in interfaceDocumentOutputClient
- Throws:
AttivioException
-
endMessageGroup
public void endMessageGroup() throws AttivioException
Ends 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:
endMessageGroup
in interfaceDocumentOutputClient
- Throws:
AttivioException
-
isMessageGroupInProgress
public boolean isMessageGroupInProgress()
- Specified by:
isMessageGroupInProgress
in interfaceDocumentOutputClient
- Returns:
true
if a message group has been started and not yet ended.
-
commit
public void commit(java.lang.String... zones) throws AttivioException
Sends 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:
commit
in interfaceIndexCommitter
- Specified by:
commit
in 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 AttivioException
Sends 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:
refresh
in interfaceIngestClient
- Throws:
AttivioException
- on failure
-
optimize
public void optimize() throws AttivioException
Sends 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:
optimize
in 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
ByteArrayContentPointer
is used and returned.If
input
produces less thanIngestClient.getContentStoreThresholdKB()
, then aByteArrayContentPointer
will be returned.- Specified by:
put
in 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:
put
in 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:
put
in 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:
put
in 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 AttivioException
Wait 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:
waitForCompletion
in 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 timeout) throws AttivioException
Wait 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
<=0
means to wait forever.- Specified by:
waitForCompletion
in interfaceIngestClient
- Parameters:
timeout
- 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 AttivioException
Wait 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 thechangeClientId
parameter provided to this method istrue
. Otherwise, the ID will remain consistent.- Specified by:
waitForCompletion
in 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 AttivioException
Wait 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 thechangeClientId
parameter provided to this method istrue
. Otherwise, the ID will remain consistent.A timeout of
<=0
means to wait forever.- Specified by:
waitForCompletion
in 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 AttivioException
Send the documents in the queue to the engine- Specified by:
sendQueuedDocuments
in interfaceIngestClient
- Throws:
AttivioException
-
getDocSize
protected long getDocSize(IngestDocument doc)
Estimate the size ofdoc
including content pointers.
-
batchDocument
protected void batchDocument(IngestDocument doc) throws AttivioException
Adddoc
to the current batch, flushing batch if any limit exceeded.- Throws:
AttivioException
-
dispatchDocumentsInQueue
protected void dispatchDocumentsInQueue() throws AttivioException
Perform an internal batching of docs and feeds any queued documents- Throws:
AttivioException
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:
setOrderedCommits
in interfaceIngestClient
- Parameters:
orderedCommits
- set to true to enable this or false to disable it
-
isOrderedCommits
public boolean isOrderedCommits()
- Specified by:
isOrderedCommits
in interfaceIngestClient
- Returns:
- true if "Ordered Commits" is enabled
-
getDocumentBatchSize
public int getDocumentBatchSize()
Gets current documentBatchSize set.- Specified by:
getDocumentBatchSize
in 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:
setDocumentBatchSize
in 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
ContentPointer
s included in the document.- Specified by:
getMaxBatchSizeMB
in 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
ContentPointer
s 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:
setMaxBatchSizeMB
in interfaceIngestClient
-
getContentStoreThresholdKB
public int getContentStoreThresholdKB()
Gets the minimum size required (in kilobytes) for content to be stored in the content store.- Specified by:
getContentStoreThresholdKB
in 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:
setContentStoreThresholdKB
in interfaceIngestClient
- See Also:
IngestClient.put(String, InputStream)
-
getDocumentsQueued
public long getDocumentsQueued()
- Specified by:
getDocumentsQueued
in 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 automaticCommit
will be sent to AIE.- Specified by:
setCommitInterval
in interfaceIngestClient
- Parameters:
commitInterval
- in number of documents
-
getCommitInterval
public int getCommitInterval()
- Specified by:
getCommitInterval
in interfaceIngestClient
- Returns:
- commit interval in number of documents
-
setOptimizeInterval
public void setOptimizeInterval(int optimizeInterval)
Sets the interval on which an automaticOptimize
will be sent to AIE.- Specified by:
setOptimizeInterval
in interfaceIngestClient
- Parameters:
optimizeInterval
- in number of documents
-
getOptimizeInterval
public int getOptimizeInterval()
- Specified by:
getOptimizeInterval
in interfaceIngestClient
- Returns:
- optimize interval in number of documents
-
setIngestWorkflowName
public void setIngestWorkflowName(java.lang.String value)
Set ingest workflow name- Specified by:
setIngestWorkflowName
in interfaceIngestClient
- Parameters:
value
- workflow name
-
getIngestWorkflowName
public java.lang.String getIngestWorkflowName()
- Specified by:
getIngestWorkflowName
in interfaceIngestClient
- Returns:
- ingest workflow name
-
getSizeToDomain
public java.util.Map<java.lang.String,java.lang.String> getSizeToDomain()
- Specified by:
getSizeToDomain
in 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:
setSizeToDomain
in interfaceIngestClient
-
makeInactive
protected void makeInactive() throws AttivioException
- Throws:
AttivioException
-
clientHeartbeat
public void clientHeartbeat() throws AttivioException
Send a client heartbeat to keep the client alive (only if active).- Throws:
AttivioException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
isCompleted
public boolean isCompleted() throws AttivioException
True is all messages sent have been fully processed by AIE.- Specified by:
isCompleted
in 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()
returnsnull
or 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)
-
-