songxiaosheng commented on issue #2190:
URL:
https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463580814
Why there is no sharding information "sharding item for job"? There may be
the following situations:
You can refer to the following code:
jobFacade.getShardingContexts();
```
public ShardingContexts getShardingContexts() {
boolean isFailover = configService.load(true).isFailover();
if (isFailover) {
List<Integer> failoverShardingItems =
failoverService.getLocalFailoverItems();
if (!failoverShardingItems.isEmpty()) {
return
executionContextService.getJobShardingContext(failoverShardingItems);
}
}
shardingService.shardingIfNecessary();
List<Integer> shardingItems =
shardingService.getLocalShardingItems();
if (isFailover) {
shardingItems.removeAll(failoverService.getLocalTakeOffItems());
}
shardingItems.removeAll(executionService.getDisabledItems(shardingItems));
return executionContextService.getJobShardingContext(shardingItems);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]