voldemort.client.protocol.admin
Class AdminClient.ReadOnlySpecificOperations

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

public class AdminClient.ReadOnlySpecificOperations
extends java.lang.Object

Encapsulates all operations specific to read-only stores alone


Constructor Summary
AdminClient.ReadOnlySpecificOperations()
           
 
Method Summary
 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.
 void fetchPartitionFiles(int nodeId, java.lang.String storeName, java.util.List<java.lang.Integer> partitionIds, 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
 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
 void rollbackStore(int nodeId, java.lang.String storeName, long pushVersion)
          Rollback RO store to most recent backup of the current store
 void rollbackStore(java.util.List<java.lang.Integer> nodeIds, java.lang.String storeName, long pushVersion)
           
 java.lang.String swapStore(int nodeId, java.lang.String storeName, java.lang.String storeDir)
          Swap store data atomically on a single node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminClient.ReadOnlySpecificOperations

public AdminClient.ReadOnlySpecificOperations()
Method Detail

rollbackStore

public void rollbackStore(int nodeId,
                          java.lang.String storeName,
                          long pushVersion)
Rollback RO store to most recent backup of the current store

Parameters:
nodeId - The node id on which to rollback
storeName - The name of the RO Store to rollback
pushVersion - The version of the push to revert back to

rollbackStore

public void rollbackStore(java.util.List<java.lang.Integer> nodeIds,
                          java.lang.String storeName,
                          long pushVersion)

fetchStore

public 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

Parameters:
nodeId - The id of the node on which to fetch the data
storeName - The name of the store
storeDir - The directory from where to read the data
pushVersion - The version of the push
timeoutMs - Time timeout in milliseconds
Returns:
The path of the directory where the data is stored finally

failedFetchStore

public 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. This function deletes its...

Parameters:
nodeId - The node id on which to delete the data
storeName - The name of the store
storeDir - The directory to delete

swapStore

public java.lang.String swapStore(int nodeId,
                                  java.lang.String storeName,
                                  java.lang.String storeDir)
Swap store data atomically on a single node

Parameters:
nodeId - The node id where we would want to swap the data
storeName - Name of the store
storeDir - The directory where the data is present
Returns:
Returns the location of the previous directory

getROStorageFormat

public 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

Parameters:
nodeId - The id of the node on which the stores are present
storeNames - List of all the store names
Returns:
Returns a map of store name to its corresponding RO storage format

getROMaxVersionDir

public 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. Important to remember that this may not be the 'current' version since multiple pushes (with greater version numbers) may be in progress currently

Parameters:
nodeId - The id of the node on which the store is present
storeNames - List of all the stores
Returns:
Returns a map of store name to the respective store directory

getROCurrentVersionDir

public 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

Parameters:
nodeId - The id of the node on which the store is present
storeNames - List of all the RO stores
Returns:
Returns a map of store name to the respective max version directory

getROCurrentVersion

public 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

Parameters:
nodeId - The id of the node on which the store is present
storeNames - List of all the stores
Returns:
Returns a map of store name to the respective max version number

getROMaxVersion

public 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. Important to remember that this may not be the 'current' version since multiple pushes (with greater version numbers) may be in progress currently

Parameters:
nodeId - The id of the node on which the store is present
storeNames - List of all the stores
Returns:
Returns a map of store name to the respective max version number

getROMaxVersion

public 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

Parameters:
storeNames - List of all read-only stores
Returns:
A map of store-name to their corresponding max version id

fetchPartitionFiles

public void fetchPartitionFiles(int nodeId,
                                java.lang.String storeName,
                                java.util.List<java.lang.Integer> partitionIds,
                                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. This is run on the stealer node side

Parameters:
nodeId - The node id from where to copy
storeName - The name of the read-only store
partitionIds - List of partitionIds
destinationDirPath - The destination path
notAcceptedBuckets - 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


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