You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "umustafi (via GitHub)" <gi...@apache.org> on 2023/08/15 00:24:44 UTC
[GitHub] [gobblin] umustafi commented on a diff in pull request #3737: [GOBBLIN-1875] Create Unique Trigger Keys
umustafi commented on code in PR #3737:
URL: https://github.com/apache/gobblin/pull/3737#discussion_r1294080873
##########
gobblin-runtime/src/main/java/org/apache/gobblin/scheduler/JobScheduler.java:
##########
@@ -586,9 +587,13 @@ public void close() throws IOException {
* Get a {@link org.quartz.Trigger} from the given job configuration properties.
*/
public static Trigger createTriggerForJob(JobKey jobKey, Properties jobProps) {
- // Build a trigger for the job with the given cron-style schedule
+ Random random = new Random();
+ /*
+ Build a trigger for the job with the given cron-style schedule
+ Append a random integer to job name to be able to add multiple triggers associated with the same job.
+ */
return TriggerBuilder.newTrigger()
- .withIdentity(jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY),
+ .withIdentity(jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY) + random.nextInt(1000),
Review Comment:
updated with this!
--
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: dev-unsubscribe@gobblin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org