johnny2002 edited a comment on issue #1720:
URL: 
https://github.com/apache/shardingsphere-elasticjob/issues/1720#issuecomment-727560738


   > @johnny2002 Hi, thank you for the suggestion.
   > I want discuss further.
   > Job instance id is internal impl in elastic job which user should not 
focus on them.
   > It is not a good idea to expose lots of internal impl to special reason.
   > 
   > Can you consider about reuse the job sharding strategy to rebalance your 
sub-job?
   
   H Terry,
   
   Of course I want to use my own sharding strategy to assign sub-job, while, 
the job strategy api passed in a list of instances, I need to exactly identify 
the jobinstance, so that I can assign corresponding sub-job to correct 
jobInstance. In my application, JobInstances are not equivalent.  **Each 
jobinstance only has the resource to handle 1 or 2 specific sub-jobs.** e.g. 
JobInstance from unit 1 can only handle sub-job1 or sub-job2, CANNOT handle 
other sub-jobs.
   
    Since JobInstance is exposed in JobShardingStrategy api, I don't think it 
is an internal impl.
   
   
   My sharding strategy is:
   sub-job1 assign to jobInstance 1(or you can say Jobexecutor 1)
   sub-job2 assign to jobInstance 2
   ...
   
   in JobShardingStrategy api, I need to identify each jobInstances due to they 
arenot equivalent.
   
   ```java
   public Map<JobInstance, List<Integer>> sharding(final List<JobInstance> 
jobInstances, final String jobName, final int shardingTotalCount) {
   ```
   My problem is that in my JobShardingStrategy impl, I have no way to know 
which JobInstance from which unit.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to