Class Progress

java.lang.Object
org.apache.hadoop.util.Progress

@LimitedPrivate("MapReduce") @Unstable public class Progress extends Object
Utility to assist with generation of progress reports. Applications build a hierarchy of Progress instances, each modelling a phase of execution. The root is constructed with Progress(). Nodes for sub-phases are created by calling addPhase().
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new root node.
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds a node to the tree.
    addPhase(float weightage)
    Adds a node with a specified progress weightage to the tree.
    addPhase(String status)
    Adds a named node to the tree.
    addPhase(String status, float weightage)
    Adds a named node with a specified progress weightage to the tree.
    void
    addPhases(int n)
    Adds n nodes to the tree.
    void
    Completes this node, moving the parent node to its next child.
    float
    get()
    Returns the overall progress of the root.
    float
    Returns progress in this node. get() would give overall progress of the root node(not just given current node).
    Returns the current sub-node executing.
    void
    set(float progress)
    Called during execution on a leaf node to set its progress.
    void
    setStatus(String status)
     
    void
    Called during execution to move to the next phase at this level in the tree.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Progress

      public Progress()
      Creates a new root node.
  • Method Details

    • addPhase

      public Progress addPhase(String status)
      Adds a named node to the tree.
      Parameters:
      status - status.
      Returns:
      Progress.
    • addPhase

      public Progress addPhase()
      Adds a node to the tree. Gives equal weightage to all phases.
      Returns:
      Progress.
    • addPhase

      public Progress addPhase(String status, float weightage)
      Adds a named node with a specified progress weightage to the tree.
      Parameters:
      status - status.
      weightage - weightage.
      Returns:
      Progress.
    • addPhase

      public Progress addPhase(float weightage)
      Adds a node with a specified progress weightage to the tree.
      Parameters:
      weightage - weightage.
      Returns:
      Progress.
    • addPhases

      public void addPhases(int n)
      Adds n nodes to the tree. Gives equal weightage to all phases.
      Parameters:
      n - n.
    • startNextPhase

      public void startNextPhase()
      Called during execution to move to the next phase at this level in the tree.
    • phase

      public Progress phase()
      Returns the current sub-node executing.
      Returns:
      Progress.
    • complete

      public void complete()
      Completes this node, moving the parent node to its next child.
    • set

      public void set(float progress)
      Called during execution on a leaf node to set its progress.
      Parameters:
      progress - progress.
    • get

      public float get()
      Returns the overall progress of the root.
      Returns:
      progress.
    • getProgress

      public float getProgress()
      Returns progress in this node. get() would give overall progress of the root node(not just given current node).
      Returns:
      progress.
    • setStatus

      public void setStatus(String status)
    • toString

      public String toString()
      Overrides:
      toString in class Object