voldemort.client.protocol.admin
Class AdminClient.MetadataManagementOperations

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

public class AdminClient.MetadataManagementOperations
extends java.lang.Object

Encapsulates all operations that deal with cluster.xml and stores.xml


Constructor Summary
AdminClient.MetadataManagementOperations()
           
 
Method Summary
 void fetchAndUpdateRemoteStore(int nodeId, java.util.List<StoreDefinition> updatedStores)
          Helper method to fetch the current stores xml list and update the specified stores
 void fetchAndUpdateRemoteStores(java.util.List<StoreDefinition> updatedStores)
          Helper method to fetch the current stores xml list and update the specified stores.
 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<java.util.List<StoreDefinition>> getRemoteStoreDefList()
           
 Versioned<java.util.List<StoreDefinition>> getRemoteStoreDefList(int nodeId)
          Retrieve the store definitions from a remote node.
 void setMetadataversion(java.util.Properties newProperties)
          Set the metadata versions to the given set
 void updateMetadataversion(java.util.Collection<java.lang.String> versionKeys)
          Update the metadata versions for the given keys (cluster or store).
 void updateMetadataversion(java.lang.String versionKey)
          Update the metadata version for the given key (cluster or store).
 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 updateRemoteMetadata(java.util.List<java.lang.Integer> remoteNodeIds, java.lang.String key, Versioned<java.lang.String> value)
          Wrapper for updateRemoteMetadata function used against a single Node It basically loops over the entire list of Nodes that we need to execute the required operation against.
 void updateRemoteMetadataPair(int remoteNodeId, java.lang.String clusterKey, Versioned<java.lang.String> clusterValue, java.lang.String storesKey, Versioned<java.lang.String> storesValue)
          Update metadata pair at the given remoteNodeId.
 void updateRemoteMetadataPair(java.util.List<java.lang.Integer> remoteNodeIds, java.lang.String clusterKey, Versioned<java.lang.String> clusterValue, java.lang.String storesKey, Versioned<java.lang.String> storesValue)
          Wrapper for updateRemoteMetadataPair function used against a single Node It basically loops over the entire list of Nodes that we need to execute the required operation against.
 void updateRemoteStoreDefList(int nodeId, java.util.List<StoreDefinition> storesList)
          Update the store definitions on a remote node.
 void updateRemoteStoreDefList(java.util.List<StoreDefinition> storesList)
          Wrapper for updateRemoteStoreDefList : update this for all the nodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminClient.MetadataManagementOperations

public AdminClient.MetadataManagementOperations()
Method Detail

updateMetadataversion

public void updateMetadataversion(java.lang.String versionKey)
Update the metadata version for the given key (cluster or store). The new value set is the current timestamp.

Parameters:
versionKey - The metadata key for which Version should be incremented

updateMetadataversion

public void updateMetadataversion(java.util.Collection<java.lang.String> versionKeys)
Update the metadata versions for the given keys (cluster or store). The new value set is the current timestamp.

Parameters:
versionKeys - The metadata keys for which Version should be incremented

setMetadataversion

public void setMetadataversion(java.util.Properties newProperties)
Set the metadata versions to the given set

Parameters:
newProperties - The new metadata versions to be set across all the nodes in the cluster

updateRemoteMetadata

public void updateRemoteMetadata(int remoteNodeId,
                                 java.lang.String key,
                                 Versioned<java.lang.String> value)
Update metadata at the given remoteNodeId.

Metadata keys can be one of MetadataStore.METADATA_KEYS
eg.

  • cluster metadata (cluster.xml as string)
  • stores definitions (stores.xml as string)
  • Server states
    See MetadataStore for more information.

    Parameters:
    remoteNodeId - Id of the node
    key - Metadata key to update
    value - Value for the metadata key

  • updateRemoteMetadata

    public void updateRemoteMetadata(java.util.List<java.lang.Integer> remoteNodeIds,
                                     java.lang.String key,
                                     Versioned<java.lang.String> value)
    Wrapper for updateRemoteMetadata function used against a single Node It basically loops over the entire list of Nodes that we need to execute the required operation against. It also increments the version of the corresponding metadata in the system store.

    Metadata keys can be one of MetadataStore.METADATA_KEYS
    eg.

  • cluster metadata (cluster.xml as string)
  • stores definitions (stores.xml as string)
  • Server states
    See MetadataStore for more information.

    Parameters:
    remoteNodeIds - Ids of the nodes
    key - Metadata key to update
    value - Value for the metadata key

  • updateRemoteMetadataPair

    public void updateRemoteMetadataPair(int remoteNodeId,
                                         java.lang.String clusterKey,
                                         Versioned<java.lang.String> clusterValue,
                                         java.lang.String storesKey,
                                         Versioned<java.lang.String> storesValue)
    Update metadata pair at the given remoteNodeId.

    Parameters:
    remoteNodeId - Id of the node
    clusterKey - cluster key to update
    clusterValue - value of the cluster metadata key
    storesKey - stores key to update
    storesValue - value of the stores metadata key

    updateRemoteMetadataPair

    public void updateRemoteMetadataPair(java.util.List<java.lang.Integer> remoteNodeIds,
                                         java.lang.String clusterKey,
                                         Versioned<java.lang.String> clusterValue,
                                         java.lang.String storesKey,
                                         Versioned<java.lang.String> storesValue)
    Wrapper for updateRemoteMetadataPair function used against a single Node It basically loops over the entire list of Nodes that we need to execute the required operation against. It also increments the version of the corresponding metadata in the system store.

    Parameters:
    remoteNodeIds - Ids of the nodes
    clusterKey - cluster key to update
    clusterValue - value of the cluster metadata key
    storesKey - stores key to update
    storesValue - value of the stores metadata key

    fetchAndUpdateRemoteStore

    public void fetchAndUpdateRemoteStore(int nodeId,
                                          java.util.List<StoreDefinition> updatedStores)
    Helper method to fetch the current stores xml list and update the specified stores

    Parameters:
    nodeId - ID of the node for which the stores list has to be updated
    updatedStores - New version of the stores to be updated

    fetchAndUpdateRemoteStores

    public void fetchAndUpdateRemoteStores(java.util.List<StoreDefinition> updatedStores)
    Helper method to fetch the current stores xml list and update the specified stores. This is done for all the nodes in the current cluster.

    Parameters:
    updatedStores - New version of the stores to be updated

    getRemoteMetadata

    public Versioned<java.lang.String> getRemoteMetadata(int remoteNodeId,
                                                         java.lang.String key)
    Get the metadata on a remote node.

    Metadata keys can be one of MetadataStore.METADATA_KEYS
    eg.

  • cluster metadata (cluster.xml as string)
  • stores definitions (stores.xml as string)
  • Server states
    See MetadataStore for more information.

    Parameters:
    remoteNodeId - Id of the node
    key - Metadata key to update
    Returns:
    Metadata with its associated Version

  • updateRemoteCluster

    public void updateRemoteCluster(int nodeId,
                                    Cluster cluster,
                                    Version clock)
                             throws VoldemortException
    Update the cluster information MetadataStore.CLUSTER_KEY on a remote node.

    Parameters:
    nodeId - Id of the remote node
    cluster - The new cluster object
    Throws:
    VoldemortException

    getRemoteCluster

    public Versioned<Cluster> getRemoteCluster(int nodeId)
                                        throws VoldemortException
    Get the cluster information from a remote node.

    Parameters:
    nodeId - Node to retrieve information from
    Returns:
    A cluster object with its Version
    Throws:
    VoldemortException

    updateRemoteStoreDefList

    public void updateRemoteStoreDefList(int nodeId,
                                         java.util.List<StoreDefinition> storesList)
                                  throws VoldemortException
    Update the store definitions on a remote node.

    Parameters:
    nodeId - The node id of the machine
    storesList - The new store list
    Throws:
    VoldemortException

    updateRemoteStoreDefList

    public void updateRemoteStoreDefList(java.util.List<StoreDefinition> storesList)
                                  throws VoldemortException
    Wrapper for updateRemoteStoreDefList : update this for all the nodes

    Parameters:
    storesList - The new store list
    Throws:
    VoldemortException

    getRemoteStoreDefList

    public Versioned<java.util.List<StoreDefinition>> getRemoteStoreDefList(int nodeId)
                                                                     throws VoldemortException
    Retrieve the store definitions from a remote node.

    Parameters:
    nodeId - The node id from which we can to remote the store definition
    Returns:
    The list of store definitions from the remote machine
    Throws:
    VoldemortException

    getRemoteStoreDefList

    public Versioned<java.util.List<StoreDefinition>> getRemoteStoreDefList()
                                                                     throws VoldemortException
    Throws:
    VoldemortException


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