|
||||||||||
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
|
static class |
StorageService.ConsistencyLevel
|
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 |
calloutDeployVerbHandler_
|
static java.lang.String |
dataFileVerbHandler_
|
static java.lang.String |
loadVerbHandler_
|
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()
|
Method Summary | |
---|---|
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)
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. |
java.util.Map<java.lang.String,EndPoint> |
findSuitableEndPoints(java.lang.String[] keys)
|
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. |
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.lang.String |
getLiveNodes()
|
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()
|
java.util.List<EndPoint> |
getNLiveStorageEndPoint(java.lang.String key)
This method attempts to return N endpoints that are responsible for storing the specified key i.e for replication. |
EndPoint[] |
getNStorageEndPoint(java.lang.String key)
This method returns the N endpoints that are responsible for storing the specified key i.e for replication. |
EndPoint[] |
getNStorageEndPoint(Token token)
This method returns the N endpoints that are responsible for storing the specified token i.e for replication. |
protected EndPoint[] |
getNStorageEndPoint(Token token,
java.util.Map<Token,EndPoint> tokenToEndPointMap)
This method returns the N endpoints that are responsible for storing the specified token i.e for replication and are based on the token to endpoint mapping that is passed in. |
java.util.Map<EndPoint,EndPoint> |
getNStorageEndPointMap(java.lang.String key)
This method returns the N endpoints that are responsible for storing the specified key i.e for replication. |
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 |
getSuccessor(EndPoint ep)
|
java.lang.String |
getToken()
|
java.lang.String |
getToken(EndPoint ep)
|
TokenMetadata |
getTokenMetadata()
|
java.lang.String |
getUnreachableNodes()
|
static StorageService |
instance()
|
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)
|
void |
removeTokenState(EndPoint endpoint)
|
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)
|
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 loadVerbHandler_
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 calloutDeployVerbHandler_
public static final java.lang.String rangeVerbHandler_
Constructor Detail |
---|
public StorageService()
Method Detail |
---|
public static EndPoint getLocalStorageEndPoint()
public static EndPoint getLocalControlEndPoint()
public static IPartitioner getPartitioner()
public static StorageService instance()
public void start() throws java.io.IOException
java.io.IOException
public TokenMetadata getTokenMetadata()
public void updateTokenMetadata(Token token, EndPoint endpoint)
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)
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 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[] getNStorageEndPoint(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> getNLiveStorageEndPoint(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> getNStorageEndPointMap(java.lang.String key)
key
- - key for which we need to find the endpoint return value -
the endpoint responsible for this keypublic EndPoint[] getNStorageEndPoint(Token token)
token
- - position on the ringprotected EndPoint[] getNStorageEndPoint(Token token, java.util.Map<Token,EndPoint> tokenToEndPointMap)
token
- - position on the ringtokens
- - w/o the following tokens in the token listpublic EndPoint findSuitableEndPoint(java.lang.String key) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,EndPoint> findSuitableEndPoints(java.lang.String[] keys) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |