@Override public Long writeBinaryMapping(ByteBuffer binaryKey, ByteBuffer binaryValue, int pojoHash, int metadata) { return writeMappingBuffers(binaryKey, binaryValue, pojoHash); }
@Override public Long writeBinaryMapping(ByteBuffer binaryKey, ByteBuffer binaryValue, int pojoHash, int metadata) { return writeMappingBuffers(binaryKey, binaryValue, pojoHash); }
protected Long writeMappingBuffersGathering(ByteBuffer[] keyBuffers, ByteBuffer[] valueBuffers, int hash) { return writeMappingBuffers(aggregate(keyBuffers), aggregate(valueBuffers), hash); }
protected Long writeMappingBuffersGathering(ByteBuffer[] keyBuffers, ByteBuffer[] valueBuffers, int hash) { return writeMappingBuffers(aggregate(keyBuffers), aggregate(valueBuffers), hash); }
@Override public final Long writeMapping(K key, V value, int hash, int metadata) { Long result; if (lastMapping != null && lastMapping.getKey() == key && lastMapping.getValue() == value) { result = writeMappingBuffers(lastMapping.getEncodedKey(), lastMapping.getEncodedValue(), hash); } else { ByteBuffer keyBuffer = keyPortability.encode(key); ByteBuffer valueBuffer = valuePortability.encode(value); result = writeMappingBuffers(keyBuffer.duplicate(), valueBuffer.duplicate(), hash); lastMapping = new CachedEncode<>(key, value, keyBuffer, valueBuffer, result); } if (result != null) { fireWritten(key, value, lastMapping.getEncodedKey(), lastMapping.getEncodedValue(), hash, metadata, result); } return result; }
@Override public final Long writeMapping(K key, V value, int hash, int metadata) { Long result; if (lastMapping != null && lastMapping.getKey() == key && lastMapping.getValue() == value) { result = writeMappingBuffers(lastMapping.getEncodedKey(), lastMapping.getEncodedValue(), hash); } else { ByteBuffer keyBuffer = keyPortability.encode(key); ByteBuffer valueBuffer = valuePortability.encode(value); result = writeMappingBuffers(keyBuffer.duplicate(), valueBuffer.duplicate(), hash); lastMapping = new CachedEncode<>(key, value, keyBuffer, valueBuffer, result); } if (result != null) { fireWritten(key, value, lastMapping.getEncodedKey(), lastMapping.getEncodedValue(), hash, metadata, result); } return result; }