public class StorageService extends javax.management.NotificationBroadcasterSupport implements IEndpointStateChangeSubscriber, StorageServiceMBean
Modifier and Type | Field and Description |
---|---|
static StorageService |
instance |
static int |
RING_DELAY |
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<org.apache.cassandra.thrift.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<org.apache.cassandra.thrift.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... tables) |
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... tables) |
protected long |
extractExpireTime(java.lang.String[] pieces) |
int |
forceKeyspaceCleanup(int jobs,
java.lang.String keyspaceName,
java.lang.String... tables) |
int |
forceKeyspaceCleanup(java.lang.String keyspaceName,
java.lang.String... tables)
Trigger a cleanup of keys on a single keyspace
|
void |
forceKeyspaceCompaction(boolean splitOutput,
java.lang.String keyspaceName,
java.lang.String... tableNames)
Forces major compaction of a single keyspace
|
void |
forceKeyspaceFlush(java.lang.String keyspaceName,
java.lang.String... tableNames)
Flush all memtables for a keyspace and column families.
|
void |
forceRemoveCompletion()
Force a remove operation to complete.
|
int |
forceRepairAsync(java.lang.String keyspace,
boolean isSequential,
boolean isLocal,
boolean primaryRange,
boolean fullRepair,
java.lang.String... tableNames)
Deprecated.
|
int |
forceRepairAsync(java.lang.String keyspace,
boolean isSequential,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
boolean primaryRange,
boolean fullRepair,
java.lang.String... tableNames)
Deprecated.
|
int |
forceRepairAsync(java.lang.String keyspace,
int parallelismDegree,
java.util.Collection<java.lang.String> dataCenters,
java.util.Collection<java.lang.String> hosts,
boolean primaryRange,
boolean fullRepair,
java.lang.String... tableNames)
Deprecated.
|
int |
forceRepairAsync(java.lang.String keyspace,
RepairOption options,
boolean legacy) |
int |
forceRepairRangeAsync(java.lang.String beginToken,
java.lang.String endToken,
java.lang.String keyspaceName,
boolean isSequential,
boolean isLocal,
boolean fullRepair,
java.lang.String... tableNames)
Deprecated.
|
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,
boolean fullRepair,
java.lang.String... tableNames)
Deprecated.
|
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,
boolean fullRepair,
java.lang.String... tableNames)
Deprecated.
|
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.
|
int |
getBatchSizeFailureThreshold()
Returns the threshold for rejecting queries due to a large batch size
|
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
|
java.net.InetAddress |
getEndpointForHostId(java.util.UUID hostId) |
java.util.Map<java.lang.String,java.lang.String> |
getEndpointToHostId()
Retrieve the mapping of endpoint to host ID
|
java.util.UUID |
getHostIdForEndpoint(java.net.InetAddress address) |
java.util.Map<java.lang.String,java.lang.String> |
getHostIdMap()
|
java.util.Map<java.lang.String,java.lang.String> |
getHostIdToEndpoint()
Retrieve the mapping of host ID to endpoint
|
int |
getInterDCStreamThroughputMbPerSec() |
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.
|
java.util.Set<java.net.InetAddress> |
getLiveRingMembers() |
java.util.Set<java.net.InetAddress> |
getLiveRingMembers(boolean excludeDeadStates) |
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.UUID |
getLocalHostUUID() |
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()
get the runtime logging levels
|
java.util.List<java.lang.String> |
getMovingNodes()
Retrieve the list of nodes currently moving in the ring.
|
java.lang.Iterable<java.net.InetAddress> |
getNaturalAndPendingEndpoints(java.lang.String keyspaceName,
Token token)
Returns the endpoints currently responsible for storing the token plus pending ones
|
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.util.List<java.lang.String> |
getNonLocalStrategyKeyspaces() |
java.util.List<java.lang.String> |
getNonSystemKeyspaces() |
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"
|
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
|
java.util.Collection<Range<Token>> |
getPrimaryRangeForEndpointWithinDC(java.lang.String keyspace,
java.net.InetAddress referenceEndpoint)
Get the "primary ranges" within local DC for the specified keyspace and endpoint.
|
java.util.Collection<Range<Token>> |
getPrimaryRanges(java.lang.String keyspace) |
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.Collection<Range<Token>> |
getPrimaryRangesWithinDC(java.lang.String keyspace) |
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.Map<java.lang.String,javax.management.openmbean.TabularData> |
getSnapshotDetails()
Get the details of all the snapshot
|
java.util.List<Pair<Range<Token>,java.lang.Long>> |
getSplits(java.lang.String keyspaceName,
java.lang.String cfName,
Range<Token> range,
int keysPerSplit) |
int |
getStreamThroughputMbPerSec() |
Token.TokenFactory |
getTokenFactory() |
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 |
getTraceProbability()
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 |
initServer() |
void |
initServer(int delay) |
boolean |
isBootstrapMode() |
boolean |
isGossipRunning() |
boolean |
isIncrementalBackupsEnabled() |
boolean |
isInitialized() |
boolean |
isInShutdownHook() |
boolean |
isJoined() |
boolean |
isJoining() |
boolean |
isMoving() |
boolean |
isNativeTransportRunning() |
boolean |
isRPCServerRunning() |
boolean |
isSetupCompleted() |
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/table
|
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.
|
void |
populateTokenMetadata() |
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 |
refreshSizeEstimates()
Forces refresh of values stored in system.size_estimates of all column families.
|
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 |
removeShutdownHook()
In the event of forceful termination we need to remove the shutdown hook to prevent hanging (OOM for instance)
|
int |
repairAsync(java.lang.String keyspace,
java.util.Map<java.lang.String,java.lang.String> repairSpec)
Invoke repair asynchronously.
|
void |
reportManualSeverity(double incr) |
void |
reportSeverity(double incr)
Increment about the known Compaction severity of the events in this node
|
void |
rescheduleFailedDeletions() |
void |
resetLocalSchema() |
boolean |
resumeBootstrap()
Resume bootstrap streaming when there is failed data streaming.
|
java.util.List<java.lang.String> |
sampleKeyRange()
#Return a List of Tokens representing a sample of keys across all ColumnFamilyStores.
|
int |
scrub(boolean disableSnapshot,
boolean skipCorrupted,
boolean checkData,
int jobs,
java.lang.String keyspaceName,
java.lang.String... tables) |
int |
scrub(boolean disableSnapshot,
boolean skipCorrupted,
boolean checkData,
java.lang.String keyspaceName,
java.lang.String... tables) |
int |
scrub(boolean disableSnapshot,
boolean skipCorrupted,
java.lang.String keyspaceName,
java.lang.String... tables)
Scrub (deserialize + reserialize at the latest version, skipping bad rows if any) the given keyspace.
|
void |
setBatchSizeFailureThreshold(int threshold)
Sets the threshold for rejecting queries due to a large batch size
|
void |
setCompactionThroughputMbPerSec(int value) |
void |
setGossipTokens(java.util.Collection<Token> tokens) |
void |
setHintedHandoffThrottleInKB(int throttleInKB)
Sets the hinted handoff throttle in kb per second, per delivery thread.
|
void |
setIncrementalBackupsEnabled(boolean value) |
void |
setInterDCStreamThroughputMbPerSec(int value) |
void |
setLoggingLevel(java.lang.String classQualifier,
java.lang.String rawLevel)
set the logging level at runtime
If both classQualifer and level are empty/null, it will reload the configuration to reset. If classQualifer is not empty but level is empty/null, it will set the level to null for the defined classQualifer If level cannot be parsed, then the level will be defaulted to DEBUG The logback configuration should have < jmxConfigurator /> set |
IPartitioner |
setPartitionerUnsafe(IPartitioner newPartitioner) |
void |
setRpcReady(boolean value) |
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 |
takeMultipleTableSnapshot(java.lang.String tag,
java.lang.String... tableList)
Takes the snapshot of a multiple column family from different keyspaces.
|
void |
takeSnapshot(java.lang.String tag,
java.lang.String... keyspaceNames)
Takes the snapshot for the given keyspaces.
|
void |
takeTableSnapshot(java.lang.String keyspaceName,
java.lang.String tableName,
java.lang.String tag)
Takes the snapshot of a specific table.
|
long |
trueSnapshotsSize()
Get the true size taken by all snapshots across all keyspaces.
|
void |
truncate(java.lang.String keyspace,
java.lang.String table)
Truncates (deletes) the given table from the provided keyspace.
|
void |
unregister(IEndpointLifecycleSubscriber subscriber) |
void |
unsafeInitialize() |
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 |
updateTopology() |
void |
updateTopology(java.net.InetAddress endpoint) |
int |
upgradeSSTables(java.lang.String keyspaceName,
boolean excludeCurrentVersion,
int jobs,
java.lang.String... tableNames) |
int |
upgradeSSTables(java.lang.String keyspaceName,
boolean excludeCurrentVersion,
java.lang.String... tableNames)
Rewrite all sstables to the latest version.
|
int |
verify(boolean extendedVerify,
java.lang.String keyspaceName,
java.lang.String... tableNames)
Verify (checksums of) the given keyspace.
|
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
public static final int RING_DELAY
public volatile VersionedValue.VersionedValueFactory valueFactory
public static final StorageService instance
public boolean isInShutdownHook()
public java.util.Collection<Range<Token>> getLocalRanges(java.lang.String keyspaceName)
public java.util.Collection<Range<Token>> getPrimaryRanges(java.lang.String keyspace)
public java.util.Collection<Range<Token>> getPrimaryRangesWithinDC(java.lang.String keyspace)
public void setTokens(java.util.Collection<Token> tokens)
public void setGossipTokens(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 StorageServiceMBean
public void startGossiping()
startGossiping
in interface StorageServiceMBean
public boolean isGossipRunning()
isGossipRunning
in interface StorageServiceMBean
public void startRPCServer()
startRPCServer
in interface StorageServiceMBean
public void stopRPCServer()
stopRPCServer
in interface StorageServiceMBean
public boolean isRPCServerRunning()
isRPCServerRunning
in interface StorageServiceMBean
public void startNativeTransport()
startNativeTransport
in interface StorageServiceMBean
public void stopNativeTransport()
stopNativeTransport
in interface StorageServiceMBean
public boolean isNativeTransportRunning()
isNativeTransportRunning
in interface StorageServiceMBean
public void stopTransports()
public void stopClient()
public boolean isInitialized()
isInitialized
in interface StorageServiceMBean
public boolean isSetupCompleted()
public void stopDaemon()
stopDaemon
in interface StorageServiceMBean
public java.util.Collection<Token> prepareReplacementInfo() throws ConfigurationException
ConfigurationException
public void checkForEndpointCollision() throws ConfigurationException
ConfigurationException
public void unsafeInitialize() throws ConfigurationException
ConfigurationException
public void populateTokenMetadata()
public void initServer() throws ConfigurationException
ConfigurationException
public void initServer(int delay) throws ConfigurationException
ConfigurationException
public void removeShutdownHook()
public void gossipSnitchInfo()
public void joinRing() throws java.io.IOException
joinRing
in interface StorageServiceMBean
java.io.IOException
public boolean isJoined()
isJoined
in interface StorageServiceMBean
public void rebuild(java.lang.String sourceDc)
StorageServiceMBean
rebuild
in interface StorageServiceMBean
sourceDc
- Name of DC from which to select sources for streaming or null to pick any nodepublic void setStreamThroughputMbPerSec(int value)
setStreamThroughputMbPerSec
in interface StorageServiceMBean
public int getStreamThroughputMbPerSec()
getStreamThroughputMbPerSec
in interface StorageServiceMBean
public void setInterDCStreamThroughputMbPerSec(int value)
setInterDCStreamThroughputMbPerSec
in interface StorageServiceMBean
public int getInterDCStreamThroughputMbPerSec()
getInterDCStreamThroughputMbPerSec
in interface StorageServiceMBean
public int getCompactionThroughputMbPerSec()
getCompactionThroughputMbPerSec
in interface StorageServiceMBean
public void setCompactionThroughputMbPerSec(int value)
setCompactionThroughputMbPerSec
in interface StorageServiceMBean
public boolean isIncrementalBackupsEnabled()
isIncrementalBackupsEnabled
in interface StorageServiceMBean
public void setIncrementalBackupsEnabled(boolean value)
setIncrementalBackupsEnabled
in interface StorageServiceMBean
public boolean resumeBootstrap()
StorageServiceMBean
resumeBootstrap
in interface StorageServiceMBean
public 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 StorageServiceMBean
keyspace
- 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 StorageServiceMBean
keyspace
- public java.util.Map<java.util.List<java.lang.String>,java.util.List<java.lang.String>> getPendingRangeToEndpointMap(java.lang.String keyspace)
StorageServiceMBean
getPendingRangeToEndpointMap
in interface StorageServiceMBean
keyspace
- 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 StorageServiceMBean
keyspace
- The keyspace to fetch information aboutjava.io.IOException
public java.util.List<org.apache.cassandra.thrift.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<org.apache.cassandra.thrift.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.InvalidRequestException
public java.util.Map<java.lang.String,java.lang.String> getTokenToEndpointMap()
StorageServiceMBean
getTokenToEndpointMap
in interface StorageServiceMBean
public java.lang.String getLocalHostId()
StorageServiceMBean
getLocalHostId
in interface StorageServiceMBean
public java.util.UUID getLocalHostUUID()
public java.util.Map<java.lang.String,java.lang.String> getHostIdMap()
StorageServiceMBean
getHostIdMap
in interface StorageServiceMBean
public java.util.Map<java.lang.String,java.lang.String> getEndpointToHostId()
StorageServiceMBean
getEndpointToHostId
in interface StorageServiceMBean
public java.util.Map<java.lang.String,java.lang.String> getHostIdToEndpoint()
StorageServiceMBean
getHostIdToEndpoint
in interface StorageServiceMBean
public void beforeChange(java.net.InetAddress endpoint, EndpointState currentState, ApplicationState newStateKey, VersionedValue newValue)
beforeChange
in interface IEndpointStateChangeSubscriber
public void onChange(java.net.InetAddress endpoint, ApplicationState state, VersionedValue value)
onChange
in interface IEndpointStateChangeSubscriber
public void updateTopology(java.net.InetAddress endpoint)
public void updateTopology()
public void setRpcReady(boolean value)
protected void addExpireTimeIfFound(java.net.InetAddress endpoint, long expireTime)
protected long extractExpireTime(java.lang.String[] pieces)
public void onJoin(java.net.InetAddress endpoint, EndpointState epState)
IEndpointStateChangeSubscriber
onJoin
in interface IEndpointStateChangeSubscriber
endpoint
- 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 IEndpointStateChangeSubscriber
public void onRemove(java.net.InetAddress endpoint)
onRemove
in interface IEndpointStateChangeSubscriber
public void onDead(java.net.InetAddress endpoint, EndpointState state)
onDead
in interface IEndpointStateChangeSubscriber
public void onRestart(java.net.InetAddress endpoint, EndpointState state)
IEndpointStateChangeSubscriber
state.isAlive() == false
as state
is from before the restarted node is marked up.onRestart
in interface IEndpointStateChangeSubscriber
public java.lang.String getLoadString()
StorageServiceMBean
getLoadString
in interface StorageServiceMBean
public java.util.Map<java.lang.String,java.lang.String> getLoadMap()
StorageServiceMBean
getLoadMap
in interface StorageServiceMBean
public final void deliverHints(java.lang.String host) throws java.net.UnknownHostException
deliverHints
in interface StorageServiceMBean
java.net.UnknownHostException
public java.util.Collection<Token> getLocalTokens()
@Nullable public java.net.InetAddress getEndpointForHostId(java.util.UUID hostId)
@Nullable public java.util.UUID getHostIdForEndpoint(java.net.InetAddress address)
public java.util.List<java.lang.String> getTokens()
StorageServiceMBean
getTokens
in interface StorageServiceMBean
public java.util.List<java.lang.String> getTokens(java.lang.String endpoint) throws java.net.UnknownHostException
StorageServiceMBean
getTokens
in interface StorageServiceMBean
endpoint
- string representation of an nodejava.net.UnknownHostException
public java.lang.String getReleaseVersion()
StorageServiceMBean
getReleaseVersion
in interface StorageServiceMBean
public java.lang.String getSchemaVersion()
StorageServiceMBean
getSchemaVersion
in interface StorageServiceMBean
public java.util.List<java.lang.String> getLeavingNodes()
StorageServiceMBean
getLeavingNodes
in interface StorageServiceMBean
public java.util.List<java.lang.String> getMovingNodes()
StorageServiceMBean
getMovingNodes
in interface StorageServiceMBean
public java.util.List<java.lang.String> getJoiningNodes()
StorageServiceMBean
getJoiningNodes
in interface StorageServiceMBean
public java.util.List<java.lang.String> getLiveNodes()
StorageServiceMBean
getLiveNodes
in interface StorageServiceMBean
public java.util.Set<java.net.InetAddress> getLiveRingMembers()
public java.util.Set<java.net.InetAddress> getLiveRingMembers(boolean excludeDeadStates)
public java.util.List<java.lang.String> getUnreachableNodes()
StorageServiceMBean
getUnreachableNodes
in interface StorageServiceMBean
public java.lang.String[] getAllDataFileLocations()
StorageServiceMBean
getAllDataFileLocations
in interface StorageServiceMBean
public java.lang.String getCommitLogLocation()
StorageServiceMBean
getCommitLogLocation
in interface StorageServiceMBean
public java.lang.String getSavedCachesLocation()
StorageServiceMBean
getSavedCachesLocation
in interface StorageServiceMBean
public int getCurrentGenerationNumber()
StorageServiceMBean
getCurrentGenerationNumber
in interface StorageServiceMBean
public int forceKeyspaceCleanup(java.lang.String keyspaceName, java.lang.String... tables) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
StorageServiceMBean
forceKeyspaceCleanup
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public int forceKeyspaceCleanup(int jobs, java.lang.String keyspaceName, java.lang.String... tables) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
forceKeyspaceCleanup
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public int scrub(boolean disableSnapshot, boolean skipCorrupted, java.lang.String keyspaceName, java.lang.String... tables) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
StorageServiceMBean
scrub
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public int scrub(boolean disableSnapshot, boolean skipCorrupted, boolean checkData, java.lang.String keyspaceName, java.lang.String... tables) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
scrub
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public int scrub(boolean disableSnapshot, boolean skipCorrupted, boolean checkData, int jobs, java.lang.String keyspaceName, java.lang.String... tables) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
scrub
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public int verify(boolean extendedVerify, java.lang.String keyspaceName, java.lang.String... tableNames) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
StorageServiceMBean
verify
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public int upgradeSSTables(java.lang.String keyspaceName, boolean excludeCurrentVersion, java.lang.String... tableNames) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
StorageServiceMBean
upgradeSSTables
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public int upgradeSSTables(java.lang.String keyspaceName, boolean excludeCurrentVersion, int jobs, java.lang.String... tableNames) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
upgradeSSTables
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public void forceKeyspaceCompaction(boolean splitOutput, java.lang.String keyspaceName, java.lang.String... tableNames) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
StorageServiceMBean
forceKeyspaceCompaction
in interface StorageServiceMBean
java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public void takeSnapshot(java.lang.String tag, java.lang.String... keyspaceNames) throws java.io.IOException
takeSnapshot
in interface StorageServiceMBean
tag
- the tag given to the snapshot; may not be null or emptykeyspaceNames
- the names of the keyspaces to snapshot; empty means "all."java.io.IOException
public void takeTableSnapshot(java.lang.String keyspaceName, java.lang.String tableName, java.lang.String tag) throws java.io.IOException
takeTableSnapshot
in interface StorageServiceMBean
keyspaceName
- the keyspace which holds the specified tabletableName
- the table to snapshottag
- the tag given to the snapshot; may not be null or emptyjava.io.IOException
public void takeMultipleTableSnapshot(java.lang.String tag, java.lang.String... tableList) throws java.io.IOException
takeMultipleTableSnapshot
in interface StorageServiceMBean
tag
- the tag given to the snapshot; may not be null or emptytableList
- list of tables from different keyspace in the form of ks1.cf1 ks2.cf2java.io.IOException
public void clearSnapshot(java.lang.String tag, java.lang.String... keyspaceNames) throws java.io.IOException
clearSnapshot
in interface StorageServiceMBean
java.io.IOException
public java.util.Map<java.lang.String,javax.management.openmbean.TabularData> getSnapshotDetails()
StorageServiceMBean
getSnapshotDetails
in interface StorageServiceMBean
public long trueSnapshotsSize()
StorageServiceMBean
trueSnapshotsSize
in interface StorageServiceMBean
public void refreshSizeEstimates() throws java.util.concurrent.ExecutionException
StorageServiceMBean
refreshSizeEstimates
in interface StorageServiceMBean
java.util.concurrent.ExecutionException
public 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.lang.IllegalArgumentException
- when given CF name does not existjava.io.IOException
public void forceKeyspaceFlush(java.lang.String keyspaceName, java.lang.String... tableNames) throws java.io.IOException
forceKeyspaceFlush
in interface StorageServiceMBean
keyspaceName
- tableNames
- java.io.IOException
public int repairAsync(java.lang.String keyspace, java.util.Map<java.lang.String,java.lang.String> repairSpec)
StorageServiceMBean
repairAsync
in interface StorageServiceMBean
keyspace
- Keyspace name to repair. Should not be null.repairSpec
- repair option.@Deprecated public int forceRepairAsync(java.lang.String keyspace, boolean isSequential, java.util.Collection<java.lang.String> dataCenters, java.util.Collection<java.lang.String> hosts, boolean primaryRange, boolean fullRepair, java.lang.String... tableNames)
forceRepairAsync
in interface StorageServiceMBean
@Deprecated public int forceRepairAsync(java.lang.String keyspace, int parallelismDegree, java.util.Collection<java.lang.String> dataCenters, java.util.Collection<java.lang.String> hosts, boolean primaryRange, boolean fullRepair, java.lang.String... tableNames)
StorageServiceMBean
forceRepairAsync
in interface StorageServiceMBean
parallelismDegree
- 0: sequential, 1: parallel, 2: DC parallel@Deprecated public int forceRepairAsync(java.lang.String keyspace, boolean isSequential, boolean isLocal, boolean primaryRange, boolean fullRepair, java.lang.String... tableNames)
forceRepairAsync
in interface StorageServiceMBean
@Deprecated 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, boolean fullRepair, java.lang.String... tableNames)
forceRepairRangeAsync
in interface StorageServiceMBean
@Deprecated public 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, boolean fullRepair, java.lang.String... tableNames)
StorageServiceMBean
forceRepairRangeAsync
in interface StorageServiceMBean
parallelismDegree
- 0: sequential, 1: parallel, 2: DC parallel@Deprecated public int forceRepairRangeAsync(java.lang.String beginToken, java.lang.String endToken, java.lang.String keyspaceName, boolean isSequential, boolean isLocal, boolean fullRepair, java.lang.String... tableNames)
forceRepairRangeAsync
in interface StorageServiceMBean
public Token.TokenFactory getTokenFactory()
public int forceRepairAsync(java.lang.String keyspace, RepairOption options, boolean legacy)
public void forceTerminateAllRepairSessions()
forceTerminateAllRepairSessions
in interface StorageServiceMBean
public 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
- Keyspace name to check primary rangesep
- endpoint we are interested in.public java.util.Collection<Range<Token>> getPrimaryRangeForEndpointWithinDC(java.lang.String keyspace, java.net.InetAddress referenceEndpoint)
keyspace
- Keyspace name to check primary rangesreferenceEndpoint
- endpoint we are interested in.getPrimaryRangesForEndpoint(String, java.net.InetAddress)
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 StorageServiceMBean
keyspaceName
- 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 StorageServiceMBean
public 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.lang.Iterable<java.net.InetAddress> getNaturalAndPendingEndpoints(java.lang.String keyspaceName, Token token)
public 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 setLoggingLevel(java.lang.String classQualifier, java.lang.String rawLevel) throws java.lang.Exception
StorageServiceMBean
setLoggingLevel
in interface StorageServiceMBean
classQualifier
- The logger's classQualiferrawLevel
- The log leveljava.lang.Exception
Level.toLevel(String)
public java.util.Map<java.lang.String,java.lang.String> getLoggingLevels()
StorageServiceMBean
getLoggingLevels
in interface StorageServiceMBean
public java.util.List<Pair<Range<Token>,java.lang.Long>> getSplits(java.lang.String keyspaceName, java.lang.String cfName, Range<Token> range, int keysPerSplit)
public void decommission() throws java.lang.InterruptedException
StorageServiceMBean
decommission
in interface StorageServiceMBean
java.lang.InterruptedException
public void move(java.lang.String newToken) throws java.io.IOException
move
in interface StorageServiceMBean
newToken
- token to move this node to.
This node will unload its data onto its neighbors, and bootstrap to the new token.java.io.IOException
public java.lang.String getRemovalStatus()
getRemovalStatus
in interface StorageServiceMBean
public void forceRemoveCompletion()
forceRemoveCompletion
in interface StorageServiceMBean
public void removeNode(java.lang.String hostIdString)
removeNode
in interface StorageServiceMBean
hostIdString
- token for the nodepublic void confirmReplication(java.net.InetAddress node)
public java.lang.String getOperationMode()
StorageServiceMBean
getOperationMode
in interface StorageServiceMBean
public boolean isStarting()
StorageServiceMBean
isStarting
in interface StorageServiceMBean
public boolean isMoving()
public boolean isJoining()
public java.lang.String getDrainProgress()
StorageServiceMBean
getDrainProgress
in interface StorageServiceMBean
public void drain() throws java.io.IOException, java.lang.InterruptedException, java.util.concurrent.ExecutionException
drain
in interface StorageServiceMBean
java.io.IOException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public IPartitioner setPartitionerUnsafe(IPartitioner newPartitioner)
public void truncate(java.lang.String keyspace, java.lang.String table) throws java.util.concurrent.TimeoutException, java.io.IOException
StorageServiceMBean
truncate
in interface StorageServiceMBean
keyspace
- The keyspace to delete fromtable
- The column family to delete data from.java.util.concurrent.TimeoutException
java.io.IOException
public java.util.Map<java.net.InetAddress,java.lang.Float> getOwnership()
StorageServiceMBean
getOwnership
in interface StorageServiceMBean
public java.util.LinkedHashMap<java.net.InetAddress,java.lang.Float> effectiveOwnership(java.lang.String keyspace) throws java.lang.IllegalStateException
effectiveOwnership
in interface StorageServiceMBean
java.lang.IllegalStateException
- when node is not configured properly.public java.util.List<java.lang.String> getKeyspaces()
getKeyspaces
in interface StorageServiceMBean
public java.util.List<java.lang.String> getNonSystemKeyspaces()
getNonSystemKeyspaces
in interface StorageServiceMBean
public java.util.List<java.lang.String> getNonLocalStrategyKeyspaces()
getNonLocalStrategyKeyspaces
in interface StorageServiceMBean
public 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
StorageServiceMBean
updateSnitch
in interface StorageServiceMBean
epSnitchClassName
- 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.ClassNotFoundException
public 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)
StorageServiceMBean
bulkLoad
in interface StorageServiceMBean
public java.lang.String bulkLoadAsync(java.lang.String directory)
StorageServiceMBean
bulkLoadAsync
in interface StorageServiceMBean
public void rescheduleFailedDeletions()
rescheduleFailedDeletions
in interface StorageServiceMBean
public void loadNewSSTables(java.lang.String ksName, java.lang.String cfName)
loadNewSSTables
in interface StorageServiceMBean
ksName
- The parent keyspace namepublic java.util.List<java.lang.String> sampleKeyRange()
sampleKeyRange
in interface StorageServiceMBean
public void rebuildSecondaryIndex(java.lang.String ksName, java.lang.String cfName, java.lang.String... idxNames)
StorageServiceMBean
rebuildSecondaryIndex
in interface StorageServiceMBean
public void resetLocalSchema() throws java.io.IOException
resetLocalSchema
in interface StorageServiceMBean
java.io.IOException
public void setTraceProbability(double probability)
StorageServiceMBean
setTraceProbability
in interface StorageServiceMBean
probability
- ]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 getTraceProbability()
StorageServiceMBean
getTraceProbability
in interface StorageServiceMBean
public void disableAutoCompaction(java.lang.String ks, java.lang.String... tables) throws java.io.IOException
disableAutoCompaction
in interface StorageServiceMBean
java.io.IOException
public void enableAutoCompaction(java.lang.String ks, java.lang.String... tables) throws java.io.IOException
enableAutoCompaction
in interface StorageServiceMBean
java.io.IOException
public java.lang.String getClusterName()
getClusterName
in interface StorageServiceMBean
public java.lang.String getPartitionerName()
getPartitionerName
in interface StorageServiceMBean
public int getTombstoneWarnThreshold()
StorageServiceMBean
getTombstoneWarnThreshold
in interface StorageServiceMBean
public void setTombstoneWarnThreshold(int threshold)
StorageServiceMBean
setTombstoneWarnThreshold
in interface StorageServiceMBean
public int getTombstoneFailureThreshold()
StorageServiceMBean
getTombstoneFailureThreshold
in interface StorageServiceMBean
public void setTombstoneFailureThreshold(int threshold)
StorageServiceMBean
setTombstoneFailureThreshold
in interface StorageServiceMBean
public int getBatchSizeFailureThreshold()
StorageServiceMBean
getBatchSizeFailureThreshold
in interface StorageServiceMBean
public void setBatchSizeFailureThreshold(int threshold)
StorageServiceMBean
setBatchSizeFailureThreshold
in interface StorageServiceMBean
public void setHintedHandoffThrottleInKB(int throttleInKB)
StorageServiceMBean
setHintedHandoffThrottleInKB
in interface StorageServiceMBean
Copyright © 2016 The Apache Software Foundation