Field constellation for cavern
2 answers
Kafka Spout declared its output fields like any other component. My explanation is based on the current KafkaSpout implementation .
In the KafkaSpout.java class, we see the declareOutputFields method, which calls the getOutputFields () method of the KafkaConfig schema.
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
declarer.declare(_spoutConfig.scheme.getOutputFields());
}
By default, KafkaConfig uses RawMultiScheme , which implements this method this way.
@Override
public Fields getOutputFields() {
return new Fields("bytes");
}
So what does this mean ?, if you declared a bolt that reads tuples from KafkaSpout with fieldGrouping, you know that every tuple that contains equal fields, bytes, will do the same task. If you want to emit any field, you must implement a new circuit for your needs.
+1
source to share