private boolean binaryKeyEquals(ByteBuffer binaryProbeKey, int probeHash, long targetEncoding, int targetHash) { if (storageEngine instanceof BinaryStorageEngine) { return probeHash == targetHash && ((BinaryStorageEngine) storageEngine).equalsBinaryKey(binaryProbeKey, targetEncoding); } else { throw new UnsupportedOperationException("Cannot check binary quality unless configured with a BinaryStorageEngine"); } }
@FindbugsSuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS") private int[] tryInstallEntry(ByteBuffer offheapBinaryKey, int pojoHash, ByteBuffer offheapBinaryValue, int metadata) { if (hashtable == null) { throw new NullPointerException(); } else if (hashtable == DESTROYED_TABLE) { throw new IllegalStateException("Offheap map/cache has been destroyed"); } else if ((metadata & RESERVED_STATUS_BITS) == 0) { Long encoding = ((BinaryStorageEngine) storageEngine).writeBinaryMapping(offheapBinaryKey, offheapBinaryValue, pojoHash, metadata); if (encoding == null) { return null; } else { return createEntry(pojoHash, encoding, metadata); } } else { throw new IllegalArgumentException("Invalid metadata for binary key : " + Integer.toBinaryString(metadata)); } }
@FindbugsSuppressWarnings("PZLA_PREFER_ZERO_LENGTH_ARRAYS") private int[] tryInstallEntry(ByteBuffer offheapBinaryKey, int pojoHash, ByteBuffer offheapBinaryValue, int metadata) { if (hashtable == null) { throw new NullPointerException(); } else if (hashtable == DESTROYED_TABLE) { throw new IllegalStateException("Offheap map/cache has been destroyed"); } else if ((metadata & RESERVED_STATUS_BITS) == 0) { Long encoding = ((BinaryStorageEngine) storageEngine).writeBinaryMapping(offheapBinaryKey, offheapBinaryValue, pojoHash, metadata); if (encoding == null) { return null; } else { return createEntry(pojoHash, encoding, metadata); } } else { throw new IllegalArgumentException("Invalid metadata for binary key : " + Integer.toBinaryString(metadata)); } }
private boolean binaryKeyEquals(ByteBuffer binaryProbeKey, int probeHash, long targetEncoding, int targetHash) { if (storageEngine instanceof BinaryStorageEngine) { return probeHash == targetHash && ((BinaryStorageEngine) storageEngine).equalsBinaryKey(binaryProbeKey, targetEncoding); } else { throw new UnsupportedOperationException("Cannot check binary quality unless configured with a BinaryStorageEngine"); } }