public abstract class AbstractParallelizableJob extends Object implements ParallelizableJob
ParallelizableJob that provides a default
implementation for the Job interface.| Constructor and Description |
|---|
AbstractParallelizableJob() |
| 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.
|
protected FileOutputStream |
createFileOutputStream(String name)
Creates a
FileOutputStream for a file in this job's
working directory. |
protected RandomAccessFile |
createRandomAccessFile(String name)
Creates a new
RandomAccessFile in this job's working
directory. |
void |
finish()
Performs any final actions required for this
ParallelizableJob. |
void |
initialize()
Sets up this
ParallelizableJob on the machine hosting the
job (not necessarily the same machine as the one processing the tasks
for this job). |
void |
restoreState(ObjectInput input)
Notifies the job that it is about to be resumed after having been
suspended.
|
void |
saveState(ObjectOutput output)
Notifies the job that it is about to be suspended (for example, if the
server application is about to be shut down).
|
void |
setHostService(HostService host)
Sets the
HostService object that provides secure access
to the file system on the machine hosting this
ParallelizableJob. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNextTask, isComplete, submitTaskResults, workerpublic final void setHostService(HostService host)
ParallelizableJobHostService object that provides secure access
to the file system on the machine hosting this
ParallelizableJob.setHostService in interface ParallelizableJobhost - The HostService to use.public void initialize()
throws Exception
ParallelizableJobParallelizableJob on the machine hosting the
job (not necessarily the same machine as the one processing the tasks
for this job).initialize in interface ParallelizableJobException - If an error occurs performing the operation.public void finish()
throws Exception
ParallelizableJobParallelizableJob.finish in interface ParallelizableJobException - If an error occurs performing the operation.public void restoreState(ObjectInput input) throws Exception
ParallelizableJobrestoreState in interface ParallelizableJobinput - The ObjectInput to restore state from.Exception - If an error occurs performing the operation.public void saveState(ObjectOutput output) throws Exception
ParallelizableJobsaveState in interface ParallelizableJoboutput - The ObjectOutput to save state to.Exception - If an error occurs performing the operation.protected void archiveState(ca.eandb.util.io.Archive ar)
throws Exception
ar - The Archive to read from or write to.Exception - If the operation fails.protected FileOutputStream createFileOutputStream(String name)
FileOutputStream for a file in this job's
working directory.name - The relative path to the file.FileOutputStream.HostService.createFileOutputStream(java.lang.String)protected RandomAccessFile createRandomAccessFile(String name)
RandomAccessFile in this job's working
directory.name - The relative path to the new file.RandomAccessFile.HostService.createRandomAccessFile(java.lang.String)Copyright © 2016. All rights reserved.