use of storm.trident.operation.TridentMultiReducerContext in project storm by nathanmarz.
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<String, Integer>();
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)));
}
use of storm.trident.operation.TridentMultiReducerContext in project storm by nathanmarz.
the class GroupedMultiReducerExecutor method prepare.
@Override
public void prepare(Map conf, TridentMultiReducerContext context) {
for (int i = 0; i < _groupFields.size(); i++) {
_groupFactories.add(context.makeProjectionFactory(i, _groupFields.get(i)));
_inputFactories.add(context.makeProjectionFactory(i, _inputFields.get(i)));
}
_reducer.prepare(conf, new TridentMultiReducerContext((List) _inputFactories));
}
use of storm.trident.operation.TridentMultiReducerContext in project jstorm by alibaba.
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<String, Integer>();
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)));
}
use of storm.trident.operation.TridentMultiReducerContext in project jstorm by alibaba.
the class GroupedMultiReducerExecutor method prepare.
@Override
public void prepare(Map conf, TridentMultiReducerContext context) {
for (int i = 0; i < _groupFields.size(); i++) {
_groupFactories.add(context.makeProjectionFactory(i, _groupFields.get(i)));
_inputFactories.add(context.makeProjectionFactory(i, _inputFields.get(i)));
}
_reducer.prepare(conf, new TridentMultiReducerContext((List) _inputFactories));
}
Aggregations