com.netflix.astyanax.recipes.uniqueness
Class RowUniquenessConstraint<K,C>

java.lang.Object
  extended by com.netflix.astyanax.recipes.uniqueness.RowUniquenessConstraint<K,C>
Type Parameters:
K -
C -
All Implemented Interfaces:
UniquenessConstraint

public class RowUniquenessConstraint<K,C>
extends Object
implements UniquenessConstraint

Test uniqueness for a single row.

Author:
elandau

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 release()
          Release the uniqueness lock for this row.
 RowUniquenessConstraint<K,C> withConsistencyLevel(ConsistencyLevel consistencyLevel)
           
 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

RowUniquenessConstraint

public RowUniquenessConstraint(Keyspace keyspace,
                               ColumnFamily<K,C> columnFamily,
                               K key,
                               com.google.common.base.Supplier<C> uniqueColumnSupplier)
Method Detail

withTtl

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

withConsistencyLevel

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

acquire

public void acquire()
             throws NotUniqueException,
                    Exception
Description copied from interface: UniquenessConstraint
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.

Specified by:
acquire in interface UniquenessConstraint
Throws:
NotUniqueException
Exception

release

public void release()
             throws Exception
Description copied from interface: UniquenessConstraint
Release the uniqueness lock for this row.

Specified by:
release in interface UniquenessConstraint
Throws:
Exception


Copyright © 2012. All Rights Reserved.