Class TransactionsCleanupConfig

java.lang.Object
com.couchbase.client.java.transactions.config.TransactionsCleanupConfig

public class TransactionsCleanupConfig extends Object
Provides all configurable parameters for Couchbase transactions cleanup.
  • Constructor Details

    • TransactionsCleanupConfig

      public TransactionsCleanupConfig()
  • Method Details

    • builder

      public static TransactionsCleanupConfig.Builder builder()
    • cleanupClientAttempts

      public static TransactionsCleanupConfig.Builder cleanupClientAttempts(boolean cleanupClientAttempts)
      Controls where a background thread is created to cleanup any transaction attempts made by this client.

      The default is true and users should generally not change this: cleanup is an essential part of Couchbase transactions.

    • cleanupLostAttempts

      public static TransactionsCleanupConfig.Builder cleanupLostAttempts(boolean cleanupLostAttempts)
      Controls where a background process is created to cleanup any 'lost' transaction attempts.

      The default is true and users should generally not change this: cleanup is an essential part of Couchbase transactions.

    • cleanupWindow

      public static TransactionsCleanupConfig.Builder cleanupWindow(Duration cleanupWindow)
      Part of the lost attempts background cleanup process. Specifies the window during which the cleanup process is sure to discover all lost transactions.

      The default setting of 60 seconds is tuned to balance how quickly such transactions are discovered, while minimising impact on the cluster. If the application would prefer to discover lost transactions more swiftly, but at the cost of increased impact, it can feel free to reduce this parameter.

    • addCollection

      public static TransactionsCleanupConfig.Builder addCollection(TransactionKeyspace collection)
      Adds a collection to the set of metadata collections that will be cleaned up automatically.

      This will also start cleanup immediately rather than on the first transaction (unless cleanup has been explicitly disabled.)

    • addCollections

      Adds collections to the set of metadata collections that will be cleaned up automatically.

      Collections will be added automatically to this 'cleanup set' as transactions are performed, so generally an application will not need to change this.

      Setting this parameter will also start cleanup immediately rather than on the first transaction.