|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.electric.tool.Job
com.sun.electric.tool.MultiTaskJob<TaskKey,TaskResult,Result>
public abstract class MultiTaskJob<TaskKey,TaskResult,Result>
This generic class supports map-reduce scheme of computation on Electric database. Large computation has three stages: 1) Large computation is splitted into smaller tasks. Smaller tasks are identified by TaskKey class. This stage is performed by prepareTasks method, which schedules each task by startTask method. 2) Tasks run in parallel, each giving result of TaskResult type. This stage is performed by runTask method for each instance of task. 3) TaskResults are combinded into final result of Result type. This stage is performed by mergeTaskResults method. 4) Result is consumed on server. This stage is performed by consumer.consume method.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sun.electric.tool.Job |
---|
Job.Mode, Job.Priority, Job.Type |
Field Summary |
---|
Fields inherited from class com.sun.electric.tool.Job |
---|
BATCHMODE, endTime, LOCALDEBUGFLAG, startTime |
Constructor Summary | |
---|---|
MultiTaskJob(java.lang.String jobName,
Tool t,
Job.Type jobType,
Consumer<Result> c)
Constructor creates a new instance of MultiTaskJob. |
Method Summary | |
---|---|
boolean |
doIt()
This method is not overriden by subclasses. |
abstract Result |
mergeTaskResults(java.util.Map<TaskKey,TaskResult> taskResults)
This abtract method combines task results into final result. |
abstract void |
prepareTasks()
This abstract method split large computation into smaller task. |
abstract TaskResult |
runTask(TaskKey taskKey)
This abtract methods performs computation of each task. |
void |
startTask(java.lang.String taskName,
TaskKey taskKey)
Schedules task. |
Methods inherited from class com.sun.electric.tool.Job |
---|
abort, acquireExamineLock, checkAbort, fieldVariableChanged, getAllJobs, getDatabase, getDebug, getDeleteWhenDone, getDisplay, getExtendedUserInterface, getInfo, getNumThreads, getRunMode, getRunningJob, getScheduledToAbort, getStatus, getUserInterface, initJobManager, invokeExamineLater, isFinished, releaseExamineLock, remove, setDebug, setProgress, setReportExecutionFlag, setThreadMode, startJob, startJob, startJobOnMyResult, terminateFail, terminateIt, terminateOK, threadDatabase, toString, updateIncrementalDRCErrors, updateNetworkErrors, wantUpdateGui |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultiTaskJob(java.lang.String jobName, Tool t, Job.Type jobType, Consumer<Result> c)
jobName
- a string that describes this MultiTaskJob.t
- the Tool that originated this MultiTaskJob.jobType
- the Type of this Job (EXAMINE or CHANGE).c
- interface which consumes the result on serverMethod Detail |
---|
public abstract void prepareTasks() throws JobException
JobException
public abstract TaskResult runTask(TaskKey taskKey) throws JobException
taskKey
- task key which identifies the task
JobException
public abstract Result mergeTaskResults(java.util.Map<TaskKey,TaskResult> taskResults) throws JobException
taskResults
- map which contains result of each completed task.
JobException
public void startTask(java.lang.String taskName, TaskKey taskKey)
taskName
- task name which is appeared in Jobs Explorer TreetaskKey
- task key which identifies the task.public final boolean doIt() throws JobException
doIt
in class Job
JobException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |