Class TransactionRetryListenerImpl
java.lang.Object
com.google.cloud.spanner.connection.TransactionRetryListenerImpl
- All Implemented Interfaces:
TransactionRetryListener
public abstract class TransactionRetryListenerImpl
extends Object
implements TransactionRetryListener
Default (no-op) implementation for
TransactionRetryListener.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.cloud.spanner.connection.TransactionRetryListener
TransactionRetryListener.RetryResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidretryDmlAsPartitionedDmlFailed(UUID executionId, Statement statement, Throwable exception) This method is called when an atomic DML statement failed to be retried as a Partitioned DML statement.voidretryDmlAsPartitionedDmlFinished(UUID executionId, Statement statement, long lowerBoundUpdateCount) This method is called when an atomic DML statement has been successfully retried as a Partitioned DML statement.voidretryDmlAsPartitionedDmlStarting(UUID executionId, Statement statement, TransactionMutationLimitExceededException exception) This method is called when an atomic DML statement is retried as a Partitioned DML statement.voidretryFinished(com.google.cloud.Timestamp transactionStarted, long transactionId, int retryAttempt, TransactionRetryListener.RetryResult result) This method is called when a retry has finished.voidretryStarting(com.google.cloud.Timestamp transactionStarted, long transactionId, int retryAttempt) This method is called when a retry is about to start.
-
Constructor Details
-
TransactionRetryListenerImpl
public TransactionRetryListenerImpl()
-
-
Method Details
-
retryStarting
public void retryStarting(com.google.cloud.Timestamp transactionStarted, long transactionId, int retryAttempt) Description copied from interface:TransactionRetryListenerThis method is called when a retry is about to start.- Specified by:
retryStartingin interfaceTransactionRetryListener- Parameters:
transactionStarted- The start date/time of the transaction that is retrying.transactionId- An internally assigned ID of the transaction (unique during the lifetime of the JVM) that can be used to identify the transaction for logging purposes.retryAttempt- The number of retry attempts the current transaction has executed, including the current retry attempt.
-
retryFinished
public void retryFinished(com.google.cloud.Timestamp transactionStarted, long transactionId, int retryAttempt, TransactionRetryListener.RetryResult result) Description copied from interface:TransactionRetryListenerThis method is called when a retry has finished.- Specified by:
retryFinishedin interfaceTransactionRetryListener- Parameters:
transactionStarted- The start date/time of the transaction that is retrying.transactionId- An internally assigned ID of the transaction (unique during the lifetime of the JVM) that can be used to identify the transaction for logging purposes.retryAttempt- The number of retry attempts the current transaction has executed, including the current retry attempt.result- The result of the retry indicating whether the retry was successful or not.
-
retryDmlAsPartitionedDmlStarting
public void retryDmlAsPartitionedDmlStarting(UUID executionId, Statement statement, TransactionMutationLimitExceededException exception) Description copied from interface:TransactionRetryListenerThis method is called when an atomic DML statement is retried as a Partitioned DML statement.- Specified by:
retryDmlAsPartitionedDmlStartingin interfaceTransactionRetryListener- Parameters:
executionId- a generated, unique ID for this execution. The same ID is passed in to the methodsTransactionRetryListener.retryDmlAsPartitionedDmlFinished(UUID, Statement, long)andTransactionRetryListener.retryDmlAsPartitionedDmlFailed(UUID, Statement, Throwable)when the execution finishes or fails.statement- the statement that is being retried as Partitioned DMLexception- the mutation-limit-exceeded exception that was returned by Spanner during the initial execution.
-
retryDmlAsPartitionedDmlFinished
public void retryDmlAsPartitionedDmlFinished(UUID executionId, Statement statement, long lowerBoundUpdateCount) Description copied from interface:TransactionRetryListenerThis method is called when an atomic DML statement has been successfully retried as a Partitioned DML statement.- Specified by:
retryDmlAsPartitionedDmlFinishedin interfaceTransactionRetryListener- Parameters:
executionId- the unique ID of this statement executionstatement- the statement that was successfully retried as Partitioned DMLlowerBoundUpdateCount- the lower-bound update count returned by Spanner after executing the statement as Partitioned DML
-
retryDmlAsPartitionedDmlFailed
public void retryDmlAsPartitionedDmlFailed(UUID executionId, Statement statement, Throwable exception) Description copied from interface:TransactionRetryListenerThis method is called when an atomic DML statement failed to be retried as a Partitioned DML statement.- Specified by:
retryDmlAsPartitionedDmlFailedin interfaceTransactionRetryListener- Parameters:
executionId- the unique ID of this statement executionstatement- the statement that failed to be retried as Partitioned DMLexception- the exception that was returned when the statement was executed as Partitioned DML
-