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
 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(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.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 updateRemoteStoreDefList(int nodeId, java.util.List<StoreDefinition> storesList)
          Update the store definitions on a remote node.
 
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

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

  • 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

    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


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