public class StorageService extends javax.management.NotificationBroadcasterSupport implements IEndpointStateChangeSubscriber, StorageServiceMBean
| Modifier and Type | Field and Description |
|---|---|
static StorageService |
instance |
static DebuggableScheduledThreadPoolExecutor |
optionalTasks
tasks that do not need to be waited for on shutdown/drain
|
static int |
RING_DELAY |
static DebuggableScheduledThreadPoolExecutor |
scheduledTasks
This pool is used for periodic short (sub-second) tasks.
|
static DebuggableScheduledThreadPoolExecutor |
tasks
This pool is used by tasks that can have longer execution times, and usually are non periodic.
|
VersionedValue.VersionedValueFactory |
valueFactory |
| Constructor and Description |
|---|
StorageService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addExpireTimeIfFound(java.net.InetAddress endpoint,
long expireTime) |
void |
beforeChange(java.net.InetAddress endpoint,
EndpointState currentState,
ApplicationState newStateKey,
VersionedValue newValue) |
void |
bulkLoad(java.lang.String directory)
Starts a bulk load and blocks until it completes.
|
java.lang.String |
bulkLoadAsync(java.lang.String directory)
Starts a bulk load asynchronously and returns the String representation of the planID for the new
streaming session.
|
Pair<java.util.Set<Range<Token>>,java.util.Set<Range<Token>>> |
calculateStreamAndFetchRanges(java.util.Collection<Range<Token>> current,
java.util.Collection<Range<Token>> updated)
Calculate pair of ranges to stream/fetch for given two range collections
(current ranges for keyspace and ranges after move to new token)
|
void |
checkForEndpointCollision() |
void |
clearSnapshot(java.lang.String tag,
java.lang.String... keyspaceNames)
Remove the snapshot with the given name from the given keyspaces.
|
void |
confirmReplication(java.net.InetAddress node) |
void |
decommission()
transfer this node's data to other machines and remove it from service.
|
void |
deliverHints(java.lang.String host) |
java.util.List<TokenRange> |
describeLocalRing(java.lang.String keyspace)
The same as
describeRing(String) but considers only the part of the ring formed by nodes in the local DC. |
java.util.List<TokenRange> |
describeRing(java.lang.String keyspace)
The TokenRange for a given keyspace.
|
java.util.List<java.lang.String> |
describeRingJMX(java.lang.String keyspace)
The same as
describeRing(String) but converts TokenRange to the String for JMX compatibility |
void |
disableAutoCompaction(java.lang.String ks,
java.lang.String... columnFamilies) |
void |
drain()
Shuts node off to writes, empties memtables and the commit log.
|
java.util.LinkedHashMap<java.net.InetAddress,java.lang.Float> |
effectiveOwnership(java.lang.String keyspace)
Calculates ownership.
|
void |
enableAutoCompaction(java.lang.String ks,
java.lang.String... columnFamilies) |
protected long |
extractExpireTime(java.lang.String[] pieces) |
void |
finishBootstrapping() |
void |
forceKeyspaceCleanup(java.lang.String keyspaceName,
java.lang.String... columnFamilies)
Trigger a cleanup of keys on a single keyspace
|
void |
forceKeyspaceCompaction(java.lang.String keyspaceName,
java.lang.String... columnFamilies)
Forces major compaction of a single keyspace
|
void |
forceKeyspaceFlush(java.lang.String keyspaceName,
java.lang.String... columnFamilies)
Flush all memtables for a keyspace and column families.
|
RepairFuture |
forceKeyspaceRepair(Range<Token> range,
java.lang.String keyspaceName,
boolean isSequential,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
java.lang.String... columnFamilies) |
RepairFuture |
forceKeyspaceRepair(Range<Token> range,
java.lang.String keyspaceName,
RepairParallelism parallelismDegree,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
java.lang.String... columnFamilies) |
void |
forceKeyspaceRepair(java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
java.lang.String... columnFamilies)
Trigger proactive repair for a keyspace and column families.
|
void |
forceKeyspaceRepairPrimaryRange(java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
java.lang.String... columnFamilies)
Triggers proactive repair but only for the node primary range.
|
void |
forceKeyspaceRepairRange(java.lang.String keyspaceName,
java.util.Collection<Range<Token>> ranges,
RepairParallelism parallelismDegree,
boolean isLocal,
java.lang.String... columnFamilies) |
void |
forceKeyspaceRepairRange(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
java.lang.String... columnFamilies)
Perform repair of a specific range.
|
void |
forceRemoveCompletion()
Force a remove operation to complete.
|
int |
forceRepairAsync(java.lang.String keyspace,
boolean isSequential,
boolean isLocal,
boolean primaryRange,
java.lang.String... columnFamilies)
Invoke repair asynchronously.
|
int |
forceRepairAsync(java.lang.String keyspace,
boolean isSequential,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
boolean primaryRange,
java.lang.String... columnFamilies)
Invoke repair asynchronously.
|
int |
forceRepairAsync(java.lang.String keyspace,
int parallelismDegree,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
boolean primaryRange,
java.lang.String... columnFamilies)
Invoke repair asynchronously.
|
int |
forceRepairAsync(java.lang.String keyspace,
RepairParallelism parallelismDegree,
boolean isLocal,
java.util.Collection<Range<Token>> ranges,
java.lang.String... columnFamilies) |
int |
forceRepairAsync(java.lang.String keyspace,
RepairParallelism parallelismDegree,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
java.util.Collection<Range<Token>> ranges,
java.lang.String... columnFamilies) |
int |
forceRepairRangeAsync(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
java.lang.String... columnFamilies)
Same as forceRepairAsync, but handles a specified range
|
int |
forceRepairRangeAsync(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
boolean isSequential,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
java.lang.String... columnFamilies)
Same as forceRepairAsync, but handles a specified range
|
int |
forceRepairRangeAsync(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
int parallelismDegree,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
java.lang.String... columnFamilies)
Same as forceRepairAsync, but handles a specified range
|
void |
forceTerminateAllRepairSessions() |
java.lang.String[] |
getAllDataFileLocations()
Get the list of all data file locations from conf
|
java.util.List<Range<Token>> |
getAllRanges(java.util.List<Token> sortedTokens)
Get all ranges that span the ring given a set
of tokens.
|
java.lang.String |
getClusterName()
Returns the name of the cluster
|
java.lang.String |
getCommitLogLocation()
Get location of the commit log
|
int |
getCompactionThroughputMbPerSec() |
int |
getCurrentGenerationNumber()
Return the generation value for this node.
|
java.lang.String |
getDrainProgress()
get the progress of a drain operation
|
int |
getExceptionCount() |
java.util.Map<java.lang.String,java.lang.String> |
getHostIdMap()
Retrieve the mapping of endpoint to host ID
|
java.util.List<java.lang.String> |
getJoiningNodes()
Retrieve the list of nodes currently bootstrapping into the ring.
|
java.util.List<java.lang.String> |
getKeyspaces() |
java.util.List<java.lang.String> |
getLeavingNodes()
Retrieve the list of nodes currently leaving the ring.
|
java.util.List<java.net.InetAddress> |
getLiveNaturalEndpoints(Keyspace keyspace,
java.nio.ByteBuffer key)
This method attempts to return N endpoints that are responsible for storing the
specified key i.e for replication.
|
java.util.List<java.net.InetAddress> |
getLiveNaturalEndpoints(Keyspace keyspace,
RingPosition pos) |
java.util.List<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.
|
double |
getLoad()
raw load value
|
java.util.Map<java.lang.String,java.lang.String> |
getLoadMap()
Human-readable load value.
|
java.lang.String |
getLoadString()
Human-readable load value
|
java.lang.String |
getLocalHostId()
Retrieve this hosts unique ID
|
java.util.Collection<Range<Token>> |
getLocalPrimaryRanges(java.lang.String keyspace) |
java.util.Collection<Range<Token>> |
getLocalRanges(java.lang.String keyspaceName) |
java.util.Collection<Token> |
getLocalTokens() |
java.util.Map<java.lang.String,java.lang.String> |
getLoggingLevels() |
java.util.List<java.lang.String> |
getMovingNodes()
Retrieve the list of nodes currently moving in the ring.
|
java.util.List<java.net.InetAddress> |
getNaturalEndpoints(java.lang.String keyspaceName,
java.nio.ByteBuffer key) |
java.util.List<java.net.InetAddress> |
getNaturalEndpoints(java.lang.String keyspaceName,
RingPosition pos)
This method returns the N endpoints that are responsible for storing the
specified key i.e for replication.
|
java.util.List<java.net.InetAddress> |
getNaturalEndpoints(java.lang.String keyspaceName,
java.lang.String cf,
java.lang.String key)
This method returns the N endpoints that are responsible for storing the
specified key i.e for replication.
|
java.lang.String |
getOperationMode()
get the operational mode (leaving, joining, normal, decommissioned, client)
|
java.util.Map<java.net.InetAddress,java.lang.Float> |
getOwnership()
given a list of tokens (representing the nodes in the cluster), returns
a mapping from "token -> %age of cluster owned by that token"
|
static IPartitioner |
getPartitioner() |
java.lang.String |
getPartitionerName()
Returns the cluster partitioner
|
java.util.Map<java.util.List<java.lang.String>,java.util.List<java.lang.String>> |
getPendingRangeToEndpointMap(java.lang.String keyspace)
Retrieve a map of pending ranges to endpoints that describe the ring topology
|
Range<Token> |
getPrimaryRangeForEndpoint(java.net.InetAddress ep)
Deprecated.
|
java.util.Collection<Range<Token>> |
getPrimaryRangesForEndpoint(java.lang.String keyspace,
java.net.InetAddress ep)
Get the "primary ranges" for the specified keyspace and endpoint.
|
java.util.Map<Range<Token>,java.util.List<java.net.InetAddress>> |
getRangeToAddressMap(java.lang.String keyspace) |
java.util.Map<Range<Token>,java.util.List<java.net.InetAddress>> |
getRangeToAddressMapInLocalDC(java.lang.String keyspace) |
java.util.Map<java.util.List<java.lang.String>,java.util.List<java.lang.String>> |
getRangeToEndpointMap(java.lang.String keyspace)
for a keyspace, return the ranges and corresponding listen addresses.
|
java.util.Map<java.util.List<java.lang.String>,java.util.List<java.lang.String>> |
getRangeToRpcaddressMap(java.lang.String keyspace)
for a keyspace, return the ranges and corresponding RPC addresses for a given keyspace.
|
java.lang.String |
getReleaseVersion()
Fetch a string representation of the Cassandra version.
|
java.lang.String |
getRemovalStatus()
Get the status of a token removal.
|
java.lang.String |
getRpcaddress(java.net.InetAddress endpoint)
Return the rpc address associated with an endpoint as a string.
|
java.lang.String |
getSavedCachesLocation()
Get location of the saved caches dir
|
java.lang.String |
getSchemaVersion()
Fetch a string representation of the current Schema version.
|
double |
getSeverity(java.net.InetAddress endpoint) |
java.util.List<Pair<Range<Token>,java.lang.Long>> |
getSplits(java.lang.String keyspaceName,
java.lang.String cfName,
Range<Token> range,
int keysPerSplit,
CFMetaData metadata) |
int |
getStreamThroughputMbPerSec() |
TokenMetadata |
getTokenMetadata() |
java.util.List<java.lang.String> |
getTokens()
Fetch string representations of the tokens for this node.
|
java.util.List<java.lang.String> |
getTokens(java.lang.String endpoint)
Fetch string representations of the tokens for a specified node.
|
java.util.Map<java.lang.String,java.lang.String> |
getTokenToEndpointMap()
Retrieve a map of tokens to endpoints, including the bootstrapping
ones.
|
int |
getTombstoneFailureThreshold()
Returns the threshold for abandoning queries with many tombstones
|
int |
getTombstoneWarnThreshold()
Returns the threshold for warning of queries with many tombstones
|
double |
getTracingProbability()
Returns the configured tracing probability.
|
java.util.List<java.lang.String> |
getUnreachableNodes()
Retrieve the list of unreachable nodes in the cluster, as determined
by this node's failure detector.
|
java.lang.Iterable<ColumnFamilyStore> |
getValidColumnFamilies(boolean allowIndexes,
boolean autoAddIndexes,
java.lang.String keyspaceName,
java.lang.String... cfNames) |
void |
gossipSnitchInfo() |
void |
initClient() |
void |
initClient(int ringDelay) |
void |
initServer() |
void |
initServer(int delay) |
boolean |
isBootstrapMode() |
boolean |
isClientMode() |
boolean |
isGossipRunning() |
boolean |
isIncrementalBackupsEnabled() |
boolean |
isInitialized() |
boolean |
isJoined() |
boolean |
isNativeTransportRunning() |
boolean |
isRPCServerRunning() |
boolean |
isStarting()
Returns whether the storage service is starting or not
|
void |
joinRing() |
void |
loadNewSSTables(java.lang.String ksName,
java.lang.String cfName)
#Load new SSTables to the given keyspace/columnFamily
|
void |
move(java.lang.String newToken) |
void |
onAlive(java.net.InetAddress endpoint,
EndpointState state) |
void |
onChange(java.net.InetAddress endpoint,
ApplicationState state,
VersionedValue value) |
void |
onDead(java.net.InetAddress endpoint,
EndpointState state) |
void |
onJoin(java.net.InetAddress endpoint,
EndpointState epState)
Use to inform interested parties about the change in the state
for specified endpoint
|
void |
onRemove(java.net.InetAddress endpoint) |
void |
onRestart(java.net.InetAddress endpoint,
EndpointState state)
Called whenever a node is restarted.
|
java.util.Collection<Token> |
prepareReplacementInfo() |
void |
rebuild(java.lang.String sourceDc)
Initiate a process of streaming data for which we are responsible from other nodes.
|
void |
rebuildSecondaryIndex(java.lang.String ksName,
java.lang.String cfName,
java.lang.String... idxNames)
rebuild the specified indexes
|
void |
register(IEndpointLifecycleSubscriber subscriber) |
void |
registerDaemon(CassandraDaemon daemon) |
void |
removeNode(java.lang.String hostIdString)
Remove a node that has died, attempting to restore the replica count.
|
void |
reportManualSeverity(double incr) |
void |
reportSeverity(double incr)
Increment about the known Compaction severity of the events in this node
|
void |
rescheduleFailedDeletions() |
void |
resetLocalSchema() |
java.util.List<java.lang.String> |
sampleKeyRange()
#Return a List of Tokens representing a sample of keys across all ColumnFamilyStores.
|
void |
scrub(boolean disableSnapshot,
boolean skipCorrupted,
java.lang.String keyspaceName,
java.lang.String... columnFamilies)
Scrub (deserialize + reserialize at the latest version, skipping bad rows if any) the given keyspace.
|
void |
sendNotification(java.lang.String type,
java.lang.String message,
java.lang.Object userObject)
Sends JMX notification to subscribers.
|
void |
setCompactionThroughputMbPerSec(int value) |
void |
setHintedHandoffThrottleInKB(int throttleInKB)
Sets the hinted handoff throttle in kb per second, per delivery thread.
|
void |
setIncrementalBackupsEnabled(boolean value) |
void |
setLog4jLevel(java.lang.String classQualifier,
java.lang.String rawLevel)
set the logging level at runtime
|
void |
setStreamThroughputMbPerSec(int value) |
void |
setTokens(java.util.Collection<Token> tokens)
This method updates the local token on disk
|
void |
setTombstoneFailureThreshold(int threshold)
Sets the threshold for abandoning queries with many tombstones
|
void |
setTombstoneWarnThreshold(int threshold)
Sets the threshold for warning queries with many tombstones
|
void |
setTraceProbability(double probability)
Enables/Disables tracing for the whole system.
|
void |
startGossiping() |
void |
startNativeTransport() |
void |
startRPCServer() |
void |
stopClient() |
void |
stopDaemon() |
void |
stopGossiping() |
void |
stopNativeTransport() |
void |
stopRPCServer() |
void |
stopTransports() |
void |
takeColumnFamilySnapshot(java.lang.String keyspaceName,
java.lang.String columnFamilyName,
java.lang.String tag)
Takes the snapshot of a specific column family.
|
void |
takeSnapshot(java.lang.String tag,
java.lang.String... keyspaceNames)
Takes the snapshot for the given keyspaces.
|
void |
truncate(java.lang.String keyspace,
java.lang.String columnFamily)
Truncates (deletes) the given columnFamily from the provided keyspace.
|
void |
unregister(IEndpointLifecycleSubscriber subscriber) |
void |
updateSnitch(java.lang.String epSnitchClassName,
java.lang.Boolean dynamic,
java.lang.Integer dynamicUpdateInterval,
java.lang.Integer dynamicResetInterval,
java.lang.Double dynamicBadnessThreshold)
Change endpointsnitch class and dynamic-ness (and dynamic attributes) at runtime
|
void |
upgradeSSTables(java.lang.String keyspaceName,
boolean excludeCurrentVersion,
java.lang.String... columnFamilies)
Rewrite all sstables to the latest version.
|
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationpublic static final int RING_DELAY
public static final DebuggableScheduledThreadPoolExecutor scheduledTasks
public static final DebuggableScheduledThreadPoolExecutor tasks
public static final DebuggableScheduledThreadPoolExecutor optionalTasks
public volatile VersionedValue.VersionedValueFactory valueFactory
public static final StorageService instance
public static IPartitioner getPartitioner()
public java.util.Collection<Range<Token>> getLocalRanges(java.lang.String keyspaceName)
public java.util.Collection<Range<Token>> getLocalPrimaryRanges(java.lang.String keyspace)
public void finishBootstrapping()
public void setTokens(java.util.Collection<Token> tokens)
public void registerDaemon(CassandraDaemon daemon)
public void register(IEndpointLifecycleSubscriber subscriber)
public void unregister(IEndpointLifecycleSubscriber subscriber)
public void stopGossiping()
stopGossiping in interface StorageServiceMBeanpublic void startGossiping()
startGossiping in interface StorageServiceMBeanpublic boolean isGossipRunning()
isGossipRunning in interface StorageServiceMBeanpublic void startRPCServer()
startRPCServer in interface StorageServiceMBeanpublic void stopRPCServer()
stopRPCServer in interface StorageServiceMBeanpublic boolean isRPCServerRunning()
isRPCServerRunning in interface StorageServiceMBeanpublic void startNativeTransport()
startNativeTransport in interface StorageServiceMBeanpublic void stopNativeTransport()
stopNativeTransport in interface StorageServiceMBeanpublic boolean isNativeTransportRunning()
isNativeTransportRunning in interface StorageServiceMBeanpublic void stopTransports()
public void stopClient()
public boolean isInitialized()
isInitialized in interface StorageServiceMBeanpublic void stopDaemon()
stopDaemon in interface StorageServiceMBeanpublic java.util.Collection<Token> prepareReplacementInfo() throws ConfigurationException
ConfigurationExceptionpublic void checkForEndpointCollision()
throws ConfigurationException
ConfigurationExceptionpublic void initClient()
throws ConfigurationException
ConfigurationExceptionpublic void initClient(int ringDelay)
throws ConfigurationException
ConfigurationExceptionpublic void initServer()
throws ConfigurationException
ConfigurationExceptionpublic void initServer(int delay)
throws ConfigurationException
ConfigurationExceptionpublic void gossipSnitchInfo()
public void joinRing()
throws java.io.IOException
joinRing in interface StorageServiceMBeanjava.io.IOExceptionpublic boolean isJoined()
isJoined in interface StorageServiceMBeanpublic void rebuild(java.lang.String sourceDc)
StorageServiceMBeanrebuild in interface StorageServiceMBeansourceDc - Name of DC from which to select sources for streaming or null to pick any nodepublic void setStreamThroughputMbPerSec(int value)
setStreamThroughputMbPerSec in interface StorageServiceMBeanpublic int getStreamThroughputMbPerSec()
getStreamThroughputMbPerSec in interface StorageServiceMBeanpublic int getCompactionThroughputMbPerSec()
getCompactionThroughputMbPerSec in interface StorageServiceMBeanpublic void setCompactionThroughputMbPerSec(int value)
setCompactionThroughputMbPerSec in interface StorageServiceMBeanpublic boolean isIncrementalBackupsEnabled()
isIncrementalBackupsEnabled in interface StorageServiceMBeanpublic void setIncrementalBackupsEnabled(boolean value)
setIncrementalBackupsEnabled in interface StorageServiceMBeanpublic boolean isBootstrapMode()
public TokenMetadata getTokenMetadata()
public void reportSeverity(double incr)
public void reportManualSeverity(double incr)
public double getSeverity(java.net.InetAddress endpoint)
public java.util.Map<java.util.List<java.lang.String>,java.util.List<java.lang.String>> getRangeToEndpointMap(java.lang.String keyspace)
getRangeToEndpointMap in interface StorageServiceMBeankeyspace - public java.lang.String getRpcaddress(java.net.InetAddress endpoint)
endpoint - The endpoint to get rpc address forpublic java.util.Map<java.util.List<java.lang.String>,java.util.List<java.lang.String>> getRangeToRpcaddressMap(java.lang.String keyspace)
getRangeToRpcaddressMap in interface StorageServiceMBeankeyspace - public java.util.Map<java.util.List<java.lang.String>,java.util.List<java.lang.String>> getPendingRangeToEndpointMap(java.lang.String keyspace)
StorageServiceMBeangetPendingRangeToEndpointMap in interface StorageServiceMBeankeyspace - the keyspace to get the pending range map for.public java.util.Map<Range<Token>,java.util.List<java.net.InetAddress>> getRangeToAddressMap(java.lang.String keyspace)
public java.util.Map<Range<Token>,java.util.List<java.net.InetAddress>> getRangeToAddressMapInLocalDC(java.lang.String keyspace)
public java.util.List<java.lang.String> describeRingJMX(java.lang.String keyspace)
throws java.io.IOException
describeRing(String) but converts TokenRange to the String for JMX compatibilitydescribeRingJMX in interface StorageServiceMBeankeyspace - The keyspace to fetch information aboutjava.io.IOExceptionpublic java.util.List<TokenRange> describeRing(java.lang.String keyspace) throws InvalidRequestException
keyspace - The keyspace to fetch information aboutInvalidRequestException - if there is no ring information available about keyspacepublic java.util.List<TokenRange> describeLocalRing(java.lang.String keyspace) throws InvalidRequestException
describeRing(String) but considers only the part of the ring formed by nodes in the local DC.InvalidRequestExceptionpublic java.util.Map<java.lang.String,java.lang.String> getTokenToEndpointMap()
StorageServiceMBeangetTokenToEndpointMap in interface StorageServiceMBeanpublic java.lang.String getLocalHostId()
StorageServiceMBeangetLocalHostId in interface StorageServiceMBeanpublic java.util.Map<java.lang.String,java.lang.String> getHostIdMap()
StorageServiceMBeangetHostIdMap in interface StorageServiceMBeanpublic void beforeChange(java.net.InetAddress endpoint,
EndpointState currentState,
ApplicationState newStateKey,
VersionedValue newValue)
beforeChange in interface IEndpointStateChangeSubscriberpublic void onChange(java.net.InetAddress endpoint,
ApplicationState state,
VersionedValue value)
onChange in interface IEndpointStateChangeSubscriberprotected void addExpireTimeIfFound(java.net.InetAddress endpoint,
long expireTime)
protected long extractExpireTime(java.lang.String[] pieces)
public void onJoin(java.net.InetAddress endpoint,
EndpointState epState)
IEndpointStateChangeSubscriberonJoin in interface IEndpointStateChangeSubscriberendpoint - endpoint for which the state change occurred.epState - state that actually changed for the above endpoint.public void onAlive(java.net.InetAddress endpoint,
EndpointState state)
onAlive in interface IEndpointStateChangeSubscriberpublic void onRemove(java.net.InetAddress endpoint)
onRemove in interface IEndpointStateChangeSubscriberpublic void onDead(java.net.InetAddress endpoint,
EndpointState state)
onDead in interface IEndpointStateChangeSubscriberpublic void onRestart(java.net.InetAddress endpoint,
EndpointState state)
IEndpointStateChangeSubscriberstate.isAlive() == false
as state is from before the restarted node is marked up.onRestart in interface IEndpointStateChangeSubscriberpublic double getLoad()
getLoad in interface StorageServiceMBeanStorageMetrics.loadpublic java.lang.String getLoadString()
StorageServiceMBeangetLoadString in interface StorageServiceMBeanpublic java.util.Map<java.lang.String,java.lang.String> getLoadMap()
StorageServiceMBeangetLoadMap in interface StorageServiceMBeanpublic final void deliverHints(java.lang.String host)
throws java.net.UnknownHostException
deliverHints in interface StorageServiceMBeanjava.net.UnknownHostExceptionpublic java.util.Collection<Token> getLocalTokens()
public java.util.List<java.lang.String> getTokens()
StorageServiceMBeangetTokens in interface StorageServiceMBeanpublic java.util.List<java.lang.String> getTokens(java.lang.String endpoint)
throws java.net.UnknownHostException
StorageServiceMBeangetTokens in interface StorageServiceMBeanendpoint - string representation of an nodejava.net.UnknownHostExceptionpublic java.lang.String getReleaseVersion()
StorageServiceMBeangetReleaseVersion in interface StorageServiceMBeanpublic java.lang.String getSchemaVersion()
StorageServiceMBeangetSchemaVersion in interface StorageServiceMBeanpublic java.util.List<java.lang.String> getLeavingNodes()
StorageServiceMBeangetLeavingNodes in interface StorageServiceMBeanpublic java.util.List<java.lang.String> getMovingNodes()
StorageServiceMBeangetMovingNodes in interface StorageServiceMBeanpublic java.util.List<java.lang.String> getJoiningNodes()
StorageServiceMBeangetJoiningNodes in interface StorageServiceMBeanpublic java.util.List<java.lang.String> getLiveNodes()
StorageServiceMBeangetLiveNodes in interface StorageServiceMBeanpublic java.util.List<java.lang.String> getUnreachableNodes()
StorageServiceMBeangetUnreachableNodes in interface StorageServiceMBeanpublic java.lang.String[] getAllDataFileLocations()
StorageServiceMBeangetAllDataFileLocations in interface StorageServiceMBeanpublic java.lang.String getCommitLogLocation()
StorageServiceMBeangetCommitLogLocation in interface StorageServiceMBeanpublic java.lang.String getSavedCachesLocation()
StorageServiceMBeangetSavedCachesLocation in interface StorageServiceMBeanpublic int getCurrentGenerationNumber()
StorageServiceMBeangetCurrentGenerationNumber in interface StorageServiceMBeanpublic void forceKeyspaceCleanup(java.lang.String keyspaceName,
java.lang.String... columnFamilies)
throws java.io.IOException,
java.util.concurrent.ExecutionException,
java.lang.InterruptedException
StorageServiceMBeanforceKeyspaceCleanup in interface StorageServiceMBeanjava.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedExceptionpublic void scrub(boolean disableSnapshot,
boolean skipCorrupted,
java.lang.String keyspaceName,
java.lang.String... columnFamilies)
throws java.io.IOException,
java.util.concurrent.ExecutionException,
java.lang.InterruptedException
StorageServiceMBeanscrub in interface StorageServiceMBeanjava.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedExceptionpublic void upgradeSSTables(java.lang.String keyspaceName,
boolean excludeCurrentVersion,
java.lang.String... columnFamilies)
throws java.io.IOException,
java.util.concurrent.ExecutionException,
java.lang.InterruptedException
StorageServiceMBeanupgradeSSTables in interface StorageServiceMBeanjava.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedExceptionpublic void forceKeyspaceCompaction(java.lang.String keyspaceName,
java.lang.String... columnFamilies)
throws java.io.IOException,
java.util.concurrent.ExecutionException,
java.lang.InterruptedException
StorageServiceMBeanforceKeyspaceCompaction in interface StorageServiceMBeanjava.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedExceptionpublic void takeSnapshot(java.lang.String tag,
java.lang.String... keyspaceNames)
throws java.io.IOException
takeSnapshot in interface StorageServiceMBeantag - the tag given to the snapshot; may not be null or emptykeyspaceNames - the names of the keyspaces to snapshot; empty means "all."java.io.IOExceptionpublic void takeColumnFamilySnapshot(java.lang.String keyspaceName,
java.lang.String columnFamilyName,
java.lang.String tag)
throws java.io.IOException
takeColumnFamilySnapshot in interface StorageServiceMBeankeyspaceName - the keyspace which holds the specified column familycolumnFamilyName - the column family to snapshottag - the tag given to the snapshot; may not be null or emptyjava.io.IOExceptionpublic void clearSnapshot(java.lang.String tag,
java.lang.String... keyspaceNames)
throws java.io.IOException
clearSnapshot in interface StorageServiceMBeanjava.io.IOExceptionpublic java.lang.Iterable<ColumnFamilyStore> getValidColumnFamilies(boolean allowIndexes, boolean autoAddIndexes, java.lang.String keyspaceName, java.lang.String... cfNames) throws java.io.IOException
allowIndexes - Allow index CF names to be passed inautoAddIndexes - Automatically add secondary indexes if a CF has themkeyspaceName - keyspacecfNames - CFsjava.io.IOExceptionpublic void forceKeyspaceFlush(java.lang.String keyspaceName,
java.lang.String... columnFamilies)
throws java.io.IOException
forceKeyspaceFlush in interface StorageServiceMBeankeyspaceName - columnFamilies - java.io.IOExceptionpublic void sendNotification(java.lang.String type,
java.lang.String message,
java.lang.Object userObject)
type - Message typemessage - Message itselfuserObject - Arbitrary object to attach to notificationpublic int forceRepairAsync(java.lang.String keyspace,
boolean isSequential,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
boolean primaryRange,
java.lang.String... columnFamilies)
StorageServiceMBeanforceRepairAsync in interface StorageServiceMBeanpublic int forceRepairAsync(java.lang.String keyspace,
int parallelismDegree,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
boolean primaryRange,
java.lang.String... columnFamilies)
StorageServiceMBeanforceRepairAsync in interface StorageServiceMBeanparallelismDegree - 0: sequential, 1: parallel, 2: DC parallelpublic int forceRepairAsync(java.lang.String keyspace,
RepairParallelism parallelismDegree,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
java.util.Collection<Range<Token>> ranges,
java.lang.String... columnFamilies)
public int forceRepairAsync(java.lang.String keyspace,
boolean isSequential,
boolean isLocal,
boolean primaryRange,
java.lang.String... columnFamilies)
StorageServiceMBeanforceRepairAsync in interface StorageServiceMBeanStorageServiceMBean.forceKeyspaceRepair(String, boolean, boolean, String...)public int forceRepairAsync(java.lang.String keyspace,
RepairParallelism parallelismDegree,
boolean isLocal,
java.util.Collection<Range<Token>> ranges,
java.lang.String... columnFamilies)
public int forceRepairRangeAsync(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
boolean isSequential,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
java.lang.String... columnFamilies)
StorageServiceMBeanforceRepairRangeAsync in interface StorageServiceMBeanpublic int forceRepairRangeAsync(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
int parallelismDegree,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
java.lang.String... columnFamilies)
StorageServiceMBeanforceRepairRangeAsync in interface StorageServiceMBeanparallelismDegree - 0: sequential, 1: parallel, 2: DC parallelpublic int forceRepairRangeAsync(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
java.lang.String... columnFamilies)
StorageServiceMBeanforceRepairRangeAsync in interface StorageServiceMBeanpublic void forceKeyspaceRepair(java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
java.lang.String... columnFamilies)
throws java.io.IOException
forceKeyspaceRepair in interface StorageServiceMBeanjava.io.IOExceptionpublic void forceKeyspaceRepairPrimaryRange(java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
java.lang.String... columnFamilies)
throws java.io.IOException
StorageServiceMBeanforceKeyspaceRepairPrimaryRange in interface StorageServiceMBeanjava.io.IOExceptionpublic void forceKeyspaceRepairRange(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
java.lang.String... columnFamilies)
throws java.io.IOException
StorageServiceMBeanforceKeyspaceRepairRange in interface StorageServiceMBeanjava.io.IOExceptionpublic void forceKeyspaceRepairRange(java.lang.String keyspaceName,
java.util.Collection<Range<Token>> ranges,
RepairParallelism parallelismDegree,
boolean isLocal,
java.lang.String... columnFamilies)
throws java.io.IOException
java.io.IOExceptionpublic RepairFuture forceKeyspaceRepair(Range<Token> range, java.lang.String keyspaceName, boolean isSequential, java.util.Collection<java.lang.String> dataCenters, java.util.Collection<java.lang.String> hosts, java.lang.String... columnFamilies) throws java.io.IOException
java.io.IOExceptionpublic RepairFuture forceKeyspaceRepair(Range<Token> range, java.lang.String keyspaceName, RepairParallelism parallelismDegree, java.util.Collection<java.lang.String> dataCenters, java.util.Collection<java.lang.String> hosts, java.lang.String... columnFamilies) throws java.io.IOException
java.io.IOExceptionpublic void forceTerminateAllRepairSessions()
forceTerminateAllRepairSessions in interface StorageServiceMBeanpublic java.util.Collection<Range<Token>> getPrimaryRangesForEndpoint(java.lang.String keyspace, java.net.InetAddress ep)
AbstractReplicationStrategy.calculateNaturalEndpoints(org.apache.cassandra.dht.Token, org.apache.cassandra.locator.TokenMetadata).keyspace - ep - endpoint we are interested in.@Deprecated public Range<Token> getPrimaryRangeForEndpoint(java.net.InetAddress ep)
ep - endpoint we are interested in.public java.util.List<Range<Token>> getAllRanges(java.util.List<Token> sortedTokens)
public java.util.List<java.net.InetAddress> getNaturalEndpoints(java.lang.String keyspaceName,
java.lang.String cf,
java.lang.String key)
getNaturalEndpoints in interface StorageServiceMBeankeyspaceName - keyspace name also known as keyspacecf - Column family namekey - key for which we need to find the endpointpublic java.util.List<java.net.InetAddress> getNaturalEndpoints(java.lang.String keyspaceName,
java.nio.ByteBuffer key)
getNaturalEndpoints in interface StorageServiceMBeanpublic java.util.List<java.net.InetAddress> getNaturalEndpoints(java.lang.String keyspaceName,
RingPosition pos)
keyspaceName - keyspace name also known as keyspacepos - position for which we need to find the endpointpublic java.util.List<java.net.InetAddress> getLiveNaturalEndpoints(Keyspace keyspace, java.nio.ByteBuffer key)
keyspace - keyspace name also known as keyspacekey - key for which we need to find the endpointpublic java.util.List<java.net.InetAddress> getLiveNaturalEndpoints(Keyspace keyspace, RingPosition pos)
public void setLog4jLevel(java.lang.String classQualifier,
java.lang.String rawLevel)
StorageServiceMBeansetLog4jLevel in interface StorageServiceMBeanpublic java.util.Map<java.lang.String,java.lang.String> getLoggingLevels()
getLoggingLevels in interface StorageServiceMBeanpublic java.util.List<Pair<Range<Token>,java.lang.Long>> getSplits(java.lang.String keyspaceName, java.lang.String cfName, Range<Token> range, int keysPerSplit, CFMetaData metadata)
public void decommission()
throws java.lang.InterruptedException
StorageServiceMBeandecommission in interface StorageServiceMBeanjava.lang.InterruptedExceptionpublic void move(java.lang.String newToken)
throws java.io.IOException
move in interface StorageServiceMBeannewToken - token to move this node to.
This node will unload its data onto its neighbors, and bootstrap to the new token.java.io.IOExceptionpublic java.lang.String getRemovalStatus()
getRemovalStatus in interface StorageServiceMBeanpublic void forceRemoveCompletion()
forceRemoveCompletion in interface StorageServiceMBeanpublic void removeNode(java.lang.String hostIdString)
removeNode in interface StorageServiceMBeanhostIdString - token for the nodepublic void confirmReplication(java.net.InetAddress node)
public boolean isClientMode()
public java.lang.String getOperationMode()
StorageServiceMBeangetOperationMode in interface StorageServiceMBeanpublic boolean isStarting()
StorageServiceMBeanisStarting in interface StorageServiceMBeanpublic java.lang.String getDrainProgress()
StorageServiceMBeangetDrainProgress in interface StorageServiceMBeanpublic void drain()
throws java.io.IOException,
java.lang.InterruptedException,
java.util.concurrent.ExecutionException
drain in interface StorageServiceMBeanjava.io.IOExceptionjava.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic void truncate(java.lang.String keyspace,
java.lang.String columnFamily)
throws java.util.concurrent.TimeoutException,
java.io.IOException
StorageServiceMBeantruncate in interface StorageServiceMBeankeyspace - The keyspace to delete fromcolumnFamily - The column family to delete data from.java.util.concurrent.TimeoutExceptionjava.io.IOExceptionpublic java.util.Map<java.net.InetAddress,java.lang.Float> getOwnership()
StorageServiceMBeangetOwnership in interface StorageServiceMBeanpublic java.util.LinkedHashMap<java.net.InetAddress,java.lang.Float> effectiveOwnership(java.lang.String keyspace)
throws java.lang.IllegalStateException
effectiveOwnership in interface StorageServiceMBeanjava.lang.IllegalStateException - when node is not configured properly.public java.util.List<java.lang.String> getKeyspaces()
getKeyspaces in interface StorageServiceMBeanpublic void updateSnitch(java.lang.String epSnitchClassName,
java.lang.Boolean dynamic,
java.lang.Integer dynamicUpdateInterval,
java.lang.Integer dynamicResetInterval,
java.lang.Double dynamicBadnessThreshold)
throws java.lang.ClassNotFoundException
StorageServiceMBeanupdateSnitch in interface StorageServiceMBeanepSnitchClassName - the canonical path name for a class implementing IEndpointSnitchdynamic - boolean that decides whether dynamicsnitch is used or notdynamicUpdateInterval - integer, in ms (default 100)dynamicResetInterval - integer, in ms (default 600,000)dynamicBadnessThreshold - double, (default 0.0)java.lang.ClassNotFoundExceptionpublic Pair<java.util.Set<Range<Token>>,java.util.Set<Range<Token>>> calculateStreamAndFetchRanges(java.util.Collection<Range<Token>> current, java.util.Collection<Range<Token>> updated)
current - collection of the ranges by current tokenupdated - collection of the ranges after token is changedpublic void bulkLoad(java.lang.String directory)
StorageServiceMBeanbulkLoad in interface StorageServiceMBeanpublic java.lang.String bulkLoadAsync(java.lang.String directory)
StorageServiceMBeanbulkLoadAsync in interface StorageServiceMBeanpublic int getExceptionCount()
getExceptionCount in interface StorageServiceMBeanpublic void rescheduleFailedDeletions()
rescheduleFailedDeletions in interface StorageServiceMBeanpublic void loadNewSSTables(java.lang.String ksName,
java.lang.String cfName)
loadNewSSTables in interface StorageServiceMBeanksName - The parent keyspace namecfName - The ColumnFamily name where SSTables belongpublic java.util.List<java.lang.String> sampleKeyRange()
sampleKeyRange in interface StorageServiceMBeanpublic void rebuildSecondaryIndex(java.lang.String ksName,
java.lang.String cfName,
java.lang.String... idxNames)
StorageServiceMBeanrebuildSecondaryIndex in interface StorageServiceMBeanpublic void resetLocalSchema()
throws java.io.IOException
resetLocalSchema in interface StorageServiceMBeanjava.io.IOExceptionpublic void setTraceProbability(double probability)
StorageServiceMBeansetTraceProbability in interface StorageServiceMBeanprobability - ]0,1[ will enable tracing on a partial number of requests with the provided probability. 0 will
disable tracing and 1 will enable tracing for all requests (which mich severely cripple the system)public double getTracingProbability()
StorageServiceMBeangetTracingProbability in interface StorageServiceMBeanpublic void disableAutoCompaction(java.lang.String ks,
java.lang.String... columnFamilies)
throws java.io.IOException
disableAutoCompaction in interface StorageServiceMBeanjava.io.IOExceptionpublic void enableAutoCompaction(java.lang.String ks,
java.lang.String... columnFamilies)
throws java.io.IOException
enableAutoCompaction in interface StorageServiceMBeanjava.io.IOExceptionpublic java.lang.String getClusterName()
getClusterName in interface StorageServiceMBeanpublic java.lang.String getPartitionerName()
getPartitionerName in interface StorageServiceMBeanpublic int getTombstoneWarnThreshold()
StorageServiceMBeangetTombstoneWarnThreshold in interface StorageServiceMBeanpublic void setTombstoneWarnThreshold(int threshold)
StorageServiceMBeansetTombstoneWarnThreshold in interface StorageServiceMBeanpublic int getTombstoneFailureThreshold()
StorageServiceMBeangetTombstoneFailureThreshold in interface StorageServiceMBeanpublic void setTombstoneFailureThreshold(int threshold)
StorageServiceMBeansetTombstoneFailureThreshold in interface StorageServiceMBeanpublic void setHintedHandoffThrottleInKB(int throttleInKB)
StorageServiceMBeansetHintedHandoffThrottleInKB in interface StorageServiceMBeanCopyright © 2015 The Apache Software Foundation