com.netflix.astyanax.thrift
Class AbstractOperationImpl<R>

java.lang.Object
  extended by com.netflix.astyanax.thrift.AbstractOperationImpl<R>
All Implemented Interfaces:
Operation<org.apache.cassandra.thrift.Cassandra.Client,R>
Direct Known Subclasses:
AbstractKeyspaceOperationImpl

public abstract class AbstractOperationImpl<R>
extends Object
implements Operation<org.apache.cassandra.thrift.Cassandra.Client,R>


Constructor Summary
AbstractOperationImpl(CassandraOperationTracer tracer)
           
AbstractOperationImpl(CassandraOperationTracer tracer, Host host)
           
 
Method Summary
 R execute(org.apache.cassandra.thrift.Cassandra.Client client)
          Execute the operation on the client object and return the results
 String getKeyspace()
          Return keyspace for this operation.
 Host getPinnedHost()
          Return the host to run on or null to select a host using the load blancer.
 BigInteger getToken()
          Return the unique key on which the operation is performed or null if the operation is performed on multiple keys.
protected abstract  R internalExecute(org.apache.cassandra.thrift.Cassandra.Client client)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOperationImpl

public AbstractOperationImpl(CassandraOperationTracer tracer,
                             Host host)

AbstractOperationImpl

public AbstractOperationImpl(CassandraOperationTracer tracer)
Method Detail

getToken

public BigInteger getToken()
Description copied from interface: Operation
Return the unique key on which the operation is performed or null if the operation is performed on multiple keys.

Specified by:
getToken in interface Operation<org.apache.cassandra.thrift.Cassandra.Client,R>
Returns:

getKeyspace

public String getKeyspace()
Description copied from interface: Operation
Return keyspace for this operation. Return null if using the current keyspace, or a keyspace is not needed for the operation.

Specified by:
getKeyspace in interface Operation<org.apache.cassandra.thrift.Cassandra.Client,R>
Returns:

execute

public R execute(org.apache.cassandra.thrift.Cassandra.Client client)
          throws ConnectionException
Description copied from interface: Operation
Execute the operation on the client object and return the results

Specified by:
execute in interface Operation<org.apache.cassandra.thrift.Cassandra.Client,R>
Returns:
Throws:
OperationException
ConnectionException

getPinnedHost

public Host getPinnedHost()
Description copied from interface: Operation
Return the host to run on or null to select a host using the load blancer. Failover is disabled for this scenario.

Specified by:
getPinnedHost in interface Operation<org.apache.cassandra.thrift.Cassandra.Client,R>
Returns:

internalExecute

protected abstract R internalExecute(org.apache.cassandra.thrift.Cassandra.Client client)
                              throws Exception
Throws:
Exception


Copyright © 2012. All Rights Reserved.