Class AbstractRuntimeJobState
- java.lang.Object
-
- com.supermap.services.components.commontypes.JobState
-
- com.supermap.services.components.AbstractRuntimeJobState
-
- Direct Known Subclasses:
- CloudRuntimeJobState
public abstract class AbstractRuntimeJobState extends JobState
Runtime tiling job state info class. Responsibilities include
1, Split of tiling task 2, when tiling sub-node task completed or failed, the tiling state is automatically updated
3, Sub-node state management etc.- Since:
- 6.1.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classAbstractRuntimeJobState.DeployTaskResultThe result class of deploying tiling tasks.static interfaceAbstractRuntimeJobState.JobStateListenerTask status listener class.
-
Field Summary
Fields Modifier and Type Field and Description protected java.util.concurrent.locks.ReentrantLockchangeStateLockprotected JobBuildConfigconfigprotected JobStatecurrentStateprotected AbstractRuntimeJobState.JobStateListenerlistenersprotected booleanstoppedprotected TileRegionStateManagertileRegionStateManager-
Fields inherited from class com.supermap.services.components.commontypes.JobState
analystBlankPercentage, buildingScale, completed, completedBytes, completedScale, dataPreProcessBuildConfig, dataPreProcessState, deployedCompleted, deployedTotal, deployedWorkerInfo, deployingDataWorkerInfo, elapsedTime, masterAddress, noFeaturesTileCount, pureColorTileCount, remainTime, runState, scaleConfigs, scaleInfos, speedPerSecond, startTime, tasks, tasksToRetry, tileMatrixEdgeCount, total
-
-
Constructor Summary
Constructors Constructor and Description AbstractRuntimeJobState(JobState value)The Constructor.
-
Method Summary
Methods Modifier and Type Method and Description voidaddListener(AbstractRuntimeJobState.JobStateListener listener)Adds a listener.JobStateaddUpdateTasks(TileTask[] updateTasks)Adds Unit tiling Task.protected voiddelTask(java.lang.String id)AbstractRuntimeJobState.DeployTaskResultdeployTaskToWorker(TileWorkerClient worker)Deploys the unit tiling task to the tiling child node.java.util.List<TileTask>getAllTasks()Gets the list of the unit tiling tasks.protected TileScaleInfogetInfoByScale(double scaleDenominator)Gets the progress of the tiling task progress.protected ScaleBuildConfiggetScaleBuildConfigByScale(double scaleDenominator)JobStategetState()Gets all current task status.abstract TileTaskgetTask()Gets unit tasks.TileTaskgetTaskById(java.lang.String id)Gets the unit task throuth ID.protected WorkerBuildingInfo[]mergeWorkerBuildingInfos(WorkerBuildingInfo[] workerBuildingInfos, WorkerBuildingInfo workerInfo)java.util.List<java.lang.String>notifyLostConnectionPerhaps(java.util.Map<java.lang.String,TileTask> lostConnection)Gets the disconnected workID when the unit tiling task is working.JobStatenotifyWorkerDisconnected(java.lang.String workerId)When the spliting node connection fails, mark the unit tiling task as failed.voidsetConfig(JobBuildConfig value)Sets the tiling task configuration information.voidsetTileRegionStateManager(TileRegionStateManager tileRegionStateManager)Sets the tile Region State Manager.JobStatestart()Start the tiling task.JobStatestop()Stop the tiling task.protected voidupdatElapsedTime(JobState result)voidupdateProgress(java.util.Map<java.lang.String,java.lang.Long> progress)Updates the tiling progress.JobStateupdateTaskFailed(TileTask task)Mark the unit tiling task as failed.abstract JobStateupdateTaskToCompleted(TileTask task)Updates the current state to reflect the task has been completed.abstract JobStateupdateTaskToCompleted(TileTask task, TileTaskBuildResult taskBuildResult, TileWorkerInfo tileWorkerInfo)Updates the current state to reflect the task has been completed.-
Methods inherited from class com.supermap.services.components.commontypes.JobState
equals, hashCode, setTileCountPerTask
-
-
-
-
Field Detail
-
currentState
protected volatile JobState currentState
-
config
protected JobBuildConfig config
-
stopped
protected boolean stopped
-
changeStateLock
protected java.util.concurrent.locks.ReentrantLock changeStateLock
-
tileRegionStateManager
protected TileRegionStateManager tileRegionStateManager
-
listeners
protected AbstractRuntimeJobState.JobStateListener listeners
-
-
Constructor Detail
-
AbstractRuntimeJobState
public AbstractRuntimeJobState(JobState value)
The Constructor.
- Parameters:
value-
-
-
Method Detail
-
getInfoByScale
protected TileScaleInfo getInfoByScale(double scaleDenominator)
Gets the progress of the tiling task progress.
- Parameters:
scaleDenominator-- Returns:
-
getState
public JobState getState()
Gets all current task status.
- Returns:
-
getTaskById
public TileTask getTaskById(java.lang.String id)
Gets the unit task throuth ID.
- Parameters:
id-- Returns:
-
updateTaskToCompleted
public abstract JobState updateTaskToCompleted(TileTask task, TileTaskBuildResult taskBuildResult, TileWorkerInfo tileWorkerInfo)
Updates the current state to reflect the task has been completed.
- Parameters:
task-- Returns:
- Since:
- 6.1.3
-
updateTaskToCompleted
public abstract JobState updateTaskToCompleted(TileTask task)
Updates the current state to reflect the task has been completed.
- Parameters:
task-- Returns:
- Since:
- 6.1.3
-
updatElapsedTime
protected void updatElapsedTime(JobState result)
-
delTask
protected void delTask(java.lang.String id)
-
getTask
public abstract TileTask getTask()
Gets unit tasks.
- Parameters:
id-- Returns:
-
getScaleBuildConfigByScale
protected ScaleBuildConfig getScaleBuildConfigByScale(double scaleDenominator)
-
deployTaskToWorker
public AbstractRuntimeJobState.DeployTaskResult deployTaskToWorker(TileWorkerClient worker)
Deploys the unit tiling task to the tiling child node.
- Parameters:
worker-- Returns:
-
setConfig
public void setConfig(JobBuildConfig value)
Sets the tiling task configuration information.
- Parameters:
value-
-
updateTaskFailed
public JobState updateTaskFailed(TileTask task)
Mark the unit tiling task as failed.
- Parameters:
task-- Returns:
-
stop
public JobState stop()
Stop the tiling task.
- Returns:
-
start
public JobState start()
Start the tiling task.
- Returns:
-
notifyWorkerDisconnected
public JobState notifyWorkerDisconnected(java.lang.String workerId)
When the spliting node connection fails, mark the unit tiling task as failed.
- Parameters:
workerId-- Returns:
-
getAllTasks
public java.util.List<TileTask> getAllTasks()
Gets the list of the unit tiling tasks.
- Returns:
-
updateProgress
public void updateProgress(java.util.Map<java.lang.String,java.lang.Long> progress)
Updates the tiling progress.
- Parameters:
progress-
-
notifyLostConnectionPerhaps
public java.util.List<java.lang.String> notifyLostConnectionPerhaps(java.util.Map<java.lang.String,TileTask> lostConnection)
Gets the disconnected workID when the unit tiling task is working.
- Parameters:
lostConnection-- Returns:
-
addListener
public void addListener(AbstractRuntimeJobState.JobStateListener listener)
Adds a listener.
- Parameters:
listener-
-
addUpdateTasks
public JobState addUpdateTasks(TileTask[] updateTasks)
Adds Unit tiling Task.
- Parameters:
updateTasks-- Returns:
-
mergeWorkerBuildingInfos
protected WorkerBuildingInfo[] mergeWorkerBuildingInfos(WorkerBuildingInfo[] workerBuildingInfos, WorkerBuildingInfo workerInfo)
-
setTileRegionStateManager
public void setTileRegionStateManager(TileRegionStateManager tileRegionStateManager)
Sets the tile Region State Manager.
- Parameters:
tileRegionStateManager-
-
-