MCPcopy Create free account
hub / github.com/apache/storm / doInnerJoin

Method doInnerJoin

storm-client/src/jvm/org/apache/storm/bolt/JoinBolt.java:250–268  ·  view source on GitHub ↗
(JoinAccumulator probe, Map<Object, ArrayList<Tuple>> buildInput, JoinInfo joinInfo,
                                          boolean finalJoin)

Source from the content-addressed store, hash-verified

248
249 // inner join - core implementation
250 protected JoinAccumulator doInnerJoin(JoinAccumulator probe, Map<Object, ArrayList<Tuple>> buildInput, JoinInfo joinInfo,
251 boolean finalJoin) {
252 String[] probeKeyName = joinInfo.getOtherField();
253 JoinAccumulator result = new JoinAccumulator();
254 FieldSelector fieldSelector = new FieldSelector(joinInfo.other.getStreamName(), probeKeyName);
255 for (ResultRecord rec : probe.getRecords()) {
256 Object probeKey = rec.getField(fieldSelector);
257 if (probeKey != null) {
258 ArrayList<Tuple> matchingBuildRecs = buildInput.get(probeKey);
259 if (matchingBuildRecs != null) {
260 for (Tuple matchingRec : matchingBuildRecs) {
261 ResultRecord mergedRecord = new ResultRecord(rec, matchingRec, finalJoin);
262 result.insert(mergedRecord);
263 }
264 }
265 }
266 }
267 return result;
268 }
269
270 // left join - core implementation
271 protected JoinAccumulator doLeftJoin(JoinAccumulator probe, Map<Object, ArrayList<Tuple>> buildInput, JoinInfo joinInfo,

Callers 1

doJoinMethod · 0.95

Calls 6

insertMethod · 0.95
getOtherFieldMethod · 0.80
getRecordsMethod · 0.80
getMethod · 0.65
getStreamNameMethod · 0.45
getFieldMethod · 0.45

Tested by

no test coverage detected