-
Notifications
You must be signed in to change notification settings - Fork 748
[GOBBLIN-1952] Make jobname shortening in GaaS more aggressive #3822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ | |
| public class JobExecutionPlan { | ||
| public static final String JOB_MAX_ATTEMPTS = "job.maxAttempts"; | ||
| public static final String JOB_PROPS_KEY = "job.props"; | ||
| private static final int MAX_JOB_NAME_LENGTH = 255; | ||
| private static final int MAX_JOB_NAME_LENGTH = 128; | ||
|
|
||
| private final JobSpec jobSpec; | ||
| private final SpecExecutor specExecutor; | ||
|
|
@@ -112,10 +112,10 @@ private static JobSpec buildJobSpec(FlowSpec flowSpec, Config jobConfig, Long fl | |
| // job names are assumed to be unique within a dag. | ||
| int hash = flowInputPath.hashCode(); | ||
| jobName = Joiner.on(JOB_NAME_COMPONENT_SEPARATION_CHAR).join(flowGroup, flowName, jobName, edgeId, hash); | ||
| // jobNames are commonly used as a directory name, which is limited to 255 characters | ||
| // jobNames are commonly used as a directory name, which is limited to 255 characters (account for potential prefixes added/file name lengths) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if (jobName.length() >= MAX_JOB_NAME_LENGTH) { | ||
| // shorten job length to be 128 characters (flowGroup) + (hashed) flowName, hashCode length | ||
| jobName = Joiner.on(JOB_NAME_COMPONENT_SEPARATION_CHAR).join(flowGroup, flowName.hashCode(), hash); | ||
| // shorten job length but make it uniquely identifiable in multihop flows or concurrent jobs, max length 139 characters (128 flow group + hash) | ||
| jobName = Joiner.on(JOB_NAME_COMPONENT_SEPARATION_CHAR).join(flowGroup, jobName.hashCode()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we avoid doing hash two times?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it will only be done on long flow names so it should be fine, I wanted to get a hash of the jobName and not reuse the prior hash so that it can cover scenarios where there is the same input path in a multi hop flow with multiple edges |
||
| } | ||
| JobSpec.Builder jobSpecBuilder = JobSpec.builder(jobSpecURIGenerator(flowGroup, jobName, flowSpec)).withConfig(jobConfig) | ||
| .withDescription(flowSpec.getDescription()).withVersion(flowSpec.getVersion()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we still hash this one or use the whole path in jobName and then only hash that? Similar to Arjun's comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't reuse that hash because it prevents collisions where flows with the same jobnames within edges. Since we hash this string, it helps the second hash be unique as well to not run into the same scenario