public class DefaultJobRunner extends java.lang.Object implements JobRunner, Disposable
Constructor and Description |
---|
DefaultJobRunner() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(JobRunnerListener listener)
Add listener.
|
void |
addWorker(TileWorkerClient worker)
Adds the tiling node.
|
void |
addWorkers(java.util.List<TileWorkerClient> workers2Add)
Adds the tiling node.
|
protected TileScaleInfo |
caculateTileScaleInfo(ScaleBuildConfig scaleConfig, Geometry[] regions) |
void |
confirmBlankRegionInfos(java.lang.String jobId)
Confirms the white map range.
|
void |
deployJobToWorker(TileWorkerClient client)
Assigns a tiling task to a child node.
|
void |
dispose()
Release the resource object.
|
BlankTileInfo |
getBlankTileInfos(double scale, int fromIndex, int toIndex)
Gets the white map information.
|
JobBuildConfig |
getJobConfig()
Gets task configuration information.
|
java.lang.String |
getRemoteWorkspacePath(JobBuildConfig jobBuildConfig)
Gets the child node workspace path.
|
protected RuntimeJobStateBuilderFactory |
getRuntimeJobStateBuilderFactory() |
JobState |
getState()
Gets Job status.
|
TilesetDesc |
getTilesetDesc()
Get the target information for the task.
|
void |
init(JobBuildConfig pConfig, JobState pState, JobDataDeploy dataDeploy)
Initialize Runner
|
void |
notifyJobDeployCompleted(java.lang.String workerId)
Notifies the tiling master node, and the tiling job is deployed successfully at the tiling node
|
void |
notifyTaskCompleted(java.lang.String taskId, java.lang.String workerId)
Notifies the tiling master node that a unit tiling task completed.
|
void |
notifyTaskCompleted(java.lang.String taskId, java.lang.String workerId, TileTaskBuildResult result)
Notifies the tiling master node that a unit tiling task completed.
|
void |
notifyTaskFailed(java.lang.String taskid, java.lang.String workerId)
Notifies the tiling master node that a unit tiling task failed.
|
void |
notifyWorkerDisconnected(java.lang.String workerId)
Notifies the tiling master node that a child node connection failed.
|
void |
setDeployTaskThreadCount(int deployTaskThreadCount) |
void |
setTileCountPerTask(long value)
Sets the number of tiles assigned to each unit's tiling task.
|
void |
setTileRegionManager(TileRegionStateManager tileRegionStateManager)
Set the Tile Area Manager.
|
void |
start()
Starts the task.
|
void |
stop()
Stops the task.
|
void |
updateBlankRegions(double scale, java.lang.String[] invalidRegionIds, java.lang.String[] validRegionIds, java.lang.String[] noneMarkedRegionIds, boolean markAllInvalid, boolean markAllValid)
Updates the white map range.
|
void |
updateTileJob(Tile[] tiles)
Updates the tiling task.
|
public void init(JobBuildConfig pConfig, JobState pState, JobDataDeploy dataDeploy)
JobRunner
public void addListener(JobRunnerListener listener)
JobRunner
Add listener.
addListener
in interface JobRunner
public void deployJobToWorker(TileWorkerClient client)
JobRunner
Assigns a tiling task to a child node.
deployJobToWorker
in interface JobRunner
public void start()
JobRunner
Starts the task.
protected TileScaleInfo caculateTileScaleInfo(ScaleBuildConfig scaleConfig, Geometry[] regions)
public void addWorker(TileWorkerClient worker)
Adds the tiling node.
worker
-public void stop()
JobRunner
Stops the task.
public void addWorkers(java.util.List<TileWorkerClient> workers2Add)
JobRunner
Adds the tiling node.
addWorkers
in interface JobRunner
public JobState getState()
JobRunner
public TilesetDesc getTilesetDesc()
JobRunner
getTilesetDesc
in interface JobRunner
public void setTileCountPerTask(long value)
JobRunner
Sets the number of tiles assigned to each unit's tiling task. For a unit tiling task, see TileTask
.
setTileCountPerTask
in interface JobRunner
value
- The number of tiles.public void notifyJobDeployCompleted(java.lang.String workerId)
JobRunner
Notifies the tiling master node, and the tiling job is deployed successfully at the tiling node
notifyJobDeployCompleted
in interface JobRunner
public void notifyTaskCompleted(java.lang.String taskId, java.lang.String workerId)
JobRunner
Notifies the tiling master node that a unit tiling task completed.
notifyTaskCompleted
in interface JobRunner
taskId
- The completed Unit tiling task ID.workerId
- TaskId unit tiling task where the worker exists.public void notifyTaskCompleted(java.lang.String taskId, java.lang.String workerId, TileTaskBuildResult result)
JobRunner
Notifies the tiling master node that a unit tiling task completed.
notifyTaskCompleted
in interface JobRunner
public void notifyTaskFailed(java.lang.String taskid, java.lang.String workerId)
JobRunner
Notifies the tiling master node that a unit tiling task failed.
notifyTaskFailed
in interface JobRunner
public void notifyWorkerDisconnected(java.lang.String workerId)
JobRunner
Notifies the tiling master node that a child node connection failed.
notifyWorkerDisconnected
in interface JobRunner
public java.lang.String getRemoteWorkspacePath(JobBuildConfig jobBuildConfig)
Gets the child node workspace path.
jobBuildConfig
-public JobBuildConfig getJobConfig()
JobRunner
Gets task configuration information.
getJobConfig
in interface JobRunner
public void dispose()
Disposable
Release the resource object.
dispose
in interface Disposable
public void updateTileJob(Tile[] tiles)
JobRunner
Updates the tiling task.
updateTileJob
in interface JobRunner
public BlankTileInfo getBlankTileInfos(double scale, int fromIndex, int toIndex)
JobRunner
Gets the white map information.
getBlankTileInfos
in interface JobRunner
public void confirmBlankRegionInfos(java.lang.String jobId)
JobRunner
Confirms the white map range.
confirmBlankRegionInfos
in interface JobRunner
public void updateBlankRegions(double scale, java.lang.String[] invalidRegionIds, java.lang.String[] validRegionIds, java.lang.String[] noneMarkedRegionIds, boolean markAllInvalid, boolean markAllValid)
JobRunner
Updates the white map range.
updateBlankRegions
in interface JobRunner
public void setTileRegionManager(TileRegionStateManager tileRegionStateManager)
JobRunner
Set the Tile Area Manager.
setTileRegionManager
in interface JobRunner
protected RuntimeJobStateBuilderFactory getRuntimeJobStateBuilderFactory()
public void setDeployTaskThreadCount(int deployTaskThreadCount)