Package uk.sky.cqlmigrate
Class CassandraLockConfig.CassandraLockConfigBuilder
- java.lang.Object
-
- uk.sky.cqlmigrate.LockConfig.LockConfigBuilder
-
- uk.sky.cqlmigrate.CassandraLockConfig.CassandraLockConfigBuilder
-
- Enclosing class:
- CassandraLockConfig
public static class CassandraLockConfig.CassandraLockConfigBuilder extends LockConfig.LockConfigBuilder
-
-
Field Summary
-
Fields inherited from class uk.sky.cqlmigrate.LockConfig.LockConfigBuilder
clientId, pollingInterval, timeout, unlockOnFailure
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CassandraLockConfigbuild()CassandraLockConfig.CassandraLockConfigBuilderunlockOnFailure()Release the lock in case of failure.CassandraLockConfig.CassandraLockConfigBuilderwithConsistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)CassandraLockConfig.CassandraLockConfigBuilderwithLockKeyspace(java.lang.String lockKeyspace)CassandraLockConfig.CassandraLockConfigBuilderwithPollingInterval(java.time.Duration pollingInterval)Duration to wait after each attempt to acquire the lock.CassandraLockConfig.CassandraLockConfigBuilderwithTimeout(java.time.Duration timeout)Duration to attempt to acquire lock for.
-
-
-
Method Detail
-
withPollingInterval
public CassandraLockConfig.CassandraLockConfigBuilder withPollingInterval(java.time.Duration pollingInterval)
Description copied from class:LockConfig.LockConfigBuilderDuration to wait after each attempt to acquire the lock.- Overrides:
withPollingIntervalin classLockConfig.LockConfigBuilder- Parameters:
pollingInterval- defaults to 500 milliseconds.- Returns:
- this
-
withTimeout
public CassandraLockConfig.CassandraLockConfigBuilder withTimeout(java.time.Duration timeout)
Description copied from class:LockConfig.LockConfigBuilderDuration to attempt to acquire lock for.- Overrides:
withTimeoutin classLockConfig.LockConfigBuilder- Parameters:
timeout- defaults to 1 minute- Returns:
- this
-
unlockOnFailure
public CassandraLockConfig.CassandraLockConfigBuilder unlockOnFailure()
Description copied from class:LockConfig.LockConfigBuilderRelease the lock in case of failure. Note: default behavior is to leave the lock behind if any failures occurred during migration. This was done to prevent accidental data corruption and bring manual attention to the problem. Use 'unlockOnFailure' to override the default behavior and force cqlmigrate to release the lock.- Overrides:
unlockOnFailurein classLockConfig.LockConfigBuilder- Returns:
- this
-
withConsistencyLevel
public CassandraLockConfig.CassandraLockConfigBuilder withConsistencyLevel(com.datastax.driver.core.ConsistencyLevel consistencyLevel)
-
withLockKeyspace
public CassandraLockConfig.CassandraLockConfigBuilder withLockKeyspace(java.lang.String lockKeyspace)
-
build
public CassandraLockConfig build()
- Overrides:
buildin classLockConfig.LockConfigBuilder
-
-