|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.service.StorageService
public final class StorageService
Nested Class Summary | |
---|---|
static class |
StorageService.BootstrapInitiateDoneVerbHandler
|
Field Summary | |
---|---|
static java.lang.String |
binaryVerbHandler_
|
static java.lang.String |
bootStrapInitiateDoneVerbHandler_
|
static java.lang.String |
bootStrapInitiateVerbHandler_
|
static java.lang.String |
bootStrapTerminateVerbHandler_
|
static java.lang.String |
bsMetadataVerbHandler_
|
static java.lang.String |
dataFileVerbHandler_
|
static java.lang.String |
mbrshipCleanerVerbHandler_
|
static java.lang.String |
mutationStage_
|
static java.lang.String |
mutationVerbHandler_
|
static java.lang.String |
rangeVerbHandler_
|
static java.lang.String |
readRepairVerbHandler_
|
static java.lang.String |
readStage_
|
static java.lang.String |
readVerbHandler_
|
static java.lang.String |
tokenVerbHandler_
|
Constructor Summary | |
---|---|
StorageService(boolean isBootstrapMode)
|
Method Summary | |
---|---|
void |
addBootstrapSource(EndPoint s)
|
void |
clearSnapshot()
Remove all the existing snapshots. |
java.util.Map<EndPoint,java.util.List<Range>> |
constructEndPointToRangesMap()
Construct a mapping from endpoint to ranges that endpoint is responsible for. |
java.util.Map<Range,java.util.List<EndPoint>> |
constructRangeToEndPointMap(Range[] ranges)
Construct the range to endpoint mapping based on the true view of the world. |
java.util.Map<Range,java.util.List<EndPoint>> |
constructRangeToEndPointMap(Range[] ranges,
java.util.Map<Token,EndPoint> tokenToEndPointMap)
Construct the range to endpoint mapping based on the view as dictated by the mapping of token to endpoints passed in. |
void |
deliverHints(EndPoint endpoint)
Deliver hints to the specified node when it has crashed and come back up/ marked as alive after a network partition |
void |
doBootstrap(EndPoint endpoint,
Token token)
Starts the bootstrap operations for the specified endpoint. |
void |
doConsistencyCheck(Row row,
java.util.List<EndPoint> endpoints,
ReadCommand command)
|
EndPoint |
findSuitableEndPoint(java.lang.String key)
This function finds the most suitable endpoint given a key. |
void |
forceHandoff(java.util.List<java.lang.String> dataDirectories,
java.lang.String host)
Stream the files in the bootstrap directory over to the node being bootstrapped. |
void |
forceTableCleanup()
|
void |
forceTableCompaction()
Trigger the immediate compaction of all tables. |
void |
forceTableFlush(java.lang.String tableName,
java.lang.String... columnFamilies)
Flush all memtables for a table and column families. |
Range[] |
getAllRanges()
Get all ranges that span the ring as per current snapshot of the token distribution. |
Range[] |
getAllRanges(java.util.Set<Token> tokens)
Get all ranges that span the ring given a set of tokens. |
int |
getCurrentGenerationNumber()
|
IEndPointSnitch |
getEndPointSnitch()
|
java.util.Map<EndPoint,EndPoint> |
getHintedStorageEndpointMap(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 |
getLiveNodes()
|
java.util.List<EndPoint> |
getLiveReadStorageEndPoints(java.lang.String key)
This method attempts to return N endpoints that are responsible for storing the specified key i.e for replication. |
java.lang.String |
getLoadInfo()
Get the count of primary keys from the sampler. |
java.lang.String |
getLoadInfo(EndPoint ep)
Get the primary count info for this endpoint. |
static EndPoint |
getLocalControlEndPoint()
|
static EndPoint |
getLocalStorageEndPoint()
|
static IPartitioner |
getPartitioner()
|
EndPoint |
getPrimary(java.lang.String key)
This method returns the endpoint that is responsible for storing the specified key. |
Range |
getPrimaryRangeForEndPoint(EndPoint ep)
Get the primary range for the specified endpoint. |
java.util.Map<Range,java.util.List<EndPoint>> |
getRangeToEndPointMap()
|
EndPoint[] |
getReadStorageEndPoints(java.lang.String key)
This method returns the N endpoints that are responsible for storing the specified key i.e for replication. |
EndPoint |
getSuccessor(EndPoint ep)
|
java.lang.String |
getToken()
|
java.lang.String |
getToken(EndPoint ep)
|
TokenMetadata |
getTokenMetadata()
|
java.lang.String |
getUnreachableNodes()
|
static StorageService |
instance()
|
boolean |
isBootstrapMode()
|
boolean |
isInSameDataCenter(EndPoint endpoint)
|
boolean |
isPrimary(java.lang.String key)
This method determines whether the local endpoint is the primary for the given key. |
void |
loadAll(java.lang.String nodes)
This method will cause the local node initiate the bootstrap process for all the nodes specified in the string parameter passed in. |
void |
onChange(EndPoint endpoint,
EndPointState epState)
Called when there is a change in application state. |
void |
relocate(java.lang.String[] keys)
|
boolean |
removeBootstrapSource(EndPoint s)
|
void |
removeTokenState(EndPoint endpoint)
|
void |
setLog4jLevel(java.lang.String classQualifier,
java.lang.String rawLevel)
set the logging level at runtime |
void |
start()
|
void |
takeAllSnapshot(java.lang.String tag)
Takes a snapshot for every table. |
void |
takeSnapshot(java.lang.String tableName,
java.lang.String tag)
Takes the snapshot for a given table. |
void |
updateToken(Token token)
|
void |
updateTokenMetadata(Token token,
EndPoint endpoint,
boolean bs)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String mutationStage_
public static final java.lang.String readStage_
public static final java.lang.String mutationVerbHandler_
public static final java.lang.String tokenVerbHandler_
public static final java.lang.String binaryVerbHandler_
public static final java.lang.String readRepairVerbHandler_
public static final java.lang.String readVerbHandler_
public static final java.lang.String bootStrapInitiateVerbHandler_
public static final java.lang.String bootStrapInitiateDoneVerbHandler_
public static final java.lang.String bootStrapTerminateVerbHandler_
public static final java.lang.String dataFileVerbHandler_
public static final java.lang.String mbrshipCleanerVerbHandler_
public static final java.lang.String bsMetadataVerbHandler_
public static final java.lang.String rangeVerbHandler_
Constructor Detail |
---|
public StorageService(boolean isBootstrapMode)
Method Detail |
---|
public static EndPoint getLocalStorageEndPoint()
public static EndPoint getLocalControlEndPoint()
public static IPartitioner getPartitioner()
public static StorageService instance()
public void addBootstrapSource(EndPoint s)
public boolean removeBootstrapSource(EndPoint s)
public void start() throws java.io.IOException
java.io.IOException
public boolean isBootstrapMode()
public TokenMetadata getTokenMetadata()
public void updateTokenMetadata(Token token, EndPoint endpoint, boolean bs)
public IEndPointSnitch getEndPointSnitch()
public boolean isInSameDataCenter(EndPoint endpoint) throws java.io.IOException
java.io.IOException
public void doConsistencyCheck(Row row, java.util.List<EndPoint> endpoints, ReadCommand command)
public java.util.Map<Range,java.util.List<EndPoint>> getRangeToEndPointMap()
getRangeToEndPointMap
in interface StorageServiceMBean
public java.util.Map<Range,java.util.List<EndPoint>> constructRangeToEndPointMap(Range[] ranges)
ranges
-
public java.util.Map<Range,java.util.List<EndPoint>> constructRangeToEndPointMap(Range[] ranges, java.util.Map<Token,EndPoint> tokenToEndPointMap)
ranges
- tokenToEndPointMap
- mapping of token to endpoints.
public java.util.Map<EndPoint,java.util.List<Range>> constructEndPointToRangesMap()
public void onChange(EndPoint endpoint, EndPointState epState)
onChange
in interface IEndPointStateChangeSubscriber
endpoint
- endpoint for which the state change occurred.epState
- state that actually changed for the above endpoint.public java.lang.String getLoadInfo()
getLoadInfo
in interface StorageServiceMBean
public java.lang.String getLoadInfo(EndPoint ep)
public void updateToken(Token token) throws java.io.IOException
java.io.IOException
public void removeTokenState(EndPoint endpoint)
public void relocate(java.lang.String[] keys) throws java.io.IOException
java.io.IOException
public final void doBootstrap(EndPoint endpoint, Token token)
endpoint
- public final void deliverHints(EndPoint endpoint)
public java.lang.String getToken(EndPoint ep)
public java.lang.String getToken()
getToken
in interface StorageServiceMBean
public java.lang.String getLiveNodes()
getLiveNodes
in interface StorageServiceMBean
public java.lang.String getUnreachableNodes()
getUnreachableNodes
in interface StorageServiceMBean
public int getCurrentGenerationNumber()
getCurrentGenerationNumber
in interface StorageServiceMBean
public void loadAll(java.lang.String nodes) throws java.net.UnknownHostException
StorageServiceMBean
loadAll
in interface StorageServiceMBean
nodes
- colon delimited list of endpoints that need
to be bootstrapped
java.net.UnknownHostException
public void forceTableCleanup() throws java.io.IOException
forceTableCleanup
in interface StorageServiceMBean
java.io.IOException
public void forceTableCompaction() throws java.io.IOException
forceTableCompaction
in interface StorageServiceMBean
java.io.IOException
public void forceHandoff(java.util.List<java.lang.String> dataDirectories, java.lang.String host) throws java.io.IOException
StorageServiceMBean
forceHandoff
in interface StorageServiceMBean
dataDirectories
- colon separated list of directories from where
files need to be picked up.host
- endpoint receiving data.
java.io.IOException
public void takeSnapshot(java.lang.String tableName, java.lang.String tag) throws java.io.IOException
takeSnapshot
in interface StorageServiceMBean
tableName
- the name of the table.tag
- the tag given to the snapshot (null is permissible)
java.io.IOException
public void takeAllSnapshot(java.lang.String tag) throws java.io.IOException
takeAllSnapshot
in interface StorageServiceMBean
tag
- the tag given to the snapshot (null is permissible)
java.io.IOException
public void clearSnapshot() throws java.io.IOException
clearSnapshot
in interface StorageServiceMBean
java.io.IOException
public void forceTableFlush(java.lang.String tableName, java.lang.String... columnFamilies) throws java.io.IOException
forceTableFlush
in interface StorageServiceMBean
tableName
- columnFamilies
-
java.io.IOException
public EndPoint getSuccessor(EndPoint ep)
public Range getPrimaryRangeForEndPoint(EndPoint ep)
ep
- endpoint we are interested in.
public Range[] getAllRanges()
public Range[] getAllRanges(java.util.Set<Token> tokens)
public EndPoint getPrimary(java.lang.String key)
key
- - key for which we need to find the endpoint
public boolean isPrimary(java.lang.String key)
key
-
public EndPoint[] getReadStorageEndPoints(java.lang.String key)
key
- - key for which we need to find the endpoint return value -
the endpoint responsible for this keypublic java.util.List<EndPoint> getLiveReadStorageEndPoints(java.lang.String key)
key
- - key for which we need to find the endpoint return value -
the endpoint responsible for this keypublic java.util.Map<EndPoint,EndPoint> getHintedStorageEndpointMap(java.lang.String key)
key
- - key for which we need to find the endpoint return value -
the endpoint responsible for this keypublic EndPoint findSuitableEndPoint(java.lang.String key) throws java.io.IOException, org.apache.cassandra.service.UnavailableException
java.io.IOException
org.apache.cassandra.service.UnavailableException
public void setLog4jLevel(java.lang.String classQualifier, java.lang.String rawLevel)
StorageServiceMBean
setLog4jLevel
in interface StorageServiceMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |