public class JobFacade extends Object
| 构造器和说明 |
|---|
JobFacade(CoordinatorRegistryCenter coordinatorRegistryCenter,
JobConfiguration jobConfiguration,
List<ElasticJobListener> elasticJobListeners) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterJobExecuted(JobExecutionMultipleShardingContext shardingContext)
作业执行后的执行的方法.
|
void |
beforeJobExecuted(JobExecutionMultipleShardingContext shardingContext)
作业执行前的执行的方法.
|
void |
checkMaxTimeDiffSecondsTolerable()
检查本机与注册中心的时间误差秒数是否在允许范围.
|
void |
clearMisfire(List<Integer> shardingItems)
清除任务被错过执行的标记.
|
void |
failoverIfNecessary()
如果需要失效转移, 则设置作业失效转移.
|
int |
getConcurrentDataProcessThreadCount()
获取同时处理数据的并发线程数.
|
String |
getJobName()
获取作业名称.
|
JobExecutionMultipleShardingContext |
getShardingContext()
获取当前作业服务器运行时分片上下文.
|
boolean |
isEligibleForJobRunning()
判断作业是否符合继续运行的条件.
|
boolean |
isExecuteMisfired(List<Integer> shardingItems)
判断作业是否需要执行错过的任务.
|
boolean |
isNeedSharding()
判断是否需要重分片.
|
boolean |
misfireIfNecessary(List<Integer> shardingItems)
设置任务被错过执行的标记.
|
void |
registerJobBegin(JobExecutionMultipleShardingContext shardingContext)
注册作业启动信息.
|
void |
registerJobCompleted(JobExecutionMultipleShardingContext shardingContext)
注册作业完成信息.
|
void |
updateOffset(int item,
String offset)
更新数据处理位置.
|
public JobFacade(CoordinatorRegistryCenter coordinatorRegistryCenter, JobConfiguration jobConfiguration, List<ElasticJobListener> elasticJobListeners)
public String getJobName()
public int getConcurrentDataProcessThreadCount()
不能小于1. 仅ThroughputDataFlow作业有效.
public void checkMaxTimeDiffSecondsTolerable()
public void failoverIfNecessary()
public void registerJobBegin(JobExecutionMultipleShardingContext shardingContext)
shardingContext - 作业运行时分片上下文public void registerJobCompleted(JobExecutionMultipleShardingContext shardingContext)
shardingContext - 作业运行时分片上下文public JobExecutionMultipleShardingContext getShardingContext()
public boolean misfireIfNecessary(List<Integer> shardingItems)
shardingItems - 需要设置错过执行的任务分片项public void clearMisfire(List<Integer> shardingItems)
shardingItems - 需要清除错过执行的任务分片项public boolean isExecuteMisfired(List<Integer> shardingItems)
shardingItems - 任务分片项集合public boolean isEligibleForJobRunning()
如果作业停止或需要重分片则作业将不会继续运行.
public boolean isNeedSharding()
public void updateOffset(int item,
String offset)
item - 分片项offset - 数据处理位置public void beforeJobExecuted(JobExecutionMultipleShardingContext shardingContext)
shardingContext - 分片上下文public void afterJobExecuted(JobExecutionMultipleShardingContext shardingContext)
shardingContext - 分片上下文Copyright © 2016. All rights reserved.