Skip to content

Commit

Permalink
[BEAM-14488] Alias async flags. (#17711)
Browse files Browse the repository at this point in the history
  • Loading branch information
lostluck authored May 19, 2022
1 parent 47d8bce commit 4689462
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sdks/go/pkg/beam/runners/dataflow/dataflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ var (
workerRegion = flag.String("worker_region", "", "Dataflow worker region (optional)")
workerZone = flag.String("worker_zone", "", "Dataflow worker zone (optional)")

executeAsync = flag.Bool("execute_async", false, "Asynchronous execution. Submit the job and return immediately.")
dryRun = flag.Bool("dry_run", false, "Dry run. Just print the job, but don't submit it.")
teardownPolicy = flag.String("teardown_policy", "", "Job teardown policy (internal only).")

// SDK options
cpuProfiling = flag.String("cpu_profiling", "", "Job records CPU profiles to this GCS location (optional)")
)

func init() {
flag.BoolVar(jobopts.Async, "execute_async", false, "Asynchronous execution. Submit the job and return immediately. Alias of --async.")
}

// flagFilter filters flags that are already represented by the above flags
// or in the JobOpts to prevent them from appearing duplicated
// as PipelineOption display data.
Expand Down Expand Up @@ -207,7 +210,7 @@ func Execute(ctx context.Context, p *beam.Pipeline) (beam.PipelineResult, error)
return nil, nil
}

return dataflowlib.Execute(ctx, model, opts, workerURL, jarURL, modelURL, *endpoint, *executeAsync)
return dataflowlib.Execute(ctx, model, opts, workerURL, jarURL, modelURL, *endpoint, *jobopts.Async)
}

func getJobOptions(ctx context.Context) (*dataflowlib.JobOptions, error) {
Expand Down

0 comments on commit 4689462

Please sign in to comment.