@Override
    public JoinUtil.JoinResult setFromVector(VectorHashKeyWrapperBase kw,
        VectorExpressionWriter[] keyOutputWriters, VectorHashKeyWrapperBatch keyWrapperBatch)
        throws HiveException {
      if (currentKey == null) {
        currentKey = new Object[keyOutputWriters.length];
        vectorKeyOIs = new ArrayList<ObjectInspector>();
        for (int i = 0; i < keyOutputWriters.length; i++) {
          vectorKeyOIs.add(keyOutputWriters[i].getObjectInspector());
        }
      }
      for (int i = 0; i < keyOutputWriters.length; i++) {
        currentKey[i] = keyWrapperBatch.getWritableKeyValue(kw, i, keyOutputWriters[i]);
      }
      key =  MapJoinKey.readFromVector(output, key, currentKey, vectorKeyOIs, !isFirstKey);
      isFirstKey = false;
      this.currentValue = mHash.get(key);
      if (this.currentValue == null) {
        return JoinUtil.JoinResult.NOMATCH;
      }
      else {
        return JoinUtil.JoinResult.MATCH;
      }
    }
Simple wrapper for persistent Hashmap implementing only the put/get/remove/clear interface. The
main memory hash table acts as a cache and all put/get will operate on it first. If the size of
the main memory hash table exceeds a certain threshold, new elements will go into the persistent
hash table.
ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HashMapWrapper.java