org.apache.whirr.service.cassandra
Class CassandraClusterActionHandler

java.lang.Object
  extended by org.apache.whirr.service.ClusterActionHandlerSupport
      extended by org.apache.whirr.service.cassandra.CassandraClusterActionHandler
All Implemented Interfaces:
ClusterActionHandler

public class CassandraClusterActionHandler
extends ClusterActionHandlerSupport


Field Summary
static String BIN_TARBALL
           
static String CASSANDRA_ROLE
           
static int CLIENT_PORT
           
static int JMX_PORT
           
static String MAJOR_VERSION
           
 
Fields inherited from interface org.apache.whirr.service.ClusterActionHandler
BOOTSTRAP_ACTION, CLEANUP_ACTION, CONFIGURE_ACTION, DESTROY_ACTION, START_ACTION, STOP_ACTION
 
Constructor Summary
CassandraClusterActionHandler()
           
 
Method Summary
protected  void beforeBootstrap(ClusterActionEvent event)
           
protected  void beforeCleanup(ClusterActionEvent event)
           
protected  void beforeConfigure(ClusterActionEvent event)
           
protected  void beforeStart(ClusterActionEvent event)
           
protected  void beforeStop(ClusterActionEvent event)
           
protected  List<String> computeInitialTokens(int numberOfNodes)
          Compute initial_token for a balanced cluster
 String getRole()
           
protected  List<Cluster.Instance> getSeeds(Set<Cluster.Instance> instances)
          Pick a selection of the nodes that are to become seeds.
 
Methods inherited from class org.apache.whirr.service.ClusterActionHandlerSupport
addRunUrl, addStatement, afterAction, afterBootstrap, afterCleanup, afterConfigure, afterDestroy, afterOtherAction, afterStart, afterStop, beforeAction, beforeDestroy, beforeOtherAction, equals, getCleanupFunction, getConfiguration, getConfiguration, getConfigureFunction, getFunctionName, getInstallFunction, getStartFunction, getStopFunction, hashCode, prepareRemoteFileUrl, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CASSANDRA_ROLE

public static final String CASSANDRA_ROLE
See Also:
Constant Field Values

CLIENT_PORT

public static final int CLIENT_PORT
See Also:
Constant Field Values

JMX_PORT

public static final int JMX_PORT
See Also:
Constant Field Values

BIN_TARBALL

public static final String BIN_TARBALL
See Also:
Constant Field Values

MAJOR_VERSION

public static final String MAJOR_VERSION
See Also:
Constant Field Values
Constructor Detail

CassandraClusterActionHandler

public CassandraClusterActionHandler()
Method Detail

getRole

public String getRole()

beforeBootstrap

protected void beforeBootstrap(ClusterActionEvent event)
                        throws IOException
Overrides:
beforeBootstrap in class ClusterActionHandlerSupport
Throws:
IOException

beforeConfigure

protected void beforeConfigure(ClusterActionEvent event)
                        throws IOException,
                               InterruptedException
Overrides:
beforeConfigure in class ClusterActionHandlerSupport
Throws:
IOException
InterruptedException

beforeStart

protected void beforeStart(ClusterActionEvent event)
Overrides:
beforeStart in class ClusterActionHandlerSupport

beforeStop

protected void beforeStop(ClusterActionEvent event)
Overrides:
beforeStop in class ClusterActionHandlerSupport

beforeCleanup

protected void beforeCleanup(ClusterActionEvent event)
Overrides:
beforeCleanup in class ClusterActionHandlerSupport

getSeeds

protected List<Cluster.Instance> getSeeds(Set<Cluster.Instance> instances)
Pick a selection of the nodes that are to become seeds. TODO improve selection method. Right now it picks 20% of the nodes as seeds, or a minimum of one node if it is a small cluster.

Parameters:
instances - all nodes in cluster
Returns:
list of seeds

computeInitialTokens

protected List<String> computeInitialTokens(int numberOfNodes)
Compute initial_token for a balanced cluster



Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.