@Override
    public long get(ByteBuffer key) throws DigestException {
        ++lookups;
        hashInto(key, hash1);
        // search for the hash of this key by repeated probing until we find the hash we are looking for or we find an empty slot
        int attempt = 0;
        int pos = 0;
        //we need to guard against attempt integer overflow if the map is full
        //limit attempt to number of slots once positionOf(..) enters linear search mode
        int maxAttempts = slots + hashSize - 4;
        do {
            if (attempt >= maxAttempts)
                return -1L;
            pos = positionOf(hash1, attempt);
            bytes.position(pos);
            if (isEmpty(pos))
                return -1L;
            bytes.get(hash2);
            ++attempt;
        } while (!Arrays.equals(hash1, hash2));
        return bytes.getLong();
    }
Get the offset associated with this key.
@param key The key
@return The offset associated with this key or -1 if the key is not found
storage/src/main/java/org/apache/kafka/storage/internals/log/SkimpyOffsetMap.java