Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.

Commit 8a7f299

Browse files
authored
Add saveProfilesToGcs option; deprecate enableProfilingAgent (#497)
Add saveProfilesToGcs option to DataflowProfilingOptions This option (if present) is verified to be a writeable GCS path during pipeline submission.
1 parent 4e8f101 commit 8a7f299

File tree

4 files changed

+164
-115
lines changed

4 files changed

+164
-115
lines changed

sdk/src/main/java/com/google/cloud/dataflow/sdk/options/DataflowProfilingOptions.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@
2727
@Hidden
2828
public interface DataflowProfilingOptions {
2929

30-
@Description("Whether to periodically dump profiling information to local disk.\n"
31-
+ "WARNING: Enabling this option may fill local disk with profiling information.")
30+
@Description(
31+
"This option is deprecated and ignored. Using --saveProfilesToGcs=<GCS path> is preferred.")
3232
boolean getEnableProfilingAgent();
3333
void setEnableProfilingAgent(boolean enabled);
3434

35+
@Description(
36+
"When set to a non-empty value, enables recording profiles and saving them to GCS.\n"
37+
+ "Profiles will continue until the pipeline is stopped or updated without this option.\n")
38+
String getSaveProfilesToGcs();
39+
void setSaveProfilesToGcs(String gcsPath);
40+
3541
@Description(
3642
"[INTERNAL] Additional configuration for the profiling agent. Not typically necessary.")
3743
@Hidden

sdk/src/main/java/com/google/cloud/dataflow/sdk/runners/DataflowPipelineRunner.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,14 @@ public static DataflowPipelineRunner fromOptions(PipelineOptions options) {
275275
if (dataflowOptions.getTempLocation() != null) {
276276
validator.validateOutputFilePrefixSupported(dataflowOptions.getTempLocation());
277277
}
278+
if (!Strings.isNullOrEmpty(dataflowOptions.getSaveProfilesToGcs())) {
279+
validator.validateOutputFilePrefixSupported(dataflowOptions.getSaveProfilesToGcs());
280+
}
281+
if (dataflowOptions.getEnableProfilingAgent()) {
282+
LOG.error("--enableProfilingAgent is no longer supported, and will be ignored. "
283+
+ "Use --saveProfilesToGcs instead.");
284+
}
285+
278286
if (Strings.isNullOrEmpty(dataflowOptions.getTempLocation())) {
279287
dataflowOptions.setTempLocation(dataflowOptions.getStagingLocation());
280288
} else if (Strings.isNullOrEmpty(dataflowOptions.getStagingLocation())) {

0 commit comments

Comments
 (0)