Package org.apache.hadoop.util
Class Progress
java.lang.Object
org.apache.hadoop.util.Progress
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 -
Method Summary
Modifier and TypeMethodDescriptionaddPhase()Adds a node to the tree.addPhase(float weightage) Adds a node with a specified progress weightage to the tree.Adds a named node to the tree.Adds a named node with a specified progress weightage to the tree.voidaddPhases(int n) Adds n nodes to the tree.voidcomplete()Completes this node, moving the parent node to its next child.floatget()Returns the overall progress of the root.floatReturns progress in this node. get() would give overall progress of the root node(not just given current node).phase()Returns the current sub-node executing.voidset(float progress) Called during execution on a leaf node to set its progress.voidvoidCalled during execution to move to the next phase at this level in the tree.toString()
-
Constructor Details
-
Progress
public Progress()Creates a new root node.
-
-
Method Details
-
addPhase
Adds a named node to the tree.- Parameters:
status- status.- Returns:
- Progress.
-
addPhase
Adds a node to the tree. Gives equal weightage to all phases.- Returns:
- Progress.
-
addPhase
Adds a named node with a specified progress weightage to the tree.- Parameters:
status- status.weightage- weightage.- Returns:
- Progress.
-
addPhase
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
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
-
toString
-