@Override public boolean isJoinPositionEligible(long currentJoinPosition, int probePosition, Page allProbeChannelsPage) { return lookupSource.isJoinPositionEligible(currentJoinPosition, probePosition, allProbeChannelsPage); }
@Override public boolean isJoinPositionEligible(long currentJoinPosition, int probePosition, Page allProbeChannelsPage) { int partition = decodePartition(currentJoinPosition); long joinPosition = decodeJoinPosition(currentJoinPosition); LookupSource lookupSource = lookupSources[partition]; return lookupSource.isJoinPositionEligible(joinPosition, probePosition, allProbeChannelsPage); }
/** * Produce rows matching join condition for the current probe position. If this method was called previously * for the current probe position, calling this again will produce rows that wasn't been produced in previous * invocations. * * @return true if all eligible rows have been produced; false otherwise */ private boolean joinCurrentPosition(LookupSource lookupSource, DriverYieldSignal yieldSignal) { // while we have a position on lookup side to join against... while (joinPosition >= 0) { if (lookupSource.isJoinPositionEligible(joinPosition, probe.getPosition(), probe.getPage())) { currentProbePositionProducedRow = true; pageBuilder.appendRow(probe, lookupSource, joinPosition); joinSourcePositions++; } // get next position on lookup side for this probe row joinPosition = lookupSource.getNextJoinPosition(joinPosition, probe.getPosition(), probe.getPage()); if (yieldSignal.isSet() || tryBuildPage()) { return false; } } return true; }