Skip to content
Open
Show file tree
Hide file tree
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 @@ -20,5 +20,6 @@ public enum SinkType {
BIGQUERY,
BIGTABLE,
MONGODB,
MAXCOMPUTE
MAXCOMPUTE,
KAFKA
}
10 changes: 10 additions & 0 deletions src/main/java/com/gotocompany/firehose/sink/SinkFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import com.gotocompany.depot.config.BigQuerySinkConfig;
import com.gotocompany.depot.config.BigTableSinkConfig;
import com.gotocompany.depot.config.HttpSinkConfig;
import com.gotocompany.depot.config.KafkaSinkConfig;
import com.gotocompany.depot.config.RedisSinkConfig;
import com.gotocompany.depot.http.HttpSink;
import com.gotocompany.depot.kafka.KafkaSink;
import com.gotocompany.depot.kafka.KafkaSinkFactory;
import com.gotocompany.depot.log.LogSink;
import com.gotocompany.depot.log.LogSinkFactory;
import com.gotocompany.depot.maxcompute.MaxComputeSink;
Expand Down Expand Up @@ -49,6 +52,7 @@ public class SinkFactory {
private RedisSinkFactory redisSinkFactory;
private com.gotocompany.depot.http.HttpSinkFactory httpv2SinkFactory;
private MaxComputeSinkFactory maxComputeSinkFactory;
private com.gotocompany.depot.kafka.KafkaSinkFactory kafkaSinkFactory;

public SinkFactory(KafkaConsumerConfig kafkaConsumerConfig,
StatsDReporter statsDReporter,
Expand Down Expand Up @@ -111,6 +115,10 @@ public void init() {
maxComputeSinkFactory = new MaxComputeSinkFactory(statsDReporter, stencilClient, config);
maxComputeSinkFactory.init();
return;
case KAFKA:
kafkaSinkFactory = new com.gotocompany.depot.kafka.KafkaSinkFactory(config, statsDReporter);
kafkaSinkFactory.init();
return;
default:
throw new ConfigurationException("Invalid Firehose SINK_TYPE");
}
Expand Down Expand Up @@ -148,6 +156,8 @@ public Sink getSink() {
return new GenericSink(new FirehoseInstrumentation(statsDReporter, HttpSink.class), sinkType.name(), httpv2SinkFactory.create());
case MAXCOMPUTE:
return new GenericSink(new FirehoseInstrumentation(statsDReporter, MaxComputeSink.class), sinkType.name(), maxComputeSinkFactory.create());
case KAFKA:
return new GenericSink(new FirehoseInstrumentation(statsDReporter, KafkaSink.class), sinkType.name(), kafkaSinkFactory.create());
default:
throw new ConfigurationException("Invalid Firehose SINK_TYPE");
}
Expand Down
Loading