public class

RUSHrHash

extends Object
java.lang.Object
   ↳ org.apache.helix.tools.RUSHrHash

Summary

Fields
protected final int SEED_PARAM
protected HashMap[] clusterConfig an array of hash maps where each element holds data for a sub cluster
protected HashMap[] clusters an array of hash maps where each hash map holds info on the sub cluster that corresponds to the array indices meaning that array element 0 holds data for server 0 that is the total number of nodes in the cluster this property is populated at construction time only
protected HashMap[] nodes an array of HashMaps where each HashMap holds the data for a single node
protected int replicationDegree
protected int totalClusters total number of sub-clusters in our data configuration this property is populated at construction time only
protected int totalNodes the total number of nodes in all of the subClusters this property is populated at construction time only
protected int totalNodesW the total number of nodes in all of the clusters this property is populated at construction time only
Public Constructors
RUSHrHash(HashMap<StringObject> conf)
The constructor analyzes the passed config to obtain the fundamental values and data structures for locating a node.
Public Methods
void choose(int nodesToRetrieve, int currentCluster, int remainingNodes, ArrayList<HashMap> nodeData)
int drawWHG(int replicas, int disksInCurrentCluster, int totalDisks, int weight)
ArrayList<HashMap> findNode(long objKey)
This function is an implementation of a RUSHr algorithm as described by R J Honicky and Ethan Miller
ArrayList<HashMap> findNode(String objKey)
This function is an implementation of a RUSH algorithm as described by R J Honicky and Ethan Miller
ArrayList<HashMap> findNodes(String objKey)
@return
int getReplicationDegree()
int getTotalNodes()
void reset(int nodesToRetrieve, int currentCluster)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final int SEED_PARAM

Constant Value: 1560 (0x00000618)

protected HashMap[] clusterConfig

an array of hash maps where each element holds data for a sub cluster

protected HashMap[] clusters

an array of hash maps where each hash map holds info on the sub cluster that corresponds to the array indices meaning that array element 0 holds data for server 0 that is the total number of nodes in the cluster this property is populated at construction time only

protected HashMap[] nodes

an array of HashMaps where each HashMap holds the data for a single node

protected int replicationDegree

protected int totalClusters

total number of sub-clusters in our data configuration this property is populated at construction time only

protected int totalNodes

the total number of nodes in all of the subClusters this property is populated at construction time only

protected int totalNodesW

the total number of nodes in all of the clusters this property is populated at construction time only

Public Constructors

public RUSHrHash (HashMap<StringObject> conf)

The constructor analyzes the passed config to obtain the fundamental values and data structures for locating a node. Each of those values is described in detail above with each property. briefly: this.clusters this.totalClusters this.totalNodes The values above are derived from the HashMap[] oonfig passed to the locator.

Parameters
conf dataConfig
Throws
Exception

Public Methods

public void choose (int nodesToRetrieve, int currentCluster, int remainingNodes, ArrayList<HashMap> nodeData)

public int drawWHG (int replicas, int disksInCurrentCluster, int totalDisks, int weight)

public ArrayList<HashMap> findNode (long objKey)

This function is an implementation of a RUSHr algorithm as described by R J Honicky and Ethan Miller

Throws
Exception
Exception

public ArrayList<HashMap> findNode (String objKey)

This function is an implementation of a RUSH algorithm as described by R J Honicky and Ethan Miller

Parameters
objKey - an int used as the prng seed. this int is usually derived from a string hash
Returns
  • node - holds three values: abs_node - an int which is the absolute position of the located node in relation to all nodes on all subClusters rel_node - an int which is the relative postion located node within the located cluster cluster - an int which is the located cluster
Throws
Exception

public ArrayList<HashMap> findNodes (String objKey)

@return

Throws
Exception

public int getReplicationDegree ()

public int getTotalNodes ()

public void reset (int nodesToRetrieve, int currentCluster)