in ingestion-sink/src/main/java/com/mozilla/telemetry/ingestion/sink/config/SinkConfig.java [406:430]
static OutputType get(Env env) {
boolean hasBigQueryOutputMode = env.containsKey(BIG_QUERY_OUTPUT_MODE);
if (env.containsKey(OUTPUT_PIPE)) {
return OutputType.pipe;
} else if (env.containsKey(OUTPUT_BUCKET) && !hasBigQueryOutputMode) {
return OutputType.gcs;
} else if (env.containsKey(OUTPUT_TOPIC) && !hasBigQueryOutputMode) {
return OutputType.pubsub;
} else if (env.containsKey(OUTPUT_TABLE) || hasBigQueryOutputMode) {
final String outputMode = env.getString(BIG_QUERY_OUTPUT_MODE, "streaming").toLowerCase();
switch (outputMode) {
case "streaming":
return OutputType.bigQueryStreaming;
case "mixed":
return OutputType.bigQueryMixed;
case "file_loads":
return OutputType.bigQueryFiles;
default:
throw new IllegalArgumentException("Unsupported BIG_QUERY_OUTPUT_MODE: " + outputMode);
}
} else {
// default to bigQueryLoad because it's the only output without any required configs
return OutputType.bigQueryLoad;
}
}