|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.astyanax.recipes.uniqueness.RowUniquenessConstraint<K,C>
K
- C
- public class RowUniquenessConstraint<K,C>
Test uniqueness for a single row. This implementation allows for any column type. If the column family uses UTF8Type for the comparator then it is preferable to use ColumnPrefixUniquenessConstraint.
Constructor Summary | |
---|---|
RowUniquenessConstraint(Keyspace keyspace,
ColumnFamily<K,C> columnFamily,
K key,
com.google.common.base.Supplier<C> uniqueColumnSupplier)
|
Method Summary | |
---|---|
void |
acquire()
Acquire the row(s) for uniqueness. |
void |
acquireAndMutate(MutationBatch mutation)
Acquire the uniqueness constraint and apply the final mutation if the row if found to be unique |
ByteBuffer |
readData()
Read the data stored with the unique row. |
String |
readDataAsString()
|
void |
release()
Release the uniqueness lock for this row. |
RowUniquenessConstraint<K,C> |
withConsistencyLevel(ConsistencyLevel consistencyLevel)
|
RowUniquenessConstraint<K,C> |
withData(ByteBuffer data)
Specify the data value to add to the column. |
RowUniquenessConstraint<K,C> |
withData(String data)
|
RowUniquenessConstraint<K,C> |
withTtl(Integer ttl)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RowUniquenessConstraint(Keyspace keyspace, ColumnFamily<K,C> columnFamily, K key, com.google.common.base.Supplier<C> uniqueColumnSupplier)
Method Detail |
---|
public RowUniquenessConstraint<K,C> withTtl(Integer ttl)
public RowUniquenessConstraint<K,C> withConsistencyLevel(ConsistencyLevel consistencyLevel)
public RowUniquenessConstraint<K,C> withData(ByteBuffer data)
data
-
public RowUniquenessConstraint<K,C> withData(String data)
public void acquire() throws NotUniqueException, Exception
UniquenessConstraint
acquire
in interface UniquenessConstraint
NotUniqueException
Exception
public void acquireAndMutate(MutationBatch mutation) throws NotUniqueException, Exception
UniquenessConstraint
acquireAndMutate
in interface UniquenessConstraint
NotUniqueException
Exception
public void release() throws Exception
UniquenessConstraint
release
in interface UniquenessConstraint
Exception
public ByteBuffer readData() throws Exception
Exception
public String readDataAsString() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |