public class DefaultTileMaster extends java.lang.Object implements TileMaster, ComponentContextAware
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultTileMaster.StateSaver |
Constructor and Description |
---|
DefaultTileMaster()
The Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected TileJob |
addJob(JobBuildConfig processed, JobState state) |
TileJob |
addJob(JobInfo jobInfo)
Creates a tiling job
|
boolean |
addTileWorker(TileWorkerInfo connInfo)
Adds the tiling node.
|
void |
analystBlankTile(java.lang.String jobId)
Notifies a named tiling job began to analysis the white chart information
|
java.lang.String |
confirmBlanRegionInfos(java.lang.String jobId)
Confirm the white block information.
|
boolean |
deleteJob(java.lang.String jobID)
Deletes the tiling task
|
void |
dispose()
Release resources.
|
BlankTileInfo |
getBlankTileInfos(java.lang.String jobId, double scale, int fromIndex, int toIndex)
Returns all the white chart information
|
TileJob |
getTileJob(java.lang.String jobID)
Returns a named tiling job information
|
java.util.List<TileJob> |
getTileJobs()
Returns all tiling job information
|
TileWorkerState |
getWorkerState(java.lang.String workerId)
Returns the state of a named tiling node
|
TileWorkerState[] |
getWorkerStates()
Returns the status of all tiling nodes.
|
TileSourceInfo |
handleUserDefinedInfo(TileSourceInfo info)
Gets the tile source information in the TileSource container.
|
protected JobRunner |
initJobRunner(JobBuildConfig processed, JobState state, boolean completed) |
protected TileJob |
initTileJob(JobBuildConfig processed, JobRunner runner) |
boolean |
notifyJobDeployCompleted(java.lang.String jobId, java.lang.String workerId)
Notifies the tiling master node, and the tiling job is deployed successfully at the tiling node
|
boolean |
notifyTaskCompleted(java.lang.String jobId, java.lang.String taskId, java.lang.String workerId)
Notifies the tiling master node that a unit tiling task completed.
|
boolean |
notifyTaskCompleted(java.lang.String jobId, java.lang.String taskId, java.lang.String workerId, TileTaskBuildResult result)
Notifies the tiling master node that a tiling task was successful.
|
boolean |
notifyTaskFailed(java.lang.String jobId, java.lang.String taskId, java.lang.String workerId)
Notifies the tiling master node that a unit tiling task failed.
|
void |
redeployJobToWorker(java.lang.String jobId, java.lang.String workerId)
When deploying a tiling task to a worker fails, it is used for redeployment.
|
void |
removeTileWorker(java.lang.String workerId)
Removes the tiling node.
|
void |
restart(java.lang.String jobId)
Restarts the tiling job
|
void |
setComponentContext(ComponentContext context)
Sets the service component context information.
|
void |
setJobInfoPREProcessor(JobInfoPREProcessor processor)
Sets the tiling Job Preprocessor
|
void |
setJobRunnerFactory(JobRunnerFactory factory)
Sets the tile operator factory
|
void |
setRestContext(RestContext value)
Sets the Rest context information.
|
void |
setTileWorkerClientFactory(TileWorkerClientFactory value)
Binds the child node generator.
|
void |
startJob(java.lang.String jobId)
Starts the tiling job
|
void |
stopJob(java.lang.String jobId)
Stops the tiling job
|
void |
updateBlankRegion(java.lang.String jobId, double scale, java.lang.String[] invalidRegionIds, java.lang.String[] validRegionIds, java.lang.String[] noneMarkedRegionIds, boolean markAllInvalid, boolean markAllValid)
Submits a confirmation message of the white chart information
|
void |
workerQuit(TileWorkerInfo conInfo)
Notifies the tiling master node that the tiling task Has been withdrawn.
|
public void redeployJobToWorker(java.lang.String jobId, java.lang.String workerId)
TileMaster
When deploying a tiling task to a worker fails, it is used for redeployment.
redeployJobToWorker
in interface TileMaster
jobId
- The task id needs to be redeployed.workerId
- Needs to redeploy the worker's id.public void setRestContext(RestContext value)
Sets the Rest context information.
value
-public boolean addTileWorker(TileWorkerInfo connInfo)
Adds the tiling node.
addTileWorker
in interface TileMaster
conInfo
-public void removeTileWorker(java.lang.String workerId)
Removes the tiling node.
removeTileWorker
in interface TileMaster
workerId
-public void workerQuit(TileWorkerInfo conInfo)
Notifies the tiling master node that the tiling task Has been withdrawn.
workerQuit
in interface TileMaster
conInfo
-public void stopJob(java.lang.String jobId)
Stops the tiling job
stopJob
in interface TileMaster
jobId
-public void startJob(java.lang.String jobId)
Starts the tiling job
startJob
in interface TileMaster
jobId
-public void restart(java.lang.String jobId)
Restarts the tiling job
restart
in interface TileMaster
jobId
-public TileJob addJob(JobInfo jobInfo)
Creates a tiling job
addJob
in interface TileMaster
l
-public TileSourceInfo handleUserDefinedInfo(TileSourceInfo info)
Gets the tile source information in the TileSource container.
l
-public void setJobInfoPREProcessor(JobInfoPREProcessor processor)
Sets the tiling Job Preprocessor
setJobInfoPREProcessor
in interface TileMaster
processor
-public void setJobRunnerFactory(JobRunnerFactory factory)
Sets the tile operator factory
setJobRunnerFactory
in interface TileMaster
factory
-public java.util.List<TileJob> getTileJobs()
Returns all tiling job information
getTileJobs
in interface TileMaster
public TileJob getTileJob(java.lang.String jobID)
Returns a named tiling job information
getTileJob
in interface TileMaster
jobID
- Tiling task ID.public boolean notifyJobDeployCompleted(java.lang.String jobId, java.lang.String workerId)
Notifies the tiling master node, and the tiling job is deployed successfully at the tiling node
notifyJobDeployCompleted
in interface TileMaster
jobId
- Tiling task ID.workerId
- Tiling node ID.public boolean notifyTaskCompleted(java.lang.String jobId, java.lang.String taskId, java.lang.String workerId)
Notifies the tiling master node that a unit tiling task completed.
notifyTaskCompleted
in interface TileMaster
jobId
- Tiling task ID.taskId
- Unit tiling task ID. See TileTask
for unit tiling tasks.workerId
- The TileWorker ID of performing the unit task.public boolean notifyTaskFailed(java.lang.String jobId, java.lang.String taskId, java.lang.String workerId)
Notifies the tiling master node that a unit tiling task failed.
notifyTaskFailed
in interface TileMaster
jobId
- Tiling task ID.taskId
- Unit tiling task ID. See TileTask
for unit tiling tasks.workerId
- The TileWorker ID of performing the unit task.public boolean deleteJob(java.lang.String jobID)
Deletes the tiling task
deleteJob
in interface TileMaster
jobID
- Pre-deleted tiling task ID.public boolean notifyTaskCompleted(java.lang.String jobId, java.lang.String taskId, java.lang.String workerId, TileTaskBuildResult result)
Notifies the tiling master node that a tiling task was successful.
notifyTaskCompleted
in interface TileMaster
jobId
-taskId
-workerId
-result
-public void analystBlankTile(java.lang.String jobId)
Notifies a named tiling job began to analysis the white chart information
analystBlankTile
in interface TileMaster
jobId
-public BlankTileInfo getBlankTileInfos(java.lang.String jobId, double scale, int fromIndex, int toIndex)
Returns all the white chart information
getBlankTileInfos
in interface TileMaster
jobId
-scale
-fromIndex
-toIndex
-public void updateBlankRegion(java.lang.String jobId, double scale, java.lang.String[] invalidRegionIds, java.lang.String[] validRegionIds, java.lang.String[] noneMarkedRegionIds, boolean markAllInvalid, boolean markAllValid)
Submits a confirmation message of the white chart information
updateBlankRegion
in interface TileMaster
jobId
-scale
-invalidRegionIds
-validRegionIds
-noneMarkedRegionIds
-markAllInvalid
-markedAllValid
-public java.lang.String confirmBlanRegionInfos(java.lang.String jobId)
confirmBlanRegionInfos
in interface TileMaster
jobId
-public TileWorkerState[] getWorkerStates()
Returns the status of all tiling nodes.
getWorkerStates
in interface TileMaster
public TileWorkerState getWorkerState(java.lang.String workerId)
Returns the state of a named tiling node
getWorkerState
in interface TileMaster
workerId
-public void setTileWorkerClientFactory(TileWorkerClientFactory value)
Binds the child node generator.
value
-public void dispose()
Release resources.
dispose
in interface Disposable
public void setComponentContext(ComponentContext context)
Sets the service component context information.
setComponentContext
in interface ComponentContextAware
context
-protected TileJob addJob(JobBuildConfig processed, JobState state)
protected JobRunner initJobRunner(JobBuildConfig processed, JobState state, boolean completed)
protected TileJob initTileJob(JobBuildConfig processed, JobRunner runner)