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.
  • Constructor Details

    • TransactionRetryListenerImpl

      public TransactionRetryListenerImpl()
  • Method Details

    • retryStarting

      public void retryStarting(com.google.cloud.Timestamp transactionStarted, long transactionId, int retryAttempt)
      Description copied from interface: TransactionRetryListener
      This method is called when a retry is about to start.
      Specified by:
      retryStarting in interface TransactionRetryListener
      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: TransactionRetryListener
      This method is called when a retry has finished.
      Specified by:
      retryFinished in interface TransactionRetryListener
      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: TransactionRetryListener
      This method is called when an atomic DML statement is retried as a Partitioned DML statement.
      Specified by:
      retryDmlAsPartitionedDmlStarting in interface TransactionRetryListener
      Parameters:
      executionId - a generated, unique ID for this execution. The same ID is passed in to the methods TransactionRetryListener.retryDmlAsPartitionedDmlFinished(UUID, Statement, long) and TransactionRetryListener.retryDmlAsPartitionedDmlFailed(UUID, Statement, Throwable) when the execution finishes or fails.
      statement - the statement that is being retried as Partitioned DML
      exception - 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: TransactionRetryListener
      This method is called when an atomic DML statement has been successfully retried as a Partitioned DML statement.
      Specified by:
      retryDmlAsPartitionedDmlFinished in interface TransactionRetryListener
      Parameters:
      executionId - the unique ID of this statement execution
      statement - the statement that was successfully retried as Partitioned DML
      lowerBoundUpdateCount - 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: TransactionRetryListener
      This method is called when an atomic DML statement failed to be retried as a Partitioned DML statement.
      Specified by:
      retryDmlAsPartitionedDmlFailed in interface TransactionRetryListener
      Parameters:
      executionId - the unique ID of this statement execution
      statement - the statement that failed to be retried as Partitioned DML
      exception - the exception that was returned when the statement was executed as Partitioned DML