/** * SpoutSpec may be changed, this class will respond to changes on tuple2StreamMetadataMap and streamRepartitionMetadataMap. * * @param spoutSpec * @param sds */ @Override public void update(SpoutSpec spoutSpec, Map<String, StreamDefinition> sds) { this.streamRepartitionMetadataList = spoutSpec.getStreamRepartitionMetadataMap().get(topic); this.converter = new Tuple2StreamConverter(spoutSpec.getTuple2StreamMetadataMap().get(topic)); this.sds = sds; }
/** * @param delegate actual SpoutOutputCollector to send data to following bolts * @param topic topic for this KafkaSpout to handle * @param numGroupbyBolts bolts following this spout. * @param serializer */ public SpoutOutputCollectorWrapper(CorrelationSpout spout, ISpoutOutputCollector delegate, String topic, SpoutSpec spoutSpec, int numGroupbyBolts, Map<String, StreamDefinition> sds, PartitionedEventSerializer serializer, boolean logEventEnabled) { super(delegate); this.spout = spout; this.delegate = delegate; this.topic = topic; this.streamRepartitionMetadataList = spoutSpec.getStreamRepartitionMetadataMap().get(topic); this.converter = new Tuple2StreamConverter(spoutSpec.getTuple2StreamMetadataMap().get(topic)); this.numOfRouterBolts = numGroupbyBolts; this.sds = sds; this.serializer = serializer; this.logEventEnabled = logEventEnabled; }