You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/11/15 12:30:57 UTC

[GitHub] [shardingsphere-elasticjob] johnny2002 edited a comment on issue #1720: Customize the JobInstance

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.
   
   Sine JobInstance is expose 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.
   
   ```java
   public Map<JobInstance, List<Integer>> sharding(final List<JobInstance> jobInstances, final String jobName, final int shardingTotalCount) {
   ```
   
   


----------------------------------------------------------------
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:
users@infra.apache.org