Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,9 @@ public DataflowPipelineJob run(Pipeline pipeline) {
String fileLocation =
firstNonNull(options.getTemplateLocation(), options.getDataflowJobFile());
checkArgument(
fileLocation.startsWith("/") || fileLocation.startsWith("gs://"),
fileLocation.startsWith("/")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor performance consideration. Considering the ordering:

fileLocation.startsWith("/") || fileLocation.startsWith("gs://") || new File(fileLocation).isAbsolute()

Nowadays most likely it would be a gcs path. Put new the last one avoids new an object each time it's executed

|| new File(fileLocation).isAbsolute()
|| fileLocation.startsWith("gs://"),
"Location must be local or on Cloud Storage, got %s.",
fileLocation);

Expand Down
Loading