Class TransactionsCleanupConfig.Builder
- Enclosing class:
- TransactionsCleanupConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCollection
(TransactionKeyspace collection) Adds a collection to the set of metadata collections that will be cleaned up automatically.addCollections
(Collection<TransactionKeyspace> collections) Adds collections to the set of metadata collections that will be cleaned up automatically.build()
cleanupClientAttempts
(boolean cleanupClientAttempts) Controls where a background thread is created to cleanup any transaction attempts made by this client.cleanupLostAttempts
(boolean cleanupLostAttempts) Controls where a background process is created to cleanup any 'lost' transaction attempts: that is, those for which the regular cleanup process has failed.cleanupWindow
(Duration cleanupWindow) Part of the lost attempts background cleanup process.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
-
cleanupClientAttempts
Controls where a background thread is created to cleanup any transaction attempts made by this client.This should be left at its default of true. Without this, this client's transactions will only be cleaned up by the lost attempts cleanup process, which is by necessity slower.
-
cleanupLostAttempts
Controls where a background process is created to cleanup any 'lost' transaction attempts: that is, those for which the regular cleanup process has failed.This should be left at its default of true. Without at least one client performing this cleanup, 'lost' transactions will not be removed.
-
cleanupWindow
Part of the lost attempts background cleanup process. Specifies the window during which the cleanup process is sure to discover all lost transactions.This process is an implementation detail, but currently consists of polling multiple documents. The default setting of 60 seconds is tuned to reduce impact on the cluster. If the application would prefer to discover lost transactions more swiftly, but at the cost of more frequent polling, it can feel free to reduce this parameter, while monitoring resource usage.
The trade-off to appreciate is that if a document is in a transaction A, it is effectively locked from being updated by another transaction until transaction A has been completed - that is, committed or rolled back. In rare cases such as application crashes, the transaction will remain incomplete - that is, it will be lost - until the lost transactions process discovers it.
-
addCollection
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
public TransactionsCleanupConfig.Builder addCollections(Collection<TransactionKeyspace> collections) Adds collections 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.)
-