ClusterStoryZombieClusterpublic abstract class AbstractClusterStory extends java.lang.Object implements ClusterStory
AbstractClusterStory provides a partial implementation of
ClusterStory by parsing the topology tree.| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.Set<MachineNode> |
machineNodes |
|
protected int |
maximumDistance |
|
protected java.util.Map<java.lang.String,MachineNode> |
mNodeMap |
|
protected MachineNode[] |
mNodesFlattened |
|
protected java.util.Set<RackNode> |
rackNodes |
|
protected java.util.Map<java.lang.String,RackNode> |
rNodeMap |
| Constructor | Description |
|---|---|
AbstractClusterStory() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
buildMachineNodeMap() |
|
protected void |
buildRackNodeMap() |
|
int |
distance(Node a,
Node b) |
Determine the distance between two
Nodes. |
MachineNode |
getMachineByName(java.lang.String name) |
Get
MachineNode by its host name. |
java.util.Set<MachineNode> |
getMachines() |
Get all machines of the cluster.
|
int |
getMaximumDistance() |
Get the maximum distance possible between any two nodes.
|
RackNode |
getRackByName(java.lang.String name) |
Get
RackNode by its name. |
java.util.Set<RackNode> |
getRacks() |
Get all racks of the cluster.
|
MachineNode[] |
getRandomMachines(int expected,
java.util.Random random) |
Select a random set of machines.
|
protected void |
parseTopologyTree() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClusterTopologyprotected java.util.Set<MachineNode> machineNodes
protected java.util.Set<RackNode> rackNodes
protected MachineNode[] mNodesFlattened
protected java.util.Map<java.lang.String,MachineNode> mNodeMap
protected java.util.Map<java.lang.String,RackNode> rNodeMap
protected int maximumDistance
public java.util.Set<MachineNode> getMachines()
ClusterStorygetMachines in interface ClusterStorypublic java.util.Set<RackNode> getRacks()
ClusterStorygetRacks in interface ClusterStorypublic MachineNode[] getRandomMachines(int expected, java.util.Random random)
ClusterStorygetRandomMachines in interface ClusterStoryexpected - The expected sample size.random - Random number generator to use.MachineNodes.protected void buildMachineNodeMap()
public MachineNode getMachineByName(java.lang.String name)
ClusterStoryMachineNode by its host name.getMachineByName in interface ClusterStoryMachineNode with the same name. Or null if not found.public int distance(Node a, Node b)
ClusterStoryNodes. Currently, the distance
is loosely defined as the length of the longer path for either a or b to
reach their common ancestor.distance in interface ClusterStoryNode a and Node b.protected void buildRackNodeMap()
public RackNode getRackByName(java.lang.String name)
ClusterStoryRackNode by its name.getRackByName in interface ClusterStoryRackNode with the same name. Or null if not found.public int getMaximumDistance()
ClusterStorygetMaximumDistance in interface ClusterStoryprotected void parseTopologyTree()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.