|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.astyanax.recipes.uniqueness.ColumnPrefixUniquenessConstraint<K>
K
- public class ColumnPrefixUniquenessConstraint<K>
Perform a uniqueness constraint using the locking recipe. The usage here is to take the lock and then re-write the column without a TTL to 'persist' it in cassandra.
Constructor Summary | |
---|---|
ColumnPrefixUniquenessConstraint(Keyspace keyspace,
ColumnFamily<K,String> columnFamily,
K key)
|
Method Summary | |
---|---|
void |
acquire()
Acquire the row(s) for uniqueness. |
void |
acquireAndMutate(MutationBatch m)
Acquire the uniqueness constraint and apply the final mutation if the row if found to be unique |
String |
readUniqueColumn()
|
void |
release()
Release the uniqueness lock for this row. |
ColumnPrefixUniquenessConstraint<K> |
withConsistencyLevel(ConsistencyLevel consistencyLevel)
|
ColumnPrefixUniquenessConstraint<K> |
withPrefix(String prefix)
|
ColumnPrefixUniquenessConstraint<K> |
withTtl(Integer ttl)
|
ColumnPrefixUniquenessConstraint<K> |
withUniqueId(String unique)
Specify the unique value to use for the column name when doing the uniqueness constraint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColumnPrefixUniquenessConstraint(Keyspace keyspace, ColumnFamily<K,String> columnFamily, K key)
Method Detail |
---|
public ColumnPrefixUniquenessConstraint<K> withTtl(Integer ttl)
public ColumnPrefixUniquenessConstraint<K> withConsistencyLevel(ConsistencyLevel consistencyLevel)
public ColumnPrefixUniquenessConstraint<K> withPrefix(String prefix)
public ColumnPrefixUniquenessConstraint<K> withUniqueId(String unique)
unique
-
public String readUniqueColumn() throws Exception
Exception
public void acquire() throws NotUniqueException, Exception
UniquenessConstraint
acquire
in interface UniquenessConstraint
NotUniqueException
Exception
public void acquireAndMutate(MutationBatch m) throws NotUniqueException, Exception
UniquenessConstraint
acquireAndMutate
in interface UniquenessConstraint
NotUniqueException
Exception
public void release() throws Exception
UniquenessConstraint
release
in interface UniquenessConstraint
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |