use of org.apache.storm.trident.tuple.TridentTuple.Factory in project storm by apache.
the class MultiReducerProcessor method prepare.
@Override
public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) {
List<Factory> parents = tridentContext.getParentTupleFactories();
_context = tridentContext;
_streamToIndex = new HashMap<>();
List<String> parentStreams = tridentContext.getParentStreams();
for (int i = 0; i < parentStreams.size(); i++) {
_streamToIndex.put(parentStreams.get(i), i);
}
_projectionFactories = new ProjectionFactory[_projectFields.size()];
for (int i = 0; i < _projectFields.size(); i++) {
_projectionFactories[i] = new ProjectionFactory(parents.get(i), _projectFields.get(i));
}
_collector = new FreshCollector(tridentContext);
_reducer.prepare(conf, new TridentMultiReducerContext((List) Arrays.asList(_projectionFactories)));
}
Aggregations