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 Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
incomingRequest(java.lang.String transactionId, Request request, long timestamp, long watermark)
Called when new request regarding given transaction is received.static TransactionMonitoringPolicy
nop()
void
outgoingResponse(java.lang.String transactionId, Response response)
Called when a response to transaction client is about to be sent.default boolean
shouldReportRejected(java.lang.String transactionId, State preAbortState)
Called when transaction is about to be aborted.void
stateUpdate(java.lang.String transactionId, State currentState, State newState)
Called when transaction state is about to be updated.
-
-
-
Method Detail
-
nop
static TransactionMonitoringPolicy nop()
-
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 transactionrequest
- request to be processedtimestamp
- timestamp of the requestwatermark
- 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 transactioncurrentState
- the current state of the transactionnewState
- 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 transactionresponse
- the response to be sent
-
shouldReportRejected
default boolean shouldReportRejected(java.lang.String transactionId, State preAbortState)
Called when transaction is about to be aborted. Returningtrue
from this method will cause more details report about the reason why transaction is rejected.- Parameters:
transactionId
- ID of transactionpreAbortState
- state before the transaction was aborted
-
-