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.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractRuntimeJobState.DeployTaskResult
The result class of deploying tiling tasks.
|
static interface |
AbstractRuntimeJobState.JobStateListener
Task status listener class.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.locks.ReentrantLock |
changeStateLock |
protected JobBuildConfig |
config |
protected JobState |
currentState |
protected AbstractRuntimeJobState.JobStateListener |
listeners |
protected boolean |
stopped |
protected TileRegionStateManager |
tileRegionStateManager |
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 and Description |
---|
AbstractRuntimeJobState(JobState value)
The Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(AbstractRuntimeJobState.JobStateListener listener)
Adds a listener.
|
JobState |
addUpdateTasks(TileTask[] updateTasks)
Adds Unit tiling Task.
|
protected void |
delTask(java.lang.String id) |
AbstractRuntimeJobState.DeployTaskResult |
deployTaskToWorker(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 TileScaleInfo |
getInfoByScale(double scaleDenominator)
Gets the progress of the tiling task progress.
|
protected ScaleBuildConfig |
getScaleBuildConfigByScale(double scaleDenominator) |
JobState |
getState()
Gets all current task status.
|
abstract TileTask |
getTask()
Gets unit tasks.
|
TileTask |
getTaskById(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.
|
JobState |
notifyWorkerDisconnected(java.lang.String workerId)
When the spliting node connection fails, mark the unit tiling task as failed.
|
void |
setConfig(JobBuildConfig value)
Sets the tiling task configuration information.
|
void |
setTileRegionStateManager(TileRegionStateManager tileRegionStateManager)
Sets the tile Region State Manager.
|
JobState |
start()
Start the tiling task.
|
JobState |
stop()
Stop the tiling task.
|
protected void |
updatElapsedTime(JobState result) |
void |
updateProgress(java.util.Map<java.lang.String,java.lang.Long> progress)
Updates the tiling progress.
|
JobState |
updateTaskFailed(TileTask task)
Mark the unit tiling task as failed.
|
abstract JobState |
updateTaskToCompleted(TileTask task)
Updates the current state to reflect the task has been completed.
|
abstract JobState |
updateTaskToCompleted(TileTask task, TileTaskBuildResult taskBuildResult, TileWorkerInfo tileWorkerInfo)
Updates the current state to reflect the task has been completed.
|
equals, hashCode, setTileCountPerTask
protected volatile JobState currentState
protected JobBuildConfig config
protected boolean stopped
protected java.util.concurrent.locks.ReentrantLock changeStateLock
protected TileRegionStateManager tileRegionStateManager
protected AbstractRuntimeJobState.JobStateListener listeners
public AbstractRuntimeJobState(JobState value)
The Constructor.
value
-protected TileScaleInfo getInfoByScale(double scaleDenominator)
Gets the progress of the tiling task progress.
scaleDenominator
-public JobState getState()
Gets all current task status.
public TileTask getTaskById(java.lang.String id)
Gets the unit task throuth ID.
id
-public abstract JobState updateTaskToCompleted(TileTask task, TileTaskBuildResult taskBuildResult, TileWorkerInfo tileWorkerInfo)
Updates the current state to reflect the task has been completed.
task
-public abstract JobState updateTaskToCompleted(TileTask task)
Updates the current state to reflect the task has been completed.
task
-protected void updatElapsedTime(JobState result)
protected void delTask(java.lang.String id)
public abstract TileTask getTask()
Gets unit tasks.
id
-protected ScaleBuildConfig getScaleBuildConfigByScale(double scaleDenominator)
public AbstractRuntimeJobState.DeployTaskResult deployTaskToWorker(TileWorkerClient worker)
Deploys the unit tiling task to the tiling child node.
worker
-public void setConfig(JobBuildConfig value)
Sets the tiling task configuration information.
value
-public JobState updateTaskFailed(TileTask task)
Mark the unit tiling task as failed.
task
-public JobState stop()
Stop the tiling task.
public JobState start()
Start the tiling task.
public JobState notifyWorkerDisconnected(java.lang.String workerId)
When the spliting node connection fails, mark the unit tiling task as failed.
workerId
-public java.util.List<TileTask> getAllTasks()
Gets the list of the unit tiling tasks.
public void updateProgress(java.util.Map<java.lang.String,java.lang.Long> progress)
Updates the tiling progress.
progress
-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.
lostConnection
-public void addListener(AbstractRuntimeJobState.JobStateListener listener)
Adds a listener.
listener
-public JobState addUpdateTasks(TileTask[] updateTasks)
Adds Unit tiling Task.
updateTasks
-protected WorkerBuildingInfo[] mergeWorkerBuildingInfos(WorkerBuildingInfo[] workerBuildingInfos, WorkerBuildingInfo workerInfo)
public void setTileRegionStateManager(TileRegionStateManager tileRegionStateManager)
Sets the tile Region State Manager.
tileRegionStateManager
-