public final class DummyParallelizableJob extends AbstractParallelizableJob implements Serializable
| Constructor and Description |
|---|
DummyParallelizableJob(int tasks,
int minSleepTime,
int maxSleepTime)
Initializes the number of tasks to serve and the amount of time to
delay to simulate the processing of a task.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
archiveState(ca.eandb.util.io.Archive ar)
Saves or restores the state of this job from an archive.
|
void |
finish()
Performs any final actions required for this
ParallelizableJob. |
Object |
getNextTask()
Gets the next task to be performed.
|
boolean |
isComplete()
Gets a value that indicates if this job is complete (i.e., if results
for all tasks have been submitted).
|
void |
submitTaskResults(Object task,
Object results,
ca.eandb.util.progress.ProgressMonitor monitor)
Submits the results of a task.
|
TaskWorker |
worker()
Gets the task worker to use to process the tasks of this job.
|
createFileOutputStream, createRandomAccessFile, initialize, restoreState, saveState, setHostServicepublic DummyParallelizableJob(int tasks,
int minSleepTime,
int maxSleepTime)
tasks - The number of tasks to serve.minSleepTime - The minimum time (in milliseconds) to sleep to
simulate the processing of a task.maxSleepTime - The maximum time (in milliseconds) to sleep to
simulate the processing of a task.public Object getNextTask()
ParallelizableJobgetNextTask in interface ParallelizableJobObject describing the next task to be
performed, or null if there are no remaining
tasks.public void submitTaskResults(Object task, Object results, ca.eandb.util.progress.ProgressMonitor monitor)
ParallelizableJobsubmitTaskResults in interface ParallelizableJobtask - The Object describing the task for which
results are being submitted (must have been obtained from a
previous call to ParallelizableJob.getNextTask().results - The Object containing the results of
a task.monitor - The ProgressMonitor to update with the
progress of this Job.ParallelizableJob.getNextTask()public boolean isComplete()
ParallelizableJobisComplete in interface ParallelizableJobpublic void finish()
ParallelizableJobParallelizableJob.finish in interface ParallelizableJobfinish in class AbstractParallelizableJobpublic TaskWorker worker()
ParallelizableJobworker in interface ParallelizableJobprotected void archiveState(ca.eandb.util.io.Archive ar)
throws IOException
AbstractParallelizableJobarchiveState in class AbstractParallelizableJobar - The Archive to read from or write to.IOExceptionCopyright © 2016. All rights reserved.