T - The result type of the operation (if it has a result), such as the
result of get_count or get_column
Oh closures, how I wish you were here...public abstract class Operation<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
ConsistencyLevelPolicy |
consistencyLevelPolicy |
Map<String,String> |
credentials |
protected long |
execTime |
CassandraClientMonitor.Counter |
failCounter
Counts failed attempts
|
FailoverPolicy |
failoverPolicy |
String |
keyspaceName |
OperationType |
operationType |
protected T |
result |
String |
stopWatchTagName
The stopwatch used to measure operation performance
|
| Constructor and Description |
|---|
Operation(OperationType operationType) |
Operation(OperationType operationType,
FailoverPolicy failoverPolicy,
Map<String,String> credentials) |
Operation(OperationType operationType,
FailoverPolicy failoverPolicy,
String keyspaceName,
Map<String,String> credentials) |
Operation(OperationType operationType,
Map<String,String> credentials) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyConnectionParams(String keyspace,
ConsistencyLevelPolicy consistencyLevelPolicy,
FailoverPolicy failoverPolicy,
Map<String,String> credentials) |
abstract T |
execute(org.apache.cassandra.thrift.Cassandra.Client cassandra)
Performs the operation on the given cassandra instance.
|
void |
executeAndSetResult(org.apache.cassandra.thrift.Cassandra.Client cassandra,
CassandraHost cassandraHost) |
CassandraHost |
getCassandraHost() |
HectorException |
getException() |
ExecutionResult<T> |
getExecutionResult() |
T |
getResult() |
boolean |
hasException() |
void |
setException(HectorException e) |
void |
setResult(T executionResult) |
public final CassandraClientMonitor.Counter failCounter
public final String stopWatchTagName
public FailoverPolicy failoverPolicy
public ConsistencyLevelPolicy consistencyLevelPolicy
public String keyspaceName
protected T result
protected long execTime
public final OperationType operationType
public Operation(OperationType operationType)
public Operation(OperationType operationType, Map<String,String> credentials)
public Operation(OperationType operationType, FailoverPolicy failoverPolicy, Map<String,String> credentials)
public Operation(OperationType operationType, FailoverPolicy failoverPolicy, String keyspaceName, Map<String,String> credentials)
public void applyConnectionParams(String keyspace, ConsistencyLevelPolicy consistencyLevelPolicy, FailoverPolicy failoverPolicy, Map<String,String> credentials)
public void setResult(T executionResult)
public T getResult()
public ExecutionResult<T> getExecutionResult()
public abstract T execute(org.apache.cassandra.thrift.Cassandra.Client cassandra) throws Exception
Exceptionpublic void executeAndSetResult(org.apache.cassandra.thrift.Cassandra.Client cassandra,
CassandraHost cassandraHost)
throws Exception
Exceptionpublic void setException(HectorException e)
public boolean hasException()
public HectorException getException()
public CassandraHost getCassandraHost()
Copyright © 2014. All Rights Reserved.