public abstract class AbstractWriteResponseHandler<T> extends java.lang.Object implements IAsyncCallbackWithFailure<T>
Modifier and Type | Field and Description |
---|---|
protected java.lang.Runnable |
callback |
ConsistencyLevel |
consistencyLevel |
protected Keyspace |
keyspace |
protected static org.slf4j.Logger |
logger |
protected java.util.Collection<java.net.InetAddress> |
naturalEndpoints |
protected java.util.Collection<java.net.InetAddress> |
pendingEndpoints |
protected long |
start |
protected WriteType |
writeType |
isAlive
Modifier | Constructor and Description |
---|---|
protected |
AbstractWriteResponseHandler(Keyspace keyspace,
java.util.Collection<java.net.InetAddress> naturalEndpoints,
java.util.Collection<java.net.InetAddress> pendingEndpoints,
ConsistencyLevel consistencyLevel,
java.lang.Runnable callback,
WriteType writeType) |
Modifier and Type | Method and Description |
---|---|
protected abstract int |
ackCount() |
void |
assureSufficientLiveNodes() |
void |
get() |
void |
onFailure(java.net.InetAddress from)
Called when there is an exception on the remote node or timeout happens
|
abstract void |
response(MessageIn<T> msg)
null message means "response from local write"
|
protected void |
signal() |
protected int |
totalBlockFor() |
protected int |
totalEndpoints() |
protected boolean |
waitingFor(java.net.InetAddress from) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isLatencyForSnitch
protected static final org.slf4j.Logger logger
protected final Keyspace keyspace
protected final long start
protected final java.util.Collection<java.net.InetAddress> naturalEndpoints
public final ConsistencyLevel consistencyLevel
protected final java.lang.Runnable callback
protected final java.util.Collection<java.net.InetAddress> pendingEndpoints
protected final WriteType writeType
protected AbstractWriteResponseHandler(Keyspace keyspace, java.util.Collection<java.net.InetAddress> naturalEndpoints, java.util.Collection<java.net.InetAddress> pendingEndpoints, ConsistencyLevel consistencyLevel, java.lang.Runnable callback, WriteType writeType)
callback
- A callback to be called when the write is successful.public void get() throws WriteTimeoutException, WriteFailureException
protected int totalBlockFor()
protected int totalEndpoints()
protected boolean waitingFor(java.net.InetAddress from)
protected abstract int ackCount()
public abstract void response(MessageIn<T> msg)
response
in interface IAsyncCallback<T>
msg
- response received.public void assureSufficientLiveNodes() throws UnavailableException
UnavailableException
protected void signal()
public void onFailure(java.net.InetAddress from)
IAsyncCallbackWithFailure
onFailure
in interface IAsyncCallbackWithFailure<T>
Copyright © 2016 The Apache Software Foundation