public int findNextNonMatched(int currentSlotNum, WriteBuffers.ByteSegmentRef keyRef,
      Result hashMapResult, MatchTracker matchTracker) {
    currentSlotNum++;

    hashMapResult.forget();

    WriteBuffers.Position readPos = hashMapResult.getReadPos();

    while (true) {
      if (currentSlotNum >= refs.length) {

        // No more.
        return -1;
      }
      long ref = refs[currentSlotNum];
      if (ref != 0 && !matchTracker.wasMatched(currentSlotNum)) {

        // An unmatched key.
        writeBuffers.setReadPoint(getFirstRecordLengthsOffset(ref, readPos), readPos);
        int valueLength = (int) writeBuffers.readVLong(readPos);
        int keyLength = (int) writeBuffers.readVLong(readPos);
        long keyOffset = Ref.getOffset(ref) - (valueLength + keyLength);

        keyRef.reset(keyOffset, keyLength);
        if (keyLength > 0) {
          writeBuffers.populateValue(keyRef);
        }

        boolean hasList = Ref.hasList(ref);
        long offsetAfterListRecordKeyLen = hasList ? writeBuffers.getReadPoint(readPos) : 0;

        hashMapResult.set(this, Ref.getOffset(ref), hasList, offsetAfterListRecordKeyLen);

        return currentSlotNum;
      }
      currentSlotNum++;
    }
  }
Finds the next non matched Small Table key and value.  Supports FULL OUTER MapJoin.

@param currentSlotNum  Start by specifying -1; the return index from the previous call.
@param keyRef          If the return value is not -1, a reference to the key bytes.
@param hashMapResult   If the return value is not -1, the key's values.
@param matchTracker    The object that tracks matches (non-shared).
@return The current index of the non-matched key; or -1 if no more.
ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/BytesBytesMultiHashMap.java