use of com.alibaba.jstorm.transactional.TransactionOutputFieldsDeclarer 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()));
}
}
use of com.alibaba.jstorm.transactional.TransactionOutputFieldsDeclarer in project jstorm by alibaba.
the class TransactionBolt method declareOutputFields.
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
TransactionOutputFieldsDeclarer transactionDeclarer = new TransactionOutputFieldsDeclarer();
boltExecutor.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()));
}
if (streams.size() > 0) {
declarer.declareStream(TransactionCommon.BARRIER_STREAM_ID, new Fields(TransactionCommon.BATCH_GROUP_ID_FIELD, TransactionCommon.BARRIER_SNAPSHOT_FIELD));
} else {
isEndBolt = true;
}
}
Aggregations