java.lang.Object
org.apache.hadoop.hdfs.server.diskbalancer.planner.NodePlan

public class NodePlan extends Object
NodePlan is a set of volumeSetPlans.
  • Constructor Details

    • NodePlan

      public NodePlan()
      Constructs an Empty Node Plan.
    • NodePlan

      public NodePlan(String datanodeName, int rpcPort)
      Constructs an empty NodePlan.
  • Method Details

    • getTimeStamp

      public long getTimeStamp()
      returns timestamp when this plan was created.
      Returns:
      long
    • setTimeStamp

      public void setTimeStamp(long timeStamp)
      Sets the timestamp when this plan was created.
      Parameters:
      timeStamp -
    • getVolumeSetPlans

      public List<Step> getVolumeSetPlans()
      Returns a Map of VolumeSetIDs and volumeSetPlans.
      Returns:
      List of Steps
    • setNodeName

      public void setNodeName(String nodeName)
      Sets Node Name.
      Parameters:
      nodeName - - Name
    • setVolumeSetPlans

      public void setVolumeSetPlans(List<Step> volumeSetPlans)
      Sets a volume List plan.
      Parameters:
      volumeSetPlans - - List of plans.
    • getNodeName

      public String getNodeName()
      Returns the DataNode URI.
      Returns:
      URI
    • setURI

      public void setURI(String dataNodeName)
      Sets the DataNodeURI.
      Parameters:
      dataNodeName - - String
    • getPort

      public int getPort()
      Gets the DataNode RPC Port.
      Returns:
      port
    • setPort

      public void setPort(int port)
      Sets the DataNode RPC Port.
      Parameters:
      port - - int
    • parseJson

      public static NodePlan parseJson(String json) throws IOException
      Parses a JSON string and converts to NodePlan.
      Parameters:
      json - - JSON String
      Returns:
      NodePlan
      Throws:
      IOException
    • toJson

      public String toJson() throws IOException
      Returns a JSON representation of NodePlan.
      Returns:
      - JSON String
      Throws:
      IOException
    • getNodeUUID

      public String getNodeUUID()
      gets the Node UUID.
      Returns:
      Node UUID.
    • setNodeUUID

      public void setNodeUUID(String nodeUUID)
      Sets the Node UUID.
      Parameters:
      nodeUUID - - UUID of the node.