Package com.google.gerrit.server.git
Class MultiProgressMonitor.VolatileTask
- java.lang.Object
-
- com.google.gerrit.server.git.MultiProgressMonitor.Task
-
- com.google.gerrit.server.git.MultiProgressMonitor.VolatileTask
-
- All Implemented Interfaces:
org.eclipse.jgit.lib.ProgressMonitor
- Enclosing class:
- MultiProgressMonitor
public class MultiProgressMonitor.VolatileTask extends MultiProgressMonitor.Task
Handle for a sub-task whose total work can be updated while the task is in progress.
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicBoolean
isTotalFinalized
protected AtomicInteger
volatileTotal
-
Constructor Summary
Constructors Constructor Description VolatileTask(String subTaskName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalizeTotal()
Mark the total on this sub-task as unmodifiable.int
getTotal()
String
getTotalDisplay(int total)
void
updateTotal(int workUnits)
Update the total work for this sub-task.-
Methods inherited from class com.google.gerrit.server.git.MultiProgressMonitor.Task
beginTask, end, endTask, getCount, getName, isCancelled, start, update
-
-
-
-
Field Detail
-
volatileTotal
protected AtomicInteger volatileTotal
-
isTotalFinalized
protected AtomicBoolean isTotalFinalized
-
-
Constructor Detail
-
VolatileTask
public VolatileTask(String subTaskName)
-
-
Method Detail
-
updateTotal
public void updateTotal(int workUnits)
Update the total work for this sub-task.Intended to be called from a worker thread.
- Parameters:
workUnits
- number of work units to be added to existing total work.
-
finalizeTotal
public void finalizeTotal()
Mark the total on this sub-task as unmodifiable.Intended to be called from a worker thread.
-
getTotal
public int getTotal()
- Overrides:
getTotal
in classMultiProgressMonitor.Task
-
getTotalDisplay
public String getTotalDisplay(int total)
- Overrides:
getTotalDisplay
in classMultiProgressMonitor.Task
-
-