|
||||||||||
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.BootstrapMode
|
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 |
mrStage_
|
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 | |
---|---|
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 |
doBootstrap(EndPoint endpoint,
StorageService.BootstrapMode mode)
Starts the bootstrap operations for the specified endpoint. |
void |
doConsistencyCheck(Row row,
java.util.List<EndPoint> endpoints,
ReadCommand command)
|
void |
doGC()
|
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.lang.String directories,
java.lang.String host)
Stream the files in the bootstrap directory over to the node being bootstrapped. |
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. |
IEndPointSnitch |
getEndPointSnitch()
|
static java.lang.String |
getHostUrl()
|
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()
|
protected org.apache.zookeeper.ZooKeeper |
getZooKeeperHandle()
|
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. |
boolean |
isShutdown()
|
void |
killMe()
|
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 |
registerComponentForShutdown(IComponentShutdown component)
|
void |
relocate(java.lang.String[] keys)
|
void |
removeTokenState(EndPoint endpoint)
|
void |
shutdown()
|
void |
start()
|
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 mrStage_
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 java.lang.String rangeVerbHandler_
Constructor Detail |
---|
public StorageService()
Method Detail |
---|
public static EndPoint getLocalStorageEndPoint()
public static EndPoint getLocalControlEndPoint()
public static java.lang.String getHostUrl()
public static IPartitioner getPartitioner()
public static StorageService instance()
protected org.apache.zookeeper.ZooKeeper getZooKeeperHandle()
public void registerComponentForShutdown(IComponentShutdown component)
public void start() throws java.io.IOException
java.io.IOException
public void killMe() throws java.lang.Throwable
java.lang.Throwable
public boolean isShutdown()
public void shutdown()
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()
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 occured.epState
- state that actually changed for the above endpoint.public java.lang.String getLoadInfo()
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, StorageService.BootstrapMode mode)
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 void loadAll(java.lang.String nodes)
StorageServiceMBean
loadAll
in interface StorageServiceMBean
nodes
- colon delimited list of endpoints that need
to be bootstrappedpublic void doGC()
doGC
in interface StorageServiceMBean
public void forceHandoff(java.lang.String directories, java.lang.String host) throws java.io.IOException
StorageServiceMBean
forceHandoff
in interface StorageServiceMBean
host
- endpoint receiving data.
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)
public boolean isPrimary(java.lang.String key)
key
-
public EndPoint[] getNStorageEndPoint(java.lang.String key)
public java.util.List<EndPoint> getNLiveStorageEndPoint(java.lang.String key)
public java.util.Map<EndPoint,EndPoint> getNStorageEndPointMap(java.lang.String key)
public EndPoint[] getNStorageEndPoint(Token token)
protected EndPoint[] getNStorageEndPoint(Token token, java.util.Map<Token,EndPoint> tokenToEndPointMap)
public 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 |