public class DiskBalancerCluster extends Object
Constructor and Description |
---|
DiskBalancerCluster()
Empty Constructor needed by Jackson.
|
DiskBalancerCluster(ClusterConnector connector)
Constructs a DiskBalancerCluster.
|
Modifier and Type | Method and Description |
---|---|
List<NodePlan> |
computePlan(double thresholdPercent)
Compute plan takes a node and constructs a planner that creates a plan that
we would like to follow.
|
void |
createSnapshot(String snapShotName)
Writes a snapshot of the cluster to the specified directory.
|
Set<String> |
getExclusionList()
Returns the current ExclusionList.
|
Set<String> |
getInclusionList()
Gets the Inclusion list.
|
DiskBalancerDataNode |
getNodeByIPAddress(String ipAddresss)
Returns a node by IP Address.
|
DiskBalancerDataNode |
getNodeByName(String hostName)
Returns a node by hostName.
|
DiskBalancerDataNode |
getNodeByUUID(String uuid)
Returns a node by UUID.
|
List<DiskBalancerDataNode> |
getNodes()
Gets all DataNodes in the Cluster.
|
List<DiskBalancerDataNode> |
getNodesToProcess()
Returns the Nodes to Process which is the real list of nodes processed by
diskBalancer.
|
String |
getOutput()
Returns th output path for this cluster.
|
float |
getThreshold()
Returns the threshold value.
|
static DiskBalancerCluster |
parseJson(String json)
Parses a Json string and converts to DiskBalancerCluster.
|
void |
readClusterInfo()
readClusterInfo connects to the cluster and reads the node's data.
|
void |
setExclusionList(Set<String> excludedNodes)
sets the list of nodes to exclude from process of diskBalancer.
|
void |
setInclusionList(Set<String> includeNodes)
Sets the inclusionList.
|
void |
setNodes(List<DiskBalancerDataNode> clusterNodes)
Sets the list of nodes of this cluster.
|
void |
setNodesToProcess(List<DiskBalancerDataNode> dnNodesToProcess)
Sets the nodes to process.
|
void |
setOutput(String output)
Sets the output path for this run.
|
void |
setThreshold(float thresholdPercent)
Sets the threshold value.
|
String |
toJson()
returns a serialized json string.
|
public DiskBalancerCluster()
public DiskBalancerCluster(ClusterConnector connector) throws IOException
connector
- - ClusterConnectorIOException
public static DiskBalancerCluster parseJson(String json) throws IOException
json
- - Json StringIOException
public void readClusterInfo() throws Exception
Exception
public List<DiskBalancerDataNode> getNodes()
public void setNodes(List<DiskBalancerDataNode> clusterNodes)
clusterNodes
- List of Nodespublic Set<String> getExclusionList()
public void setExclusionList(Set<String> excludedNodes)
excludedNodes
- - exclusionList of nodes.public float getThreshold()
public void setThreshold(float thresholdPercent)
thresholdPercent
- - float - in percentagepublic Set<String> getInclusionList()
public void setInclusionList(Set<String> includeNodes)
includeNodes
- - set of machines to be processed by diskBalancer.public String toJson() throws IOException
IOException
public List<DiskBalancerDataNode> getNodesToProcess()
public void setNodesToProcess(List<DiskBalancerDataNode> dnNodesToProcess)
dnNodesToProcess
- - List of DataNodes to processpublic String getOutput()
public void setOutput(String output)
output
- - Pathpublic void createSnapshot(String snapShotName) throws IOException
snapShotName
- - name of the snapshotIOException
public List<NodePlan> computePlan(double thresholdPercent)
thresholdPercent
- - in percentagepublic DiskBalancerDataNode getNodeByUUID(String uuid)
uuid
- - Node's UUIDpublic DiskBalancerDataNode getNodeByIPAddress(String ipAddresss)
ipAddresss
- - IP address String.public DiskBalancerDataNode getNodeByName(String hostName)
hostName
- - HostName.Copyright © 2008–2021 Apache Software Foundation. All rights reserved.