public long add(byte[] keyBytes, int keyStart, int keyLength) {
    boolean isKeyLengthBig = (keyLength >= SmallKeyLength.threshold);

    long absoluteKeyOffset = writeBuffers.getWritePoint();
    if (isKeyLengthBig) {
      writeBuffers.writeVInt(keyLength);
    }
    writeBuffers.write(keyBytes, keyStart, keyLength);

    long keyRefWord = IsNonZeroFlag.flagOnMask;
    if (isKeyLengthBig) {
      keyRefWord |= SmallKeyLength.allBitsOnBitShifted;
    } else {
      keyRefWord |= ((long) keyLength) << SmallKeyLength.bitShift;
    }
    keyRefWord |= absoluteKeyOffset;

    // LOG.debug("VectorMapJoinFastKeyStore add keyLength " + keyLength + " absoluteKeyOffset " + absoluteKeyOffset + " keyRefWord " + Long.toHexString(keyRefWord));
    return keyRefWord;
  }
Bit-length fields within a 64-bit (long) key reference.

Lowest field: An absolute byte offset the the key in the WriteBuffers.

Next field: For short keys, the length of the key.  Otherwise, a special constant
indicating a big key whose length is stored with the key.

Last field: an always on bit to insure the key reference non-zero when the offset and
length are zero.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/mapjoin/fast/VectorMapJoinFastKeyStore.java