public class

RowUniquenessConstraint

extends Object
implements UniquenessConstraint
java.lang.Object
   ↳ com.netflix.astyanax.recipes.uniqueness.RowUniquenessConstraint<K, C>

Class Overview

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.

Summary

Public Constructors
RowUniquenessConstraint(Keyspace keyspace, ColumnFamily<K, C> columnFamily, K key, uniqueColumnSupplier)
Public Methods
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)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.netflix.astyanax.recipes.uniqueness.UniquenessConstraint

Public Constructors

public RowUniquenessConstraint (Keyspace keyspace, ColumnFamily<K, C> columnFamily, K key, uniqueColumnSupplier)

Public Methods

public void acquire ()

Acquire the row(s) for uniqueness. Call release() when the uniqueness on the row(s) is no longer needed, such as when deleting the rows.

public void acquireAndMutate (MutationBatch mutation)

Acquire the uniqueness constraint and apply the final mutation if the row if found to be unique

public ByteBuffer readData ()

Read the data stored with the unique row. This data is normally a 'foreign' key to another column family.@return

Throws
Exception

public String readDataAsString ()

Throws
Exception

public void release ()

Release the uniqueness lock for this row. Only call this when you no longer need the uniqueness lock

Throws
Exception

public RowUniquenessConstraint<K, C> withConsistencyLevel (ConsistencyLevel consistencyLevel)

public RowUniquenessConstraint<K, C> withData (ByteBuffer data)

Specify the data value to add to the column.

public RowUniquenessConstraint<K, C> withData (String data)

public RowUniquenessConstraint<K, C> withTtl (Integer ttl)