org.apache.cassandra.tools
Class NodeProbe

java.lang.Object
  extended by org.apache.cassandra.tools.NodeProbe

public class NodeProbe
extends java.lang.Object

JMX client operations for Cassandra.


Constructor Summary
NodeProbe(java.lang.String host)
          Creates a NodeProbe using the specified JMX host and default port.
NodeProbe(java.lang.String host, int port)
          Creates a NodeProbe using the specified JMX host and port.
 
Method Summary
 void bootStrapNodes(java.lang.String nodeList)
          Bootstrap the listed nodes with data
 void clearSnapshot()
          Remove all the existing snapshots.
 void forceTableCleanup()
          Trigger a cleanup of keys on all tables.
 void forceTableCompaction()
          Trigger compaction of all tables.
 void forceTableFlush(java.lang.String tableName, java.lang.String... columnFamilies)
          Trigger a flush of the given CFs
 int getCurrentGenerationNumber()
          Return the generation value for this node.
 java.lang.String getLiveNodes()
          Retrieve the list of live nodes in the cluster, where "liveness" is determined by the failure detector of the node being queried.
 java.lang.String getLoadInfo()
          Retrieve a textual representation of the on-disk size of data stored on this node.
 java.util.Map<Range,java.util.List<EndPoint>> getRangeToEndpointMap()
          Retrieve a map of range to end points that describe the ring topology of a Cassandra cluster.
 java.lang.String getToken()
          Fetch a string representation of the token.
 java.lang.String getUnreachableNodes()
          Retrieve the list of unreachable nodes in the cluster, as determined by this node's failure detector.
static void main(java.lang.String[] args)
           
 void printCluster(java.io.PrintStream outs)
          Write a list of nodes with corresponding status.
 void printColumnFamilyStats(java.io.PrintStream outs)
           
 void printInfo(java.io.PrintStream outs)
          Write node information.
 void printRing(java.io.PrintStream outs)
          Write a textual representation of the Cassandra ring.
 void printThreadPoolStats(java.io.PrintStream outs)
          Print out the size of the queues in the thread pools
 void takeSnapshot(java.lang.String snapshotName)
          Take a snapshot of all the tables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeProbe

public NodeProbe(java.lang.String host,
                 int port)
          throws java.io.IOException
Creates a NodeProbe using the specified JMX host and port.

Parameters:
host - hostname or IP address of the JMX agent
port - TCP port of the remote JMX agent
Throws:
java.io.IOException - on connection failures

NodeProbe

public NodeProbe(java.lang.String host)
          throws java.io.IOException
Creates a NodeProbe using the specified JMX host and default port.

Parameters:
host - hostname or IP address of the JMX agent
Throws:
java.io.IOException - on connection failures
Method Detail

getRangeToEndpointMap

public java.util.Map<Range,java.util.List<EndPoint>> getRangeToEndpointMap()
Retrieve a map of range to end points that describe the ring topology of a Cassandra cluster.

Returns:
mapping of ranges to end points

getLiveNodes

public java.lang.String getLiveNodes()
Retrieve the list of live nodes in the cluster, where "liveness" is determined by the failure detector of the node being queried. The returned string is a space delimited list of host:port end points.

Returns:
space delimited list of nodes

getUnreachableNodes

public java.lang.String getUnreachableNodes()
Retrieve the list of unreachable nodes in the cluster, as determined by this node's failure detector. The returned string is a space delimited list of host:port end points.

Returns:
space delimited list of nodes

getToken

public java.lang.String getToken()
Fetch a string representation of the token.

Returns:
a string token

getCurrentGenerationNumber

public int getCurrentGenerationNumber()
Return the generation value for this node.

Returns:
generation number

getLoadInfo

public java.lang.String getLoadInfo()
Retrieve a textual representation of the on-disk size of data stored on this node.

Returns:
the size description

forceTableCleanup

public void forceTableCleanup()
                       throws java.io.IOException
Trigger a cleanup of keys on all tables.

Throws:
java.io.IOException

bootStrapNodes

public void bootStrapNodes(java.lang.String nodeList)
                    throws java.net.UnknownHostException
Bootstrap the listed nodes with data

Parameters:
nodeList - a colon separated list of nodes to bootstrap
Throws:
java.net.UnknownHostException

forceTableCompaction

public void forceTableCompaction()
                          throws java.io.IOException
Trigger compaction of all tables.

Throws:
java.io.IOException

forceTableFlush

public void forceTableFlush(java.lang.String tableName,
                            java.lang.String... columnFamilies)
                     throws java.io.IOException
Trigger a flush of the given CFs

Throws:
java.io.IOException

printRing

public void printRing(java.io.PrintStream outs)
Write a textual representation of the Cassandra ring.

Parameters:
outs - the stream to write to

printColumnFamilyStats

public void printColumnFamilyStats(java.io.PrintStream outs)

printCluster

public void printCluster(java.io.PrintStream outs)
Write a list of nodes with corresponding status.

Parameters:
outs - the stream to write to

printInfo

public void printInfo(java.io.PrintStream outs)
Write node information.

Parameters:
outs - the stream to write to

takeSnapshot

public void takeSnapshot(java.lang.String snapshotName)
                  throws java.io.IOException
Take a snapshot of all the tables.

Parameters:
snapshotName - the name of the snapshot.
Throws:
java.io.IOException

clearSnapshot

public void clearSnapshot()
                   throws java.io.IOException
Remove all the existing snapshots.

Throws:
java.io.IOException

printThreadPoolStats

public void printThreadPoolStats(java.io.PrintStream outs)
Print out the size of the queues in the thread pools

Parameters:
outs - Output stream to generate the output on.

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Parameters:
args -
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation