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 an IllegalStateException.

    Durability

    The implementation may choose to delay recording of any history or status information until the call of connectorCompleted(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 the AuditReaderApi using the clientId obtained from ConnectorExecutionRecord. 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 the CONNECTOR_HISTORY_RECORD_EMPTY_EXECUTIONS property to true.
    • 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 connector
        workflow -
        extraRunInfo - additional metadata to associate with the new execution
        external - 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. The timestamp 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
        A node has paused the connector. Indicates a transition from RUNNING to PAUSED
        Parameters:
        connectorName -
        Throws:
        AttivioException
      • connectorResumed

        void connectorResumed​(java.lang.String connectorName)
                       throws AttivioException
        A node has resumed a paused connector. Indicates a transition from PAUSED to RUNNING
        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
      • 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 of ConnectorExecutionStatus.RESET.
        Parameters:
        connectorName -
        Throws:
        AttivioException
      • updateSentCount

        void updateSentCount​(java.lang.String connectorName,
                             long docCount)
                      throws AttivioException
        Updates the number of documents sent by connectorName.
        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 for connectorName. The existing run information is replaced with extraRunInfo.
        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
      • 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 connector connectorName or null if the connector is not currently executing.
      • delayBeforeCheckingAbandonment

        static long delayBeforeCheckingAbandonment()
        Returns:
        the amount of time prior to checking a connector for a crash