in ingestion-beam/src/main/java/com/mozilla/telemetry/options/SinkOptions.java [331:345]
static void validateSinkOptions(SinkOptions options) {
List<String> errorMessages = new ArrayList<>();
if (options.getOutputType() == OutputType.bigquery
&& options.getBqWriteMethod() == BigQueryWriteMethod.file_loads
&& options.getInputType() == InputType.pubsub && options.getBqNumFileShards() == 0) {
errorMessages.add("Missing required parameter:"
+ " --outputNumShards must be set to an explicit non-zero value when"
+ " --outputType=bigquery and --bqWriteMethod=file_loads and the input is unbounded"
+ " (--inputType=pubsub)");
}
if (!errorMessages.isEmpty()) {
throw new IllegalArgumentException(
"Configuration errors found!\n* " + String.join("\n* ", errorMessages));
}
}