Skip to content

Commit

Permalink
Automatically Switch to upload_graph when the graph is large
Browse files Browse the repository at this point in the history
  • Loading branch information
liferoad committed Sep 22, 2023
1 parent aa2bf58 commit ed10fa1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,14 @@ public DataflowPipelineJob run(Pipeline pipeline) {
hooks.modifyEnvironmentBeforeSubmission(newJob.getEnvironment());
}

// enable upload_graph when the graph is too large
if ((Utf8.encodedLength(newJob.toString()) >= CREATE_JOB_REQUEST_LIMIT_BYTES) &&
!hasExperiment(options, "upload_graph")) {
List<String> experiments = new ArrayList<>(options.getExperiments());
experiments.add("upload_graph");
options.setExperiments(ImmutableList.copyOf(experiments));
}

// Upload the job to GCS and remove the graph object from the API call. The graph
// will be downloaded from GCS by the service.
if (hasExperiment(options, "upload_graph")) {
Expand Down

0 comments on commit ed10fa1

Please sign in to comment.