use of storm.trident.drpc.ReturnResultsReducer in project storm by nathanmarz.
the class TridentTopology method completeDRPC.
private static void completeDRPC(DefaultDirectedGraph<Node, IndexedEdge> graph, Map<String, List<Node>> colocate, UniqueIdGen gen) {
List<Set<Node>> connectedComponents = new ConnectivityInspector<Node, IndexedEdge>(graph).connectedSets();
for (Set<Node> g : connectedComponents) {
checkValidJoins(g);
}
TridentTopology helper = new TridentTopology(graph, colocate, gen);
for (Set<Node> g : connectedComponents) {
SpoutNode drpcNode = getDRPCSpoutNode(g);
if (drpcNode != null) {
Stream lastStream = new Stream(helper, null, getLastAddedNode(g));
Stream s = new Stream(helper, null, drpcNode);
helper.multiReduce(s.project(new Fields("return-info")).batchGlobal(), lastStream.batchGlobal(), new ReturnResultsReducer(), new Fields());
}
}
}
use of storm.trident.drpc.ReturnResultsReducer in project jstorm by alibaba.
the class TridentTopology method completeDRPC.
private static void completeDRPC(DefaultDirectedGraph<Node, IndexedEdge> graph, Map<String, List<Node>> colocate, UniqueIdGen gen) {
List<Set<Node>> connectedComponents = new ConnectivityInspector<>(graph).connectedSets();
for (Set<Node> g : connectedComponents) {
checkValidJoins(g);
}
TridentTopology helper = new TridentTopology(graph, colocate, gen);
for (Set<Node> g : connectedComponents) {
SpoutNode drpcNode = getDRPCSpoutNode(g);
if (drpcNode != null) {
Stream lastStream = new Stream(helper, null, getLastAddedNode(g));
Stream s = new Stream(helper, null, drpcNode);
helper.multiReduce(s.project(new Fields("return-info")).batchGlobal(), lastStream.batchGlobal(), new ReturnResultsReducer(), new Fields());
}
}
}
Aggregations