Interface TransactionMonitoringPolicy


  • @ThreadSafe
    public interface TransactionMonitoringPolicy
    Policy that can be specified for monitoring transactions during execution. Implementing classes should take care of performance. This class is required to be thread-safe.
    • Method Detail

      • incomingRequest

        void incomingRequest​(java.lang.String transactionId,
                             Request request,
                             long timestamp,
                             long watermark)
        Called when new request regarding given transaction is received.
        Parameters:
        transactionId - ID of transaction
        request - request to be processed
        timestamp - timestamp of the request
        watermark - watermark of all requests
      • stateUpdate

        void stateUpdate​(java.lang.String transactionId,
                         State currentState,
                         @Nullable
                         State newState)
        Called when transaction state is about to be updated.
        Parameters:
        transactionId - ID of transaction
        currentState - the current state of the transaction
        newState - the state to which the transaction will be transitioned
      • outgoingResponse

        void outgoingResponse​(java.lang.String transactionId,
                              Response response)
        Called when a response to transaction client is about to be sent.
        Parameters:
        transactionId - ID of transaction
        response - the response to be sent
      • shouldReportRejected

        default boolean shouldReportRejected​(java.lang.String transactionId,
                                             State preAbortState)
        Called when transaction is about to be aborted. Returning true from this method will cause more details report about the reason why transaction is rejected.
        Parameters:
        transactionId - ID of transaction
        preAbortState - state before the transaction was aborted