Interface CheckAndSetCompatibility
-
- All Known Implementing Classes:
CheckAndSetCompatibility.Supported
,CheckAndSetCompatibility.Unsupported
public interface CheckAndSetCompatibility
Indicates whether aKeyValueService
supports check and set (CAS) and put unless exists (PUE) operations, and if so the granularity with which it can provide feedback.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
CheckAndSetCompatibility.Supported
static class
CheckAndSetCompatibility.Unsupported
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
consistentOnFailure()
If true, on CAS or PUE failure other than aCheckAndSetException
or aKeyAlreadyExistsException
, the values may or may not have been persisted but the state is guaranteed to be consistent: any subsequent reads will be repeatable.static CheckAndSetCompatibility
intersect(java.util.stream.Stream<CheckAndSetCompatibility> compatibilities)
static com.palantir.atlasdb.keyvalue.api.ImmutableSupported.Builder
supportedBuilder()
boolean
supportsCheckAndSetOperations()
If false, thisKeyValueService
does not support check and set operations.boolean
supportsDetailOnFailure()
If false, there are no guarantees that aCheckAndSetException.getActualValues()
orKeyAlreadyExistsException.getExistingKeys()
from exceptions thrown by the theKeyValueService
will actually return any meaningful data (other than the fact that the operation failed).static CheckAndSetCompatibility
unsupported()
-
-
-
Method Detail
-
supportsCheckAndSetOperations
boolean supportsCheckAndSetOperations()
If false, thisKeyValueService
does not support check and set operations.
-
supportsDetailOnFailure
boolean supportsDetailOnFailure()
If false, there are no guarantees that aCheckAndSetException.getActualValues()
orKeyAlreadyExistsException.getExistingKeys()
from exceptions thrown by the theKeyValueService
will actually return any meaningful data (other than the fact that the operation failed). This method should only be called ifsupportsCheckAndSetOperations()
is true. If it is not true, behaviour is undefined.
-
consistentOnFailure
boolean consistentOnFailure()
If true, on CAS or PUE failure other than aCheckAndSetException
or aKeyAlreadyExistsException
, the values may or may not have been persisted but the state is guaranteed to be consistent: any subsequent reads will be repeatable. If false, the value may have been persisted in a way that subsequent reads are not repeatable: if a read before the operation could have returned values from a set S, it can non-deterministically return a value from S U {newValue} afterwards. This method should only be called ifsupportsCheckAndSetOperations()
is true. If it is not true, behaviour is undefined.
-
intersect
static CheckAndSetCompatibility intersect(java.util.stream.Stream<CheckAndSetCompatibility> compatibilities)
-
unsupported
static CheckAndSetCompatibility unsupported()
-
supportedBuilder
static com.palantir.atlasdb.keyvalue.api.ImmutableSupported.Builder supportedBuilder()
-
-