use of backtype.storm.generated.StreamInfo in project storm by nathanmarz.
the class ClojureBolt method declareOutputFields.
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
for (String stream : _fields.keySet()) {
StreamInfo info = _fields.get(stream);
declarer.declareStream(stream, info.is_direct(), new Fields(info.get_output_fields()));
}
}
use of backtype.storm.generated.StreamInfo in project jstorm by alibaba.
the class WorkerData method generateComponentToStreamToFields.
public HashMap<String, Map<String, Fields>> generateComponentToStreamToFields(StormTopology topology) {
HashMap<String, Map<String, Fields>> componentToStreamToFields = new HashMap<String, Map<String, Fields>>();
Set<String> components = ThriftTopologyUtils.getComponentIds(topology);
for (String component : components) {
Map<String, Fields> streamToFieldsMap = new HashMap<String, Fields>();
Map<String, StreamInfo> streamInfoMap = ThriftTopologyUtils.getComponentCommon(topology, component).get_streams();
for (Map.Entry<String, StreamInfo> entry : streamInfoMap.entrySet()) {
String streamId = entry.getKey();
StreamInfo streamInfo = entry.getValue();
streamToFieldsMap.put(streamId, new Fields(streamInfo.get_output_fields()));
}
componentToStreamToFields.put(component, streamToFieldsMap);
}
return componentToStreamToFields;
}
use of backtype.storm.generated.StreamInfo in project jstorm by alibaba.
the class ClojureSpout method declareOutputFields.
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
for (String stream : _fields.keySet()) {
StreamInfo info = _fields.get(stream);
declarer.declareStream(stream, info.is_direct(), new Fields(info.get_output_fields()));
}
}
use of backtype.storm.generated.StreamInfo in project jstorm by alibaba.
the class TransactionOutputFieldsDeclarer method declareStream.
public void declareStream(String streamId, boolean direct, Fields fields) {
if (_fields.containsKey(streamId)) {
throw new IllegalArgumentException("Fields for " + streamId + " already set");
}
List<String> fieldList = new ArrayList<String>();
fieldList.add(TransactionCommon.BATCH_GROUP_ID_FIELD);
fieldList.addAll(fields.toList());
_fields.put(streamId, new StreamInfo(fieldList, direct));
}
use of backtype.storm.generated.StreamInfo in project jstorm by alibaba.
the class TransactionSpout method declareOutputFields.
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
declarer.declareStream(TransactionCommon.BARRIER_STREAM_ID, new Fields(TransactionCommon.BATCH_GROUP_ID_FIELD, TransactionCommon.BARRIER_SNAPSHOT_FIELD));
TransactionOutputFieldsDeclarer transactionDeclarer = new TransactionOutputFieldsDeclarer();
spoutExecutor.declareOutputFields(transactionDeclarer);
Map<String, StreamInfo> streams = transactionDeclarer.getFieldsDeclaration();
for (Entry<String, StreamInfo> entry : streams.entrySet()) {
String streamName = entry.getKey();
StreamInfo streamInfo = entry.getValue();
declarer.declareStream(streamName, streamInfo.is_direct(), new Fields(streamInfo.get_output_fields()));
}
}
Aggregations