|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvoldemort.client.protocol.admin.AdminClient
public class AdminClient
AdminClient is intended for administrative functionality that is useful and often needed, but should be used sparingly (if at all) at the application level.
Some of the uses of AdminClient include
| Field Summary | |
|---|---|
static java.util.List<java.lang.String> |
restoreStoreEngineBlackList
|
| Constructor Summary | |
|---|---|
AdminClient(Cluster cluster,
AdminClientConfig adminClientConfig)
Create an instance of AdminClient given a Cluster object. |
|
AdminClient(java.lang.String bootstrapURL,
AdminClientConfig adminClientConfig)
Create an instance of AdminClient given a URL of a node in the cluster. |
|
| Method Summary | |
|---|---|
void |
addStore(StoreDefinition def)
Add a new store definition to all active nodes in the cluster. |
void |
addStore(StoreDefinition def,
int nodeId)
Add a new store definition to a particular node |
long |
deletePartitions(int nodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
Cluster initialCluster,
VoldemortFilter filter)
Delete all entries belonging to all the partitions passed as a map of replica_type to partition list. |
long |
deletePartitions(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter)
Delete all entries belonging to a list of partitions |
void |
deleteStore(java.lang.String storeName)
Delete a store from all active nodes in the cluster |
void |
deleteStore(java.lang.String storeName,
int nodeId)
Delete a store from a particular node |
void |
failedFetchStore(int nodeId,
java.lang.String storeName,
java.lang.String storeDir)
When a fetch store fails, we don't need to keep the pushed data around. |
java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> |
fetchEntries(int nodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
Cluster initialCluster,
long skipRecords)
Fetch key/value tuples belonging to this map of replica type to partition list |
java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> |
fetchEntries(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries)
Legacy interface for fetching entries. |
java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> |
fetchEntries(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
long skipRecords)
Legacy interface for fetching entries. |
java.util.Iterator<ByteArray> |
fetchKeys(int nodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
Cluster initialCluster,
long skipRecords)
Fetch all keys belonging to the map of replica type to partition list. |
java.util.Iterator<ByteArray> |
fetchKeys(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries)
Legacy interface for fetching entries. |
java.util.Iterator<ByteArray> |
fetchKeys(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
long skipRecords)
Legacy interface for fetching entries. |
void |
fetchPartitionFiles(int nodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
java.lang.String destinationDirPath,
java.util.Set<java.lang.Object> notAcceptedBuckets,
java.util.concurrent.atomic.AtomicBoolean running)
Fetch read-only store files to a specified directory. |
java.lang.String |
fetchStore(int nodeId,
java.lang.String storeName,
java.lang.String storeDir,
long pushVersion,
long timeoutMs)
Fetch data from directory 'storeDir' on node id |
Cluster |
getAdminClientCluster()
Get the cluster info AdminClient is using. |
java.util.List<java.lang.Integer> |
getAsyncRequestList(int nodeId)
Retrieves a list of asynchronous request ids on the server. |
java.util.List<java.lang.Integer> |
getAsyncRequestList(int nodeId,
boolean showComplete)
Retrieves a list of asynchronous request ids on the server. |
AsyncOperationStatus |
getAsyncRequestStatus(int nodeId,
int requestId)
Get the status of an Async Operation running at (remote) node. |
Versioned<Cluster> |
getRemoteCluster(int nodeId)
Get the cluster information from a remote node. |
Versioned<java.lang.String> |
getRemoteMetadata(int remoteNodeId,
java.lang.String key)
Get the metadata on a remote node. |
Versioned<MetadataStore.VoldemortState> |
getRemoteServerState(int nodeId)
Retrieve the server state from
a remote node. |
Versioned<java.util.List<StoreDefinition>> |
getRemoteStoreDefList(int nodeId)
Retrieve the store definitions from a remote node. |
java.util.Map<java.lang.Integer,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> |
getReplicationMapping(int restoringNode,
Cluster cluster,
StoreDefinition storeDef)
For a particular node, finds out all the [replica, partition] tuples it needs to steal in order to be brought back to normal state |
java.util.Map<java.lang.String,java.lang.Long> |
getROCurrentVersion(int nodeId,
java.util.List<java.lang.String> storeNames)
Returns the 'current' version of RO store |
java.util.Map<java.lang.String,java.lang.String> |
getROCurrentVersionDir(int nodeId,
java.util.List<java.lang.String> storeNames)
Returns the 'current' versions of all RO stores provided |
java.util.Map<java.lang.String,java.lang.Long> |
getROMaxVersion(int nodeId,
java.util.List<java.lang.String> storeNames)
Returns the max version of push currently being used by read-only store. |
java.util.Map<java.lang.String,java.lang.Long> |
getROMaxVersion(java.util.List<java.lang.String> storeNames)
This is a wrapper around getROMaxVersion(int, List)
where-in we find the max versions on each machine and then return the max
of all of them |
java.util.Map<java.lang.String,java.lang.String> |
getROMaxVersionDir(int nodeId,
java.util.List<java.lang.String> storeNames)
Returns the max version of push currently being used by read-only store. |
java.util.Map<java.lang.String,java.lang.String> |
getROStorageFormat(int nodeId,
java.util.List<java.lang.String> storeNames)
Returns the read-only storage format - ReadOnlyStorageFormat for
a list of stores |
int |
migratePartitions(int donorNodeId,
int stealerNodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
VoldemortFilter filter,
Cluster initialCluster,
boolean optimize)
Migrate keys/values belonging to a map of replica type to partition list from donor node to stealer node. |
int |
migratePartitions(int donorNodeId,
int stealerNodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> stealPartitionList,
VoldemortFilter filter)
Migrate keys/values belonging to stealPartitionList ( can be primary or replica ) from donor node to stealer node. |
int |
rebalanceNode(RebalancePartitionsInfo stealInfo)
Rebalance a stealer-donor node pair for a set of stores |
void |
rebalanceStateChange(Cluster existingCluster,
Cluster transitionCluster,
java.util.List<RebalancePartitionsInfo> rebalancePartitionPlanList,
boolean swapRO,
boolean changeClusterMetadata,
boolean changeRebalanceState,
boolean rollback,
boolean failEarly)
Used in rebalancing to indicate change in states. |
void |
restoreDataFromReplications(int nodeId,
int parallelTransfers)
RestoreData from copies on other machines for the given nodeId |
void |
rollbackStore(int nodeId,
java.lang.String storeName,
long pushVersion)
Rollback RO store to most recent backup of the current store |
void |
setAdminClientCluster(Cluster cluster)
Set cluster info for AdminClient to use. |
void |
stop()
Stop the AdminClient cleanly freeing all resources. |
void |
stopAsyncRequest(int nodeId,
int requestId)
To stop an asynchronous request on the particular node |
java.lang.String |
swapStore(int nodeId,
java.lang.String storeName,
java.lang.String storeDir)
Swap store data atomically on a single node |
void |
throwException(VProto.Error error)
|
void |
truncate(int nodeId,
java.lang.String storeName)
Delete the store completely (Deletes all data) from the remote node. |
void |
updateEntries(int nodeId,
java.lang.String storeName,
java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> entryIterator,
VoldemortFilter filter)
Update a stream of key/value entries at the given node. |
void |
updateRemoteCluster(int nodeId,
Cluster cluster,
Version clock)
Update the cluster information MetadataStore.CLUSTER_KEY on a
remote node. |
void |
updateRemoteMetadata(int remoteNodeId,
java.lang.String key,
Versioned<java.lang.String> value)
Update metadata at the given remoteNodeId. |
void |
updateRemoteServerState(int nodeId,
MetadataStore.VoldemortState state,
Version clock)
Update the server state ( MetadataStore.VoldemortState) on a
remote node. |
void |
updateRemoteStoreDefList(int nodeId,
java.util.List<StoreDefinition> storesList)
Update the store definitions on a remote node. |
void |
updateSlopEntries(int nodeId,
java.util.Iterator<Versioned<Slop>> entryIterator)
Update slops which may be meant for multiple stores |
java.lang.String |
waitForCompletion(int nodeId,
int requestId,
long maxWait,
java.util.concurrent.TimeUnit timeUnit)
Wait for async task at (remote) nodeId to finish completion, using exponential backoff to poll the task completion status. |
java.lang.String |
waitForCompletion(int nodeId,
int requestId,
long maxWait,
java.util.concurrent.TimeUnit timeUnit,
AsyncOperationStatus higherStatus)
Wait for async task at (remote) nodeId to finish completion, using exponential backoff to poll the task completion status. |
void |
waitForCompletion(int nodeId,
java.lang.String key,
java.lang.String value,
long maxWait,
java.util.concurrent.TimeUnit timeUnit)
Wait till the passed value matches with the metadata value returned by the remote node for the passed key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.List<java.lang.String> restoreStoreEngineBlackList
| Constructor Detail |
|---|
public AdminClient(java.lang.String bootstrapURL,
AdminClientConfig adminClientConfig)
bootstrapURL - URL pointing to the bootstrap nodeadminClientConfig - Configuration for AdminClient specifying client
parameters eg.
public AdminClient(Cluster cluster,
AdminClientConfig adminClientConfig)
Cluster object.
cluster - Initialized cluster object, describing the nodes we wish
to contactadminClientConfig - Configuration for AdminClient specifying client
parameters eg. | Method Detail |
|---|
public void updateEntries(int nodeId,
java.lang.String storeName,
java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> entryIterator,
VoldemortFilter filter)
VoldemortFilter instance.
VoldemortException has occured.
nodeId - Id of the remote node (where we wish to update the entries)storeName - Store name for the entriesentryIterator - Iterator of key-value pairs for the entriesfilter - Custom filter implementation to filter out entries which
should not be updated.
VoldemortException
public java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> fetchEntries(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
long skipRecords)
fetchEntries(int, String, HashMap, VoldemortFilter, boolean, Cluster, long)
for more information.
nodeId - Id of the node to fetch fromstoreName - Name of the storepartitionList - List of the partitionsfilter - Custom filter implementation to filter out entries which
should not be fetched.fetchMasterEntries - Fetch an entry only if master replicaskipRecords - Number of records to skip
public java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> fetchEntries(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries)
fetchEntries(int, String, HashMap, VoldemortFilter, boolean, Cluster, long)
for more information.
nodeId - Id of the node to fetch fromstoreName - Name of the storepartitionList - List of the partitionsfilter - Custom filter implementation to filter out entries which
should not be fetched.fetchMasterEntries - Fetch an entry only if master replica
public java.util.Iterator<Pair<ByteArray,Versioned<byte[]>>> fetchEntries(int nodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
Cluster initialCluster,
long skipRecords)
Streaming API - The server keeps sending the messages as it's
iterating over the data. Once iteration has finished, the server sends an
"end of stream" marker and flushes its buffer. A response indicating a
VoldemortException may be sent at any time during the process.
Entries are being streamed as the iteration happens i.e. the whole result set is not buffered in memory.
nodeId - Id of the node to fetch fromstoreName - Name of the storereplicaToPartitionList - Mapping of replica type to partition listfilter - Custom filter implementation to filter out entries which
should not be fetched.fetchMasterEntries - Fetch an entry only if master replicainitialCluster - The cluster metadata to use while making the
decision to fetch entries. This is important during rebalancing
where-in we want to fetch keys using an older metadata compared to
the new one.skipRecords - Number of records to skip
public java.util.Iterator<ByteArray> fetchKeys(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
long skipRecords)
fetchKeys(int, String, HashMap, VoldemortFilter, boolean, Cluster, long)
for more information.
nodeId - Id of the node to fetch fromstoreName - Name of the storepartitionList - List of the partitions to retrievefilter - Custom filter implementation to filter out entries which
should not be fetched.fetchMasterEntries - Fetch a key only if master replicaskipRecords - Number of keys to skip
public java.util.Iterator<ByteArray> fetchKeys(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter,
boolean fetchMasterEntries)
fetchKeys(int, String, HashMap, VoldemortFilter, boolean, Cluster, long)
for more information.
nodeId - Id of the node to fetch fromstoreName - Name of the storepartitionList - List of the partitions to retrievefilter - Custom filter implementation to filter out entries which
should not be fetched.fetchMasterEntries - Fetch a key only if master replica
public java.util.Iterator<ByteArray> fetchKeys(int nodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
VoldemortFilter filter,
boolean fetchMasterEntries,
Cluster initialCluster,
long skipRecords)
fetchEntries(int, java.lang.String, java.util.List, voldemort.client.protocol.VoldemortFilter, boolean, long) but
only fetches the keys
nodeId - The node id from where to fetch the keysstoreName - The store name whose keys we want to retrievereplicaToPartitionList - Map of replica type to corresponding
partition listfilter - Custom filterinitialCluster - Cluster to use for selecting a key. If null, use
the default metadata from the metadata storeskipRecords - Number of records to skip [ Used for sampling ]
public void restoreDataFromReplications(int nodeId,
int parallelTransfers)
Recovery mechanism to recover and restore data actively from replicated
copies in the cluster.
nodeId - Id of the node to restoreDataparallelTransfers - number of transfers
java.lang.InterruptedException
public java.util.Map<java.lang.Integer,java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>>> getReplicationMapping(int restoringNode,
Cluster cluster,
StoreDefinition storeDef)
restoringNode - The id of the node which needs to be restoredcluster - The cluster definitionstoreDef - The store definition to use
public int rebalanceNode(RebalancePartitionsInfo stealInfo)
stealInfo - Partition steal information
public int migratePartitions(int donorNodeId,
int stealerNodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> stealPartitionList,
VoldemortFilter filter)
See
migratePartitions(int, int, String, HashMap, VoldemortFilter, Cluster, boolean)
for more details.
donorNodeId - Node from which the partitions are to be
streamed.stealerNodeId - Node to which the partitions are to be
streamed.storeName - Name of the store to stream.stealPartitionList - List of partitions to stream.filter - Custom filter implementation to filter out entries which
should not be deleted.
AsyncOperation created on
stealerNodeId which is performing the operation.
public int migratePartitions(int donorNodeId,
int stealerNodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
VoldemortFilter filter,
Cluster initialCluster,
boolean optimize)
This is a background operation (see
AsyncOperation that runs on the
stealer node where updates are performed.
donorNodeId - Node from which the partitions are to be
streamed.stealerNodeId - Node to which the partitions are to be
streamed.storeName - Name of the store to stream.replicaToPartitionList - Mapping from replica type to partition to
be stolenfilter - Voldemort post-filterinitialCluster - The cluster metadata to use for making the decision
if the key belongs to these partitions. If not specified, falls
back to the metadata stored on the boxoptimize - We can run an optimization at this level where-in we try
avoid copying of data which already exists ( in the form of a
replica ). We do need to disable this when we're trying to recover
a node which was completely damaged ( restore from replica ).
AsyncOperation created on
stealer node which is performing the operation.
public void truncate(int nodeId,
java.lang.String storeName)
nodeId - The node id on which the store is presentstoreName - The name of the store
public AsyncOperationStatus getAsyncRequestStatus(int nodeId,
int requestId)
nodeId - Id on which the operation is runningrequestId - Id of the operation itself
public java.util.List<java.lang.Integer> getAsyncRequestList(int nodeId)
nodeId - The id of the node whose request ids we want
public java.util.List<java.lang.Integer> getAsyncRequestList(int nodeId,
boolean showComplete)
nodeId - The id of the node whose request ids we wantshowComplete - Boolean to indicate if we want to include the
completed requests as well
public void stopAsyncRequest(int nodeId,
int requestId)
nodeId - The id of the node on which the request is runningrequestId - The id of the request to terminate
public long deletePartitions(int nodeId,
java.lang.String storeName,
java.util.List<java.lang.Integer> partitionList,
VoldemortFilter filter)
nodeId - Node on which the entries to be deletedstoreName - Name of the store holding the entriespartitionList - List of partitions to delete.filter - Custom filter implementation to filter out entries which
should not be deleted.
public long deletePartitions(int nodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
Cluster initialCluster,
VoldemortFilter filter)
nodeId - Node on which the entries to be deletedstoreName - Name of the store holding the entriesreplicaToPartitionList - Map of replica type to partition listfilter - Custom filter implementation to filter out entries which
should not be deleted.
public void throwException(VProto.Error error)
public void stop()
public java.lang.String waitForCompletion(int nodeId,
int requestId,
long maxWait,
java.util.concurrent.TimeUnit timeUnit,
AsyncOperationStatus higherStatus)
Logs the status at each status check if debug is enabled.
nodeId - Id of the node to pollrequestId - Id of the request to checkmaxWait - Maximum time we'll keep checking a request until we give
uptimeUnit - Unit in which maxWait is expressed.higherStatus - A higher level async operation object. If this
waiting is being run another async operation this helps us
propagate the status all the way up.
VoldemortException - if task failed to finish in specified maxWait
time.
public java.lang.String waitForCompletion(int nodeId,
int requestId,
long maxWait,
java.util.concurrent.TimeUnit timeUnit)
Logs the status at each status check if debug is enabled.
nodeId - Id of the node to pollrequestId - Id of the request to checkmaxWait - Maximum time we'll keep checking a request until we give
uptimeUnit - Unit in which maxWait is expressed.
VoldemortException - if task failed to finish in specified maxWait
time.
public void waitForCompletion(int nodeId,
java.lang.String key,
java.lang.String value,
long maxWait,
java.util.concurrent.TimeUnit timeUnit)
Logs the status at each status check if debug is enabled.
nodeId - Id of the node to pollkey - metadata key to keep checking for current valuevalue - metadata value should match for exit criteria.maxWait - Maximum time we'll keep checking a request until we give
uptimeUnit - Unit in which maxWait is expressed.
public void updateRemoteMetadata(int remoteNodeId,
java.lang.String key,
Versioned<java.lang.String> value)
Metadata keys can be one of MetadataStore.METADATA_KEYS
eg.
MetadataStore for more information.
remoteNodeId - Id of the nodekey - Metadata key to updatevalue - Value for the metadata key
public Versioned<java.lang.String> getRemoteMetadata(int remoteNodeId,
java.lang.String key)
Metadata keys can be one of MetadataStore.METADATA_KEYS
eg.
MetadataStore for more information.
remoteNodeId - Id of the nodekey - Metadata key to update
Version
public void updateRemoteCluster(int nodeId,
Cluster cluster,
Version clock)
throws VoldemortException
MetadataStore.CLUSTER_KEY on a
remote node.
nodeId - Id of the remote nodecluster - The new cluster object
VoldemortException
public Versioned<Cluster> getRemoteCluster(int nodeId)
throws VoldemortException
nodeId - Node to retrieve information from
Version
VoldemortException
public void updateRemoteStoreDefList(int nodeId,
java.util.List<StoreDefinition> storesList)
throws VoldemortException
nodeId - The node id of the machinestoresList - The new store list
VoldemortException
public Versioned<java.util.List<StoreDefinition>> getRemoteStoreDefList(int nodeId)
throws VoldemortException
nodeId - The node id from which we can to remote the store
definition
VoldemortException
public void updateRemoteServerState(int nodeId,
MetadataStore.VoldemortState state,
Version clock)
MetadataStore.VoldemortState) on a
remote node.
public Versioned<MetadataStore.VoldemortState> getRemoteServerState(int nodeId)
state from
a remote node.
public void addStore(StoreDefinition def)
def - the definition of the store to add
public void addStore(StoreDefinition def,
int nodeId)
def - the definition of the store to addnodeId - Node on which to add the storepublic void deleteStore(java.lang.String storeName)
storeName - name of the store to delete
public void deleteStore(java.lang.String storeName,
int nodeId)
storeName - name of the store to deletenodeId - Node on which we want to delete a storepublic void setAdminClientCluster(Cluster cluster)
cluster - Set the current clusterpublic Cluster getAdminClientCluster()
public void rollbackStore(int nodeId,
java.lang.String storeName,
long pushVersion)
nodeId - The node id on which to rollbackstoreName - The name of the RO Store to rollbackpushVersion - The version of the push to revert back to
public java.lang.String fetchStore(int nodeId,
java.lang.String storeName,
java.lang.String storeDir,
long pushVersion,
long timeoutMs)
nodeId - The id of the node on which to fetch the datastoreName - The name of the storestoreDir - The directory from where to read the datapushVersion - The version of the pushtimeoutMs - Time timeout in milliseconds
public void failedFetchStore(int nodeId,
java.lang.String storeName,
java.lang.String storeDir)
nodeId - The node id on which to delete the datastoreName - The name of the storestoreDir - The directory to delete
public java.lang.String swapStore(int nodeId,
java.lang.String storeName,
java.lang.String storeDir)
nodeId - The node id where we would want to swap the datastoreName - Name of the storestoreDir - The directory where the data is present
public java.util.Map<java.lang.String,java.lang.String> getROStorageFormat(int nodeId,
java.util.List<java.lang.String> storeNames)
ReadOnlyStorageFormat for
a list of stores
nodeId - The id of the node on which the stores are presentstoreNames - List of all the store names
public java.util.Map<java.lang.String,java.lang.String> getROMaxVersionDir(int nodeId,
java.util.List<java.lang.String> storeNames)
nodeId - The id of the node on which the store is presentstoreNames - List of all the stores
public java.util.Map<java.lang.String,java.lang.String> getROCurrentVersionDir(int nodeId,
java.util.List<java.lang.String> storeNames)
nodeId - The id of the node on which the store is presentstoreNames - List of all the RO stores
public java.util.Map<java.lang.String,java.lang.Long> getROCurrentVersion(int nodeId,
java.util.List<java.lang.String> storeNames)
nodeId - The id of the node on which the store is presentstoreNames - List of all the stores
public java.util.Map<java.lang.String,java.lang.Long> getROMaxVersion(int nodeId,
java.util.List<java.lang.String> storeNames)
nodeId - The id of the node on which the store is presentstoreNames - List of all the stores
public java.util.Map<java.lang.String,java.lang.Long> getROMaxVersion(java.util.List<java.lang.String> storeNames)
getROMaxVersion(int, List)
where-in we find the max versions on each machine and then return the max
of all of them
storeNames - List of all read-only stores
public void updateSlopEntries(int nodeId,
java.util.Iterator<Versioned<Slop>> entryIterator)
nodeId - The id of the nodeentryIterator - An iterator over all the slops for this particular
node
public void fetchPartitionFiles(int nodeId,
java.lang.String storeName,
java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> replicaToPartitionList,
java.lang.String destinationDirPath,
java.util.Set<java.lang.Object> notAcceptedBuckets,
java.util.concurrent.atomic.AtomicBoolean running)
nodeId - The node id from where to copystoreName - The name of the read-only storereplicaToPartitionList - Map of replica type to partition listdestinationDirPath - The destination pathnotAcceptedBuckets - These are Pair< partition, replica > which we
cannot copy AT all. This is because these are current mmap-ed and
are serving traffic.running - A boolean which will control when we want to stop the
copying of files. As long this is true, we will continue copying.
Once this is changed to false we'll disable the copying
public void rebalanceStateChange(Cluster existingCluster,
Cluster transitionCluster,
java.util.List<RebalancePartitionsInfo> rebalancePartitionPlanList,
boolean swapRO,
boolean changeClusterMetadata,
boolean changeRebalanceState,
boolean rollback,
boolean failEarly)
| swapRO | changeClusterMetadata | changeRebalanceState | Order | | f | t | t | cluster -> rebalance | | f | f | t | rebalance | | t | t | f | cluster -> swap | | t | t | t | cluster -> swap -> rebalance |Similarly for rollback:
| swapRO | changeClusterMetadata | changeRebalanceState | Order | | f | t | t | remove from rebalance -> cluster | | f | f | t | remove from rebalance | | t | t | f | cluster -> swap | | t | t | t | remove from rebalance -> cluster -> swap |
existingCluster - Current clustertransitionCluster - Transition clusterrebalancePartitionPlanList - The list of rebalance partition info
plansswapRO - Boolean indicating if we need to swap RO storeschangeClusterMetadata - Boolean indicating if we need to change
cluster metadatachangeRebalanceState - Boolean indicating if we need to change
rebalancing staterollback - Do we want to do a rollback step in case of failures?failEarly - Do we want to fail early while doing state change?
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||