voldemort.client.protocol.admin
Class AdminClient.StoreMaintenanceOperations

java.lang.Object
  extended by voldemort.client.protocol.admin.AdminClient.StoreMaintenanceOperations
Enclosing class:
AdminClient

public class AdminClient.StoreMaintenanceOperations
extends java.lang.Object

Encapsulates all operations that aid in performing maintenance on the actual store's data


Constructor Summary
AdminClient.StoreMaintenanceOperations()
           
 
Method Summary
 long deletePartitions(int nodeId, java.lang.String storeName, java.util.List<java.lang.Integer> partitionIds, 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
 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 migratePartitions(int donorNodeId, int stealerNodeId, java.lang.String storeName, java.util.List<java.lang.Integer> partitionIds, VoldemortFilter filter, Cluster initialCluster)
          Migrate keys/values belonging to a list of partition ids from donor node to stealer node.
 void nativeBackup(int nodeId, java.lang.String storeName, java.lang.String destinationDirPath, int timeOut, boolean verify, boolean isIncremental)
          Native backup a store
 void repairJob(int nodeId)
          Repair the stores on a rebalanced node 'nodeId'
 void reserveMemory(int nodeId, java.util.List<java.lang.String> stores, long sizeInMB)
          Reserve memory for the stores
 void truncate(int nodeId, java.lang.String storeName)
          Delete the store completely (Deletes all data) from the remote node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminClient.StoreMaintenanceOperations

public AdminClient.StoreMaintenanceOperations()
Method Detail

migratePartitions

public 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. Does not delete the partitions from donorNode, merely copies them.

See migratePartitions(int, int, String, List, VoldemortFilter, Cluster) for more details.

Parameters:
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.
Returns:
The value of the AsyncOperation created on stealerNodeId which is performing the operation.

migratePartitions

public int migratePartitions(int donorNodeId,
                             int stealerNodeId,
                             java.lang.String storeName,
                             java.util.List<java.lang.Integer> partitionIds,
                             VoldemortFilter filter,
                             Cluster initialCluster)
Migrate keys/values belonging to a list of partition ids from donor node to stealer node. Does not delete the partitions from donorNode, merely copies them.

This is a background operation (see AsyncOperation that runs on the stealer node where updates are performed.

Parameters:
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.
partitionIds - List of partition ids
filter - Voldemort post-filter
initialCluster - 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 box
Returns:
The value of the AsyncOperation created on stealer node which is performing the operation.

truncate

public void truncate(int nodeId,
                     java.lang.String storeName)
Delete the store completely (Deletes all data) from the remote node.

Parameters:
nodeId - The node id on which the store is present
storeName - The name of the store

deletePartitions

public 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

Parameters:
nodeId - Node on which the entries to be deleted
storeName - Name of the store holding the entries
partitionList - List of partitions to delete.
filter - Custom filter implementation to filter out entries which should not be deleted.
Returns:
Number of entries deleted

deletePartitions

public long deletePartitions(int nodeId,
                             java.lang.String storeName,
                             java.util.List<java.lang.Integer> partitionIds,
                             Cluster initialCluster,
                             VoldemortFilter filter)
Delete all entries belonging to all the partitions passed as a map of replica_type to partition list. Works only for RW stores.

Parameters:
nodeId - Node on which the entries to be deleted
storeName - Name of the store holding the entries
partitionIds - List of partition Ids
filter - Custom filter implementation to filter out entries which should not be deleted.
Returns:
Number of entries deleted

repairJob

public void repairJob(int nodeId)
Repair the stores on a rebalanced node 'nodeId'

Parameters:
nodeId - The id of the node on which to do the repair

nativeBackup

public void nativeBackup(int nodeId,
                         java.lang.String storeName,
                         java.lang.String destinationDirPath,
                         int timeOut,
                         boolean verify,
                         boolean isIncremental)
Native backup a store

Parameters:
nodeId - The node id to backup
storeName - The name of the store to backup
destinationDirPath - The destination path
timeOut - minutes to wait for operation to complete
verify - should the file checksums be verified
isIncremental - is the backup incremental

reserveMemory

public void reserveMemory(int nodeId,
                          java.util.List<java.lang.String> stores,
                          long sizeInMB)
Reserve memory for the stores

Parameters:
nodeId - The node id to reserve, -1 for entire cluster
stores - list of stores for which to reserve
sizeInMB - size of reservation


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu