me.prettyprint.cassandra.connection
Class HostTimeoutTracker

java.lang.Object
  extended by me.prettyprint.cassandra.connection.BackgroundCassandraHostService
      extended by me.prettyprint.cassandra.connection.HostTimeoutTracker

public class HostTimeoutTracker
extends BackgroundCassandraHostService

Keep track of how often a node replies with a HTimeoutException. If we go past the threshold of [timeoutCounter] timeouts within [timeWindow] milliseconds, then we mark the node as suspended. (10 timeouts within 500ms by default) Periodically check the suspended nodes list every retryDelayInSeconds. If the node has been suspended longer than nodeSuspensionDurationInSeconds, then we unsuspend, placing it back in the available pool. (10 second suspension retried every 10 seconds by default).

Author:
zznate

Field Summary
static int DEF_NODE_SUSPENSION_DURATION_IN_SECONDS
           
static int DEF_NODE_UNSUSPEND_CHECK_DELAY_IN_SECONDS
           
static int DEF_TIMEOUT_COUNTER
           
static int DEF_TIMEOUT_WINDOW
           
 
Fields inherited from class me.prettyprint.cassandra.connection.BackgroundCassandraHostService
cassandraHostConfigurator, connectionManager, executor, retryDelayInSeconds, sf
 
Constructor Summary
HostTimeoutTracker(HConnectionManager connectionManager, CassandraHostConfigurator cassandraHostConfigurator)
           
 
Method Summary
 boolean checkTimeout(CassandraHost cassandraHost)
           
 
Methods inherited from class me.prettyprint.cassandra.connection.BackgroundCassandraHostService
getRetryDelayInSeconds, setRetryDelayInSeconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_TIMEOUT_COUNTER

public static final int DEF_TIMEOUT_COUNTER
See Also:
Constant Field Values

DEF_TIMEOUT_WINDOW

public static final int DEF_TIMEOUT_WINDOW
See Also:
Constant Field Values

DEF_NODE_SUSPENSION_DURATION_IN_SECONDS

public static final int DEF_NODE_SUSPENSION_DURATION_IN_SECONDS
See Also:
Constant Field Values

DEF_NODE_UNSUSPEND_CHECK_DELAY_IN_SECONDS

public static final int DEF_NODE_UNSUSPEND_CHECK_DELAY_IN_SECONDS
See Also:
Constant Field Values
Constructor Detail

HostTimeoutTracker

public HostTimeoutTracker(HConnectionManager connectionManager,
                          CassandraHostConfigurator cassandraHostConfigurator)
Method Detail

checkTimeout

public boolean checkTimeout(CassandraHost cassandraHost)


Copyright © 2011. All Rights Reserved.