/** * {@inheritDoc} */ @Override public byte[] key() { return source.key(); }
/** * {@inheritDoc} */ @Override public byte[] key() { return source.key(); }
/** * {@inheritDoc} */ @Override public byte[] key() { return source.key(); }
@Override public byte[] key() { return mSource.key(); }
/** * Compare the current key to the one given. * * @param rkey key to compare to * @return a negative integer, zero, or a positive integer as current key * is less than, equal to, or greater than the rkey. * @throws NullPointerException if current key or rkey is null */ public default int compareKeyTo(byte[] rkey) { byte[] lkey = key(); return Utils.compareUnsigned(lkey, 0, lkey.length, rkey, 0, rkey.length); }
/** * Compare the current key to the one given. * * @param rkey key to compare to * @return a negative integer, zero, or a positive integer as current key * is less than, equal to, or greater than the rkey. * @throws NullPointerException if current key or rkey is null */ public default int compareKeyTo(byte[] rkey) { byte[] lkey = key(); return Utils.compareUnsigned(lkey, 0, lkey.length, rkey, 0, rkey.length); }
private LockFailureException transformCurrent(LockFailureException e) throws IOException { mValue = NOT_LOADED; try { mKey = mTransformer.transformKey(mSource.key(), NOT_LOADED); } catch (Throwable e2) { reset(); throw e2; } return e; }
private LockFailureException transformCurrent(LockFailureException e) throws IOException { mValue = NOT_LOADED; try { mKey = mTransformer.transformKey(mSource.key(), NOT_LOADED); } catch (Throwable e2) { reset(); throw e2; } return e; }
@Override public LockResult lock() throws IOException { if (mKey != null && mSource.key() == null) { throw TransformedView.fail(); } return mSource.lock(); }
@Override public LockResult load() throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); mKey = tkey; mValue = NOT_LOADED; final Cursor c = mSource; return transformCurrent(c.load(), c.key(), tkey); }
@Override public LockResult load() throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); mKey = tkey; mValue = NOT_LOADED; final Cursor c = mSource; return transformCurrent(c.load(), c.key(), tkey); }
private Entry<Long, Object> entryAt(final Cursor cursor) throws IOException { if (cursor.autoload() == false) { cursor.load(); } long timestamp = TuplUtils.decodeLong(cursor.key()); byte[] data = cursor.value(); Object commitMetadata = this.deserialize(data); return Pair.of(timestamp, commitMetadata); }
private Entry<Long, Object> entryAt(final Cursor cursor) throws IOException { if (cursor.autoload() == false) { cursor.load(); } long timestamp = TuplUtils.decodeLong(cursor.key()); byte[] data = cursor.value(); Object commitMetadata = this.deserialize(data); return Pair.of(timestamp, commitMetadata); }
@Override public void commit(final byte[] tvalue) throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); final Cursor c = mSource; final byte[] key = c.key(); if (key == null) { throw TransformedView.fail(); } c.commit(mTransformer.inverseTransformValue(tvalue, key, tkey)); mValue = tvalue; }
@Override public void commit(final byte[] tvalue) throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); final Cursor c = mSource; final byte[] key = c.key(); ViewUtils.positionCheck(key); c.commit(mTransformer.inverseTransformValue(tvalue, key, tkey)); mValue = tvalue; }
@Override public void store(final byte[] tvalue) throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); final Cursor c = mSource; final byte[] key = c.key(); if (key == null) { throw TransformedView.fail(); } c.store(mTransformer.inverseTransformValue(tvalue, key, tkey)); mValue = tvalue; }
@Override public void commit(final byte[] tvalue) throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); final Cursor c = mSource; final byte[] key = c.key(); ViewUtils.positionCheck(key); c.commit(mTransformer.inverseTransformValue(tvalue, key, tkey)); mValue = tvalue; }
@Override public void store(final byte[] tvalue) throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); final Cursor c = mSource; final byte[] key = c.key(); ViewUtils.positionCheck(key); c.store(mTransformer.inverseTransformValue(tvalue, key, tkey)); mValue = tvalue; }
@Override public void store(final byte[] tvalue) throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); final Cursor c = mSource; final byte[] key = c.key(); ViewUtils.positionCheck(key); c.store(mTransformer.inverseTransformValue(tvalue, key, tkey)); mValue = tvalue; }