Class DefaultTileMaster
- java.lang.Object
-
- com.supermap.services.components.impl.DefaultTileMaster
-
- All Implemented Interfaces:
- ComponentContextAware, Disposable, TileMaster
public class DefaultTileMaster extends java.lang.Object implements TileMaster, ComponentContextAware
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description protected static classDefaultTileMaster.StateSaver
-
Constructor Summary
Constructors Constructor and Description DefaultTileMaster()The Constructor.
-
Method Summary
Methods Modifier and Type Method and Description protected TileJobaddJob(JobBuildConfig processed, JobState state)TileJobaddJob(JobInfo jobInfo)Creates a tiling jobbooleanaddTileWorker(TileWorkerInfo connInfo)Adds the tiling node.voidanalystBlankTile(java.lang.String jobId)Notifies a named tiling job began to analysis the white chart informationjava.lang.StringconfirmBlanRegionInfos(java.lang.String jobId)Confirm the white block information.booleandeleteJob(java.lang.String jobID)Deletes the tiling taskvoiddispose()Release resources.BlankTileInfogetBlankTileInfos(java.lang.String jobId, double scale, int fromIndex, int toIndex)Returns all the white chart informationTileJobgetTileJob(java.lang.String jobID)Returns a named tiling job informationjava.util.List<TileJob>getTileJobs()Returns all tiling job informationTileWorkerStategetWorkerState(java.lang.String workerId)Returns the state of a named tiling nodeTileWorkerState[]getWorkerStates()Returns the status of all tiling nodes.TileSourceInfohandleUserDefinedInfo(TileSourceInfo info)Gets the tile source information in the TileSource container.protected JobRunnerinitJobRunner(JobBuildConfig processed, JobState state, boolean completed)protected TileJobinitTileJob(JobBuildConfig processed, JobRunner runner)booleannotifyJobDeployCompleted(java.lang.String jobId, java.lang.String workerId)Notifies the tiling master node, and the tiling job is deployed successfully at the tiling nodebooleannotifyTaskCompleted(java.lang.String jobId, java.lang.String taskId, java.lang.String workerId)Notifies the tiling master node that a unit tiling task completed.booleannotifyTaskCompleted(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.booleannotifyTaskFailed(java.lang.String jobId, java.lang.String taskId, java.lang.String workerId)Notifies the tiling master node that a unit tiling task failed.voidredeployJobToWorker(java.lang.String jobId, java.lang.String workerId)When deploying a tiling task to a worker fails, it is used for redeployment.voidremoveTileWorker(java.lang.String workerId)Removes the tiling node.voidrestart(java.lang.String jobId)Restarts the tiling jobvoidsetComponentContext(ComponentContext context)Sets the service component context information.voidsetJobInfoPREProcessor(JobInfoPREProcessor processor)Sets the tiling Job PreprocessorvoidsetJobRunnerFactory(JobRunnerFactory factory)Sets the tile operator factoryvoidsetRestContext(RestContext value)Sets the Rest context information.voidsetTileWorkerClientFactory(TileWorkerClientFactory value)Binds the child node generator.voidstartJob(java.lang.String jobId)Starts the tiling jobvoidstopJob(java.lang.String jobId)Stops the tiling jobvoidupdateBlankRegion(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 informationvoidworkerQuit(TileWorkerInfo conInfo)Notifies the tiling master node that the tiling task Has been withdrawn.
-
-
-
Method Detail
-
redeployJobToWorker
public void redeployJobToWorker(java.lang.String jobId, java.lang.String workerId)Description copied from interface:TileMasterWhen deploying a tiling task to a worker fails, it is used for redeployment.
- Specified by:
redeployJobToWorkerin interfaceTileMaster- Parameters:
jobId- The task id needs to be redeployed.workerId- Needs to redeploy the worker's id.
-
setRestContext
public void setRestContext(RestContext value)
Sets the Rest context information.
- Parameters:
value-
-
addTileWorker
public boolean addTileWorker(TileWorkerInfo connInfo)
Adds the tiling node.
- Specified by:
addTileWorkerin interfaceTileMaster- Parameters:
conInfo-- Returns:
- Since:
- 6.1.3
-
removeTileWorker
public void removeTileWorker(java.lang.String workerId)
Removes the tiling node.
- Specified by:
removeTileWorkerin interfaceTileMaster- Parameters:
workerId-- Since:
- 6.1.3
-
workerQuit
public void workerQuit(TileWorkerInfo conInfo)
Notifies the tiling master node that the tiling task Has been withdrawn.
- Specified by:
workerQuitin interfaceTileMaster- Parameters:
conInfo-- Since:
- 6.1.3
-
stopJob
public void stopJob(java.lang.String jobId)
Stops the tiling job
- Specified by:
stopJobin interfaceTileMaster- Parameters:
jobId-- Since:
- 6.1.3
-
startJob
public void startJob(java.lang.String jobId)
Starts the tiling job
- Specified by:
startJobin interfaceTileMaster- Parameters:
jobId-- Since:
- 6.1.3
-
restart
public void restart(java.lang.String jobId)
Restarts the tiling job
- Specified by:
restartin interfaceTileMaster- Parameters:
jobId-- Since:
- 6.1.3
-
addJob
public TileJob addJob(JobInfo jobInfo)
Creates a tiling job
- Specified by:
addJobin interfaceTileMaster- Parameters:
l-- Returns:
- Since:
- 6.1.3
-
handleUserDefinedInfo
public TileSourceInfo handleUserDefinedInfo(TileSourceInfo info)
Gets the tile source information in the TileSource container.
- Parameters:
l-- Returns:
-
setJobInfoPREProcessor
public void setJobInfoPREProcessor(JobInfoPREProcessor processor)
Sets the tiling Job Preprocessor
- Specified by:
setJobInfoPREProcessorin interfaceTileMaster- Parameters:
processor-- Since:
- 6.1.3
-
setJobRunnerFactory
public void setJobRunnerFactory(JobRunnerFactory factory)
Sets the tile operator factory
- Specified by:
setJobRunnerFactoryin interfaceTileMaster- Parameters:
factory-- Since:
- 6.1.3
-
getTileJobs
public java.util.List<TileJob> getTileJobs()
Returns all tiling job information
- Specified by:
getTileJobsin interfaceTileMaster- Returns:
- All tiling job information
- Since:
- 6.1.3
-
getTileJob
public TileJob getTileJob(java.lang.String jobID)
Returns a named tiling job information
- Specified by:
getTileJobin interfaceTileMaster- Parameters:
jobID- Tiling task ID.- Returns:
- The tiling task information for the specified ID
- Since:
- 6.1.3
-
notifyJobDeployCompleted
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
- Specified by:
notifyJobDeployCompletedin interfaceTileMaster- Parameters:
jobId- Tiling task ID.workerId- Tiling node ID.- Returns:
- Since:
- 7.1.1
-
notifyTaskCompleted
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.
- Specified by:
notifyTaskCompletedin interfaceTileMaster- Parameters:
jobId- Tiling task ID.taskId- Unit tiling task ID. SeeTileTaskfor unit tiling tasks.workerId- The TileWorker ID of performing the unit task.- Returns:
- Whether to complete the notice.
- Since:
- 6.1.3
-
notifyTaskFailed
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.
- Specified by:
notifyTaskFailedin interfaceTileMaster- Parameters:
jobId- Tiling task ID.taskId- Unit tiling task ID. SeeTileTaskfor unit tiling tasks.workerId- The TileWorker ID of performing the unit task.- Returns:
- Whether to complete the notice.
- Since:
- 6.1.3
-
deleteJob
public boolean deleteJob(java.lang.String jobID)
Deletes the tiling task
- Specified by:
deleteJobin interfaceTileMaster- Parameters:
jobID- Pre-deleted tiling task ID.- Returns:
- Whether it is deleted successfully or not. True for deletion successful.
- Since:
- 6.1.3
-
notifyTaskCompleted
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.
- Specified by:
notifyTaskCompletedin interfaceTileMaster- Parameters:
jobId-taskId-workerId-result-- Returns:
- Since:
- 6.1.3
-
analystBlankTile
public void analystBlankTile(java.lang.String jobId)
Notifies a named tiling job began to analysis the white chart information
- Specified by:
analystBlankTilein interfaceTileMaster- Parameters:
jobId-- Since:
- 6.1.3
-
getBlankTileInfos
public BlankTileInfo getBlankTileInfos(java.lang.String jobId, double scale, int fromIndex, int toIndex)
Returns all the white chart information
- Specified by:
getBlankTileInfosin interfaceTileMaster- Parameters:
jobId-scale-fromIndex-toIndex-- Returns:
- Since:
- 6.1.3
-
updateBlankRegion
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
- Specified by:
updateBlankRegionin interfaceTileMaster- Parameters:
jobId-scale-invalidRegionIds-validRegionIds-noneMarkedRegionIds-markAllInvalid-markedAllValid-- Since:
- 6.1.3
-
confirmBlanRegionInfos
public java.lang.String confirmBlanRegionInfos(java.lang.String jobId)
Confirm the white block information. After confirmation, TileServer will create a new job to start reshaping the white area.- Specified by:
confirmBlanRegionInfosin interfaceTileMaster- Parameters:
jobId-- Returns:
- New created JobId.
- Since:
- 6.1.3
-
getWorkerStates
public TileWorkerState[] getWorkerStates()
Returns the status of all tiling nodes.
- Specified by:
getWorkerStatesin interfaceTileMaster- Returns:
- Since:
- 6.1.3
-
getWorkerState
public TileWorkerState getWorkerState(java.lang.String workerId)
Returns the state of a named tiling node
- Specified by:
getWorkerStatein interfaceTileMaster- Parameters:
workerId-- Returns:
- Since:
- 6.1.3
-
setTileWorkerClientFactory
public void setTileWorkerClientFactory(TileWorkerClientFactory value)
Binds the child node generator.
- Parameters:
value-
-
dispose
public void dispose()
Release resources.
- Specified by:
disposein interfaceDisposable
-
setComponentContext
public void setComponentContext(ComponentContext context)
Sets the service component context information.
- Specified by:
setComponentContextin interfaceComponentContextAware- Parameters:
context-
-
addJob
protected TileJob addJob(JobBuildConfig processed, JobState state)
-
initJobRunner
protected JobRunner initJobRunner(JobBuildConfig processed, JobState state, boolean completed)
-
initTileJob
protected TileJob initTileJob(JobBuildConfig processed, JobRunner runner)
-
-