K - C - public class RowUniquenessConstraint<K,C> extends java.lang.Object implements UniquenessConstraint
| Constructor and Description |
|---|
RowUniquenessConstraint(com.netflix.astyanax.Keyspace keyspace,
com.netflix.astyanax.model.ColumnFamily<K,C> columnFamily,
K key,
com.google.common.base.Supplier<C> uniqueColumnSupplier) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquire()
Acquire the row(s) for uniqueness.
|
void |
acquireAndApplyMutation(com.google.common.base.Function<com.netflix.astyanax.MutationBatch,java.lang.Boolean> callback)
Acquire the uniqueness constraint and call the mutate callback to fill a mutation.
|
void |
acquireAndMutate(com.netflix.astyanax.MutationBatch mutation)
Deprecated.
Use acquireAndExecuteMutation instead to avoid timestamp issues
|
java.nio.ByteBuffer |
readData()
Read the data stored with the unique row.
|
java.lang.String |
readDataAsString() |
void |
release()
Release the uniqueness lock for this row.
|
RowUniquenessConstraint<K,C> |
withConsistencyLevel(com.netflix.astyanax.model.ConsistencyLevel consistencyLevel) |
RowUniquenessConstraint<K,C> |
withData(java.nio.ByteBuffer data)
Specify the data value to add to the column.
|
RowUniquenessConstraint<K,C> |
withData(java.lang.String data) |
RowUniquenessConstraint<K,C> |
withTtl(java.lang.Integer ttl) |
public RowUniquenessConstraint<K,C> withTtl(java.lang.Integer ttl)
public RowUniquenessConstraint<K,C> withConsistencyLevel(com.netflix.astyanax.model.ConsistencyLevel consistencyLevel)
public RowUniquenessConstraint<K,C> withData(java.nio.ByteBuffer data)
data - public RowUniquenessConstraint<K,C> withData(java.lang.String data)
public void acquire()
throws NotUniqueException,
java.lang.Exception
UniquenessConstraintacquire in interface UniquenessConstraintNotUniqueExceptionjava.lang.Exception@Deprecated
public void acquireAndMutate(com.netflix.astyanax.MutationBatch mutation)
throws NotUniqueException,
java.lang.Exception
UniquenessConstraintacquireAndMutate in interface UniquenessConstraintNotUniqueExceptionjava.lang.Exceptionpublic void acquireAndApplyMutation(com.google.common.base.Function<com.netflix.astyanax.MutationBatch,java.lang.Boolean> callback)
throws NotUniqueException,
java.lang.Exception
UniquenessConstraintacquireAndApplyMutation in interface UniquenessConstraintNotUniqueExceptionjava.lang.Exceptionpublic void release()
throws java.lang.Exception
UniquenessConstraintrelease in interface UniquenessConstraintjava.lang.Exceptionpublic java.nio.ByteBuffer readData()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String readDataAsString()
throws java.lang.Exception
java.lang.Exception