@Override public byte[] load(final Transaction txn, final byte[] tkey) throws IOException { final byte[] key = inverseTransformKey(tkey); if (key == null) { return null; } if (txn == null || !txn.lockMode().isRepeatable()) { return mTransformer.transformValue(mSource.load(txn, key), key, tkey); } txn.enter(); try { byte[] value = mSource.load(txn, key); if (value == null || (value = mTransformer.transformValue(value, key, tkey)) != null) { // Keep the lock if value doesn't exist or if allowed by transformer. txn.commit(); } return value; } finally { txn.exit(); } }
@Override public byte[] load(final Transaction txn, final byte[] tkey) throws IOException { final byte[] key = inverseTransformKey(tkey); if (key == null) { return null; } if (txn == null || !txn.lockMode().isRepeatable()) { return mTransformer.transformValue(mSource.load(txn, key), key, tkey); } txn.enter(); try { byte[] value = mSource.load(txn, key); if (value == null || (value = mTransformer.transformValue(value, key, tkey)) != null) { // Keep the lock if value doesn't exist or if allowed by transformer. txn.commit(); } return value; } finally { txn.exit(); } }
if (txn == null || !txn.lockMode().isRepeatable()) { return mTransformer.transformValue(mSource.load(txn, key), key, tkey) != null;
if (txn == null || !txn.lockMode().isRepeatable()) { return mTransformer.transformValue(mSource.load(txn, key), key, tkey);