我想在实际运行管道或其内部之前,将数据流的Job ID捕获为字符串。
作为一个例子,假设我有这个:
DataflowOptions options = optionsConst.getOptions();
Pipeline p = Pipeline.create(options);
String jobID = doSomthing(); <-- I'd like to grab the job id here
PCollection<KV<String, Object>> refData = p.apply("BigTable Access", BigtableIO.read()
.withProjectId(options.getBigtableProjectId())
.withInstanceId(options.getBigtableInstanceId())
.withTableId(options.getLookupTableId()))
.apply("Keep tags valid versions", ParDo.of(new MethodThatDoesSomethingWithJobID(**jobId**))); <-- Or inside this