Class DefaultJobRunner
- java.lang.Object
-
- com.supermap.services.components.impl.DefaultJobRunner
-
- All Implemented Interfaces:
- JobRunner, Disposable
- Direct Known Subclasses:
- CloudJobRunner
public class DefaultJobRunner extends java.lang.Object implements JobRunner, Disposable
-
-
Constructor Summary
Constructors Constructor and Description DefaultJobRunner()
-
Method Summary
Methods Modifier and Type Method and Description voidaddListener(JobRunnerListener listener)Add listener.voidaddWorker(TileWorkerClient worker)Adds the tiling node.voidaddWorkers(java.util.List<TileWorkerClient> workers2Add)Adds the tiling node.protected TileScaleInfocaculateTileScaleInfo(ScaleBuildConfig scaleConfig, Geometry[] regions)voidconfirmBlankRegionInfos(java.lang.String jobId)Confirms the white map range.voiddeployJobToWorker(TileWorkerClient client)Assigns a tiling task to a child node.voiddispose()Release the resource object.BlankTileInfogetBlankTileInfos(double scale, int fromIndex, int toIndex)Gets the white map information.JobBuildConfiggetJobConfig()Gets task configuration information.java.lang.StringgetRemoteWorkspacePath(JobBuildConfig jobBuildConfig)Gets the child node workspace path.protected RuntimeJobStateBuilderFactorygetRuntimeJobStateBuilderFactory()JobStategetState()Gets Job status.TilesetDescgetTilesetDesc()Get the target information for the task.voidinit(JobBuildConfig pConfig, JobState pState, JobDataDeploy dataDeploy)Initialize RunnervoidnotifyJobDeployCompleted(java.lang.String workerId)Notifies the tiling master node, and the tiling job is deployed successfully at the tiling nodevoidnotifyTaskCompleted(java.lang.String taskId, java.lang.String workerId)Notifies the tiling master node that a unit tiling task completed.voidnotifyTaskCompleted(java.lang.String taskId, java.lang.String workerId, TileTaskBuildResult result)Notifies the tiling master node that a unit tiling task completed.voidnotifyTaskFailed(java.lang.String taskid, java.lang.String workerId)Notifies the tiling master node that a unit tiling task failed.voidnotifyWorkerDisconnected(java.lang.String workerId)Notifies the tiling master node that a child node connection failed.voidsetDeployTaskThreadCount(int deployTaskThreadCount)voidsetTileCountPerTask(long value)Sets the number of tiles assigned to each unit's tiling task.voidsetTileRegionManager(TileRegionStateManager tileRegionStateManager)Set the Tile Area Manager.voidstart()Starts the task.voidstop()Stops the task.voidupdateBlankRegions(double scale, java.lang.String[] invalidRegionIds, java.lang.String[] validRegionIds, java.lang.String[] noneMarkedRegionIds, boolean markAllInvalid, boolean markAllValid)Updates the white map range.voidupdateTileJob(Tile[] tiles)Updates the tiling task.
-
-
-
Method Detail
-
init
public void init(JobBuildConfig pConfig, JobState pState, JobDataDeploy dataDeploy)
Description copied from interface:JobRunnerInitialize Runner
-
addListener
public void addListener(JobRunnerListener listener)
Description copied from interface:JobRunnerAdd listener.
- Specified by:
addListenerin interfaceJobRunner
-
deployJobToWorker
public void deployJobToWorker(TileWorkerClient client)
Description copied from interface:JobRunnerAssigns a tiling task to a child node.
- Specified by:
deployJobToWorkerin interfaceJobRunner
-
start
public void start()
Description copied from interface:JobRunnerStarts the task.
-
caculateTileScaleInfo
protected TileScaleInfo caculateTileScaleInfo(ScaleBuildConfig scaleConfig, Geometry[] regions)
-
addWorker
public void addWorker(TileWorkerClient worker)
Adds the tiling node.
- Parameters:
worker-- Since:
- 8.1.1
-
stop
public void stop()
Description copied from interface:JobRunnerStops the task.
-
addWorkers
public void addWorkers(java.util.List<TileWorkerClient> workers2Add)
Description copied from interface:JobRunnerAdds the tiling node.
- Specified by:
addWorkersin interfaceJobRunner
-
getState
public JobState getState()
Description copied from interface:JobRunnerGets Job status. The status returned is not real-time, but it is valid. During the execution of the Job, the status of the Job may be modified concurrently. When this method is called, if another thread is modifying the state of the job, that is, modifying the JobState object's field, the method does not synchronize with the modified thread, so the state it returns is not real-time. But the status of the return is certainly a state after the completion of a modification, rather than the state of the concurrent modification (the state in the modification may be invalid), so the returned state is valid.
-
getTilesetDesc
public TilesetDesc getTilesetDesc()
Description copied from interface:JobRunnerGet the target information for the task.- Specified by:
getTilesetDescin interfaceJobRunner- Returns:
-
setTileCountPerTask
public void setTileCountPerTask(long value)
Description copied from interface:JobRunnerSets the number of tiles assigned to each unit's tiling task. For a unit tiling task, see
TileTask.- Specified by:
setTileCountPerTaskin interfaceJobRunner- Parameters:
value- The number of tiles.
-
notifyJobDeployCompleted
public void notifyJobDeployCompleted(java.lang.String workerId)
Description copied from interface:JobRunnerNotifies the tiling master node, and the tiling job is deployed successfully at the tiling node
- Specified by:
notifyJobDeployCompletedin interfaceJobRunner
-
notifyTaskCompleted
public void notifyTaskCompleted(java.lang.String taskId, java.lang.String workerId)Description copied from interface:JobRunnerNotifies the tiling master node that a unit tiling task completed.
- Specified by:
notifyTaskCompletedin interfaceJobRunner- Parameters:
taskId- The completed Unit tiling task ID.workerId- TaskId unit tiling task where the worker exists.
-
notifyTaskCompleted
public void notifyTaskCompleted(java.lang.String taskId, java.lang.String workerId, TileTaskBuildResult result)Description copied from interface:JobRunnerNotifies the tiling master node that a unit tiling task completed.
- Specified by:
notifyTaskCompletedin interfaceJobRunner
-
notifyTaskFailed
public void notifyTaskFailed(java.lang.String taskid, java.lang.String workerId)Description copied from interface:JobRunnerNotifies the tiling master node that a unit tiling task failed.
- Specified by:
notifyTaskFailedin interfaceJobRunner
-
notifyWorkerDisconnected
public void notifyWorkerDisconnected(java.lang.String workerId)
Description copied from interface:JobRunnerNotifies the tiling master node that a child node connection failed.
- Specified by:
notifyWorkerDisconnectedin interfaceJobRunner
-
getRemoteWorkspacePath
public java.lang.String getRemoteWorkspacePath(JobBuildConfig jobBuildConfig)
Gets the child node workspace path.
- Parameters:
jobBuildConfig-- Returns:
- Since:
- 8.1.1
-
getJobConfig
public JobBuildConfig getJobConfig()
Description copied from interface:JobRunnerGets task configuration information.
- Specified by:
getJobConfigin interfaceJobRunner- Returns:
-
dispose
public void dispose()
Description copied from interface:DisposableRelease the resource object.
- Specified by:
disposein interfaceDisposable
-
updateTileJob
public void updateTileJob(Tile[] tiles)
Description copied from interface:JobRunnerUpdates the tiling task.
- Specified by:
updateTileJobin interfaceJobRunner
-
getBlankTileInfos
public BlankTileInfo getBlankTileInfos(double scale, int fromIndex, int toIndex)
Description copied from interface:JobRunnerGets the white map information.
- Specified by:
getBlankTileInfosin interfaceJobRunner- Returns:
-
confirmBlankRegionInfos
public void confirmBlankRegionInfos(java.lang.String jobId)
Description copied from interface:JobRunnerConfirms the white map range.
- Specified by:
confirmBlankRegionInfosin interfaceJobRunner
-
updateBlankRegions
public void updateBlankRegions(double scale, java.lang.String[] invalidRegionIds, java.lang.String[] validRegionIds, java.lang.String[] noneMarkedRegionIds, boolean markAllInvalid, boolean markAllValid)Description copied from interface:JobRunnerUpdates the white map range.
- Specified by:
updateBlankRegionsin interfaceJobRunner
-
setTileRegionManager
public void setTileRegionManager(TileRegionStateManager tileRegionStateManager)
Description copied from interface:JobRunnerSet the Tile Area Manager.
- Specified by:
setTileRegionManagerin interfaceJobRunner
-
getRuntimeJobStateBuilderFactory
protected RuntimeJobStateBuilderFactory getRuntimeJobStateBuilderFactory()
-
setDeployTaskThreadCount
public void setDeployTaskThreadCount(int deployTaskThreadCount)
-
-