@Override
    public void put(ByteBuffer key, long offset) throws DigestException {
        if (entries >= slots)
            throw new IllegalArgumentException("Attempted to add a new entry to a full offset map, "
                + "entries: " + entries + ", slots: " + slots);

        ++lookups;
        hashInto(key, hash1);

        // probe until we find the first empty slot
        int attempt = 0;
        int pos = positionOf(hash1, attempt);
        while (!isEmpty(pos)) {
            bytes.position(pos);
            bytes.get(hash2);
            if (Arrays.equals(hash1, hash2)) {
                // we found an existing entry, overwrite it and return (size does not change)
                bytes.putLong(offset);
                lastOffset = offset;
                return;
            }
            ++attempt;
            pos = positionOf(hash1, attempt);
        }

        // found an empty slot, update it - size grows by 1
        bytes.position(pos);
        bytes.put(hash1);
        bytes.putLong(offset);
        lastOffset = offset;
        ++entries;
    }
Associate this offset to the given key.
@param key The key
@param offset The offset
storage/src/main/java/org/apache/kafka/storage/internals/log/SkimpyOffsetMap.java