Package com.attivio.sdk.client
Interface ConnectorHistoryApi
-
- All Known Implementing Classes:
MockConnectorHistory
public interface ConnectorHistoryApi
The ConnectorHistoryApi records the current status and history of connector executions on the AIE platform. No API methods trigger any connector activity, these methods are meant only to record what has occurred thru other means. Implementations do not validate state transitions; this API assumes the caller knows best.When
connectorQueued(String, UUID, String, List, boolean)
is called a new history record for the connector is created. Subsequent calls that affect the currently executing connector will update this history record. Attempts to update a history record in the NOT_RUNNING state will fail with anIllegalStateException
.Durability
The implementation may choose to delay recording of any history or status information until the call ofconnectorCompleted(String, long)
. This allows for implementations which cache updates to the current execution without requiring immediate writes which are undesirable.Other Status Information
Other status information such as the number of outstanding documents and number of OKs and WARNings encountered may be obtained directly from theAuditReaderApi
using the clientId obtained fromConnectorExecutionRecord
. Audit information for the clientId could have been purged depending on system configuration.Incremental Connectors
By default, incremental connector executions which result in no new documents will not have an associated history record. This allows incremental scanners to be scheduled as often as desired without overwhelming the historical record. This default behavior can be changed by setting theCONNECTOR_HISTORY_RECORD_EMPTY_EXECUTIONS
property totrue
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONNECTOR_ABANDONMENT_DELAY
static java.lang.String
CONNECTOR_HISTORY_RECORD_EMPTY_EXECUTIONS
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearHistory(java.lang.String connectorName)
Removes all history associated with the connector.void
connectorCompleted(java.lang.String connectorName, long finalDocCount)
The connector has completed -- all documents have been fully processed.void
connectorCompleting(java.lang.String connectorName)
The connector is completing -- all documents have been sent but have not finished being processed.void
connectorPaused(java.lang.String connectorName)
A node has paused the connector.void
connectorQueued(java.lang.String connectorName, java.util.UUID clientId, java.lang.String workflow, java.util.List<java.lang.String> extraRunInfo, boolean external)
The connector has been submitted for execution on an AIE node.void
connectorReset(java.lang.String connectorName)
Indicates that the incremental state of the connector has been reset.void
connectorResumed(java.lang.String connectorName)
A node has resumed a paused connector.void
connectorStarted(java.lang.String connectorName, long timestamp)
A node has started executing the connector.static long
delayBeforeCheckingAbandonment()
ConnectorExecutionRecord
getCurrentExecutionRecord(java.lang.String connectorName)
Note, the connector does not have to be defined.java.lang.Iterable<ConnectorExecutionRecord>
getHistory(java.lang.String connectorName)
ConnectorExecutionRecord
getLatestHistory(java.lang.String connectorName)
void
setClientId(java.lang.String connectorName, java.util.UUID clientId)
Associates the provided client id with the current run of the connector.void
updateExtraRunInfo(java.lang.String connectorName, java.util.List<java.lang.String> extraRunInfo)
Updates the extraRunInfo forconnectorName
.void
updateSentCount(java.lang.String connectorName, long docCount)
Updates the number of documents sent byconnectorName
.
-
-
-
Field Detail
-
CONNECTOR_HISTORY_RECORD_EMPTY_EXECUTIONS
static final java.lang.String CONNECTOR_HISTORY_RECORD_EMPTY_EXECUTIONS
- See Also:
- Constant Field Values
-
CONNECTOR_ABANDONMENT_DELAY
static final java.lang.String CONNECTOR_ABANDONMENT_DELAY
- Since:
- 5.5.0.1
- See Also:
- Constant Field Values
-
-
Method Detail
-
connectorQueued
void connectorQueued(java.lang.String connectorName, java.util.UUID clientId, java.lang.String workflow, java.util.List<java.lang.String> extraRunInfo, boolean external) throws AttivioException
The connector has been submitted for execution on an AIE node. Indicates a transition from NOT_RUNNING to WAITING_TO_START.- Parameters:
connectorName
-clientId
- the clientId to associate with this iteration of the connectorworkflow
-extraRunInfo
- additional metadata to associate with the new executionexternal
-true
if the connector is an external connector- Throws:
AttivioException
- with if connector is already executing
-
connectorStarted
void connectorStarted(java.lang.String connectorName, long timestamp) throws AttivioException
A node has started executing the connector. Indicates a transition from WAITING_TO_START to RUNNING. Thetimestamp
parameter is used to associate a connector execution and subsequent incremental executions with each other. It will generally be the start time of the baseline connector execution.- Parameters:
connectorName
-timestamp
- the timestamp associated with this connector execution.- Throws:
AttivioException
-
setClientId
void setClientId(java.lang.String connectorName, java.util.UUID clientId) throws AttivioException
Associates the provided client id with the current run of the connector.- Parameters:
connectorName
-clientId
- the clientId to associate with this connector execution- Throws:
AttivioException
-
connectorPaused
void connectorPaused(java.lang.String connectorName) throws AttivioException
- Parameters:
connectorName
-- Throws:
AttivioException
-
connectorResumed
void connectorResumed(java.lang.String connectorName) throws AttivioException
- Parameters:
connectorName
-- Throws:
AttivioException
-
connectorCompleting
void connectorCompleting(java.lang.String connectorName) throws AttivioException
The connector is completing -- all documents have been sent but have not finished being processed. Indicates a transition from RUNNING to COMPLETING.- Parameters:
connectorName
-- Throws:
AttivioException
-
connectorCompleted
void connectorCompleted(java.lang.String connectorName, long finalDocCount) throws AttivioException
The connector has completed -- all documents have been fully processed. Indicates a transition from COMPLETING to NOT_RUNNING. The current time becomes the time returned byConnectorExecutionRecord.getFinishTime()
for the history record.- Parameters:
connectorName
-finalDocCount
-- Throws:
AttivioException
-
connectorReset
void connectorReset(java.lang.String connectorName) throws AttivioException
Indicates that the incremental state of the connector has been reset. Invalid to call while a connector is currently executing. After this call, the latest history for the connector will have a status ofConnectorExecutionStatus.RESET
.- Parameters:
connectorName
-- Throws:
AttivioException
-
updateSentCount
void updateSentCount(java.lang.String connectorName, long docCount) throws AttivioException
Updates the number of documents sent byconnectorName
.- Parameters:
connectorName
-docCount
-- Throws:
AttivioException
java.lang.RuntimeException
- if connector is not currently running.
-
updateExtraRunInfo
void updateExtraRunInfo(java.lang.String connectorName, java.util.List<java.lang.String> extraRunInfo) throws AttivioException
Updates the extraRunInfo forconnectorName
. The existing run information is replaced withextraRunInfo
.- Parameters:
connectorName
-extraRunInfo
-- Throws:
java.lang.RuntimeException
- if connector is not currently running.AttivioException
- Since:
- 5.5.0.2
-
clearHistory
void clearHistory(java.lang.String connectorName) throws AttivioException
Removes all history associated with the connector. If the connector is currently running the current history is not removed.- Parameters:
connectorName
-- Throws:
AttivioException
-
getLatestHistory
ConnectorExecutionRecord getLatestHistory(java.lang.String connectorName) throws AttivioException
- Parameters:
connectorName
-- Returns:
- the
ConnectorExecutionRecord
with the latest finish time ornull
if the connector has never completed an execution. - Throws:
AttivioException
-
getHistory
java.lang.Iterable<ConnectorExecutionRecord> getHistory(java.lang.String connectorName) throws AttivioException
- Parameters:
connectorName
-- Returns:
- all the history records for this connector.
- Throws:
AttivioException
-
getCurrentExecutionRecord
ConnectorExecutionRecord getCurrentExecutionRecord(java.lang.String connectorName)
Note, the connector does not have to be defined.- Parameters:
connectorName
-- Returns:
- the
ConnectorExecutionRecord
of the currently executing connectorconnectorName
ornull
if the connector is not currently executing.
-
delayBeforeCheckingAbandonment
static long delayBeforeCheckingAbandonment()
- Returns:
- the amount of time prior to checking a connector for a crash
-
-