/** * Checks that mFrame is defined and returns it. * * @throws UnpositionedCursorException if unpositioned */ private _CursorFrame frame() { _CursorFrame frame = mFrame; ViewUtils.positionCheck(frame); return frame; }
/** * Checks that leaf is defined and returns it. */ private CursorFrame leaf() { CursorFrame leaf = mLeaf; ViewUtils.positionCheck(leaf); return leaf; }
/** * Checks that leaf is defined and returns it. */ private _CursorFrame leaf() { _CursorFrame leaf = mLeaf; ViewUtils.positionCheck(leaf); return leaf; }
/** * Checks that leaf is defined and returns it. */ private _CursorFrame leaf() { _CursorFrame leaf = mLeaf; ViewUtils.positionCheck(leaf); return leaf; }
/** * Checks that mFrame is defined and returns it. * * @throws UnpositionedCursorException if unpositioned */ private CursorFrame frame() { CursorFrame frame = mFrame; ViewUtils.positionCheck(frame); return frame; }
/** * Checks that leaf is defined and returns it. */ private CursorFrame leaf() { CursorFrame leaf = mLeaf; ViewUtils.positionCheck(leaf); return leaf; }
@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 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 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); }
@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 LockResult load() throws IOException { final byte[] tkey = mKey; ViewUtils.positionCheck(tkey); if (mSource.key() == null) { throw TransformedView.fail(); } mValue = NOT_LOADED; return transformCurrent(mSource.load(), tkey); }
@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; }
private LockResult load(boolean autoload) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); return perform(txn -> { alignKeys(key); final boolean original = autoload(autoload); try { LockResult result = select(txn); return result == null ? LockResult.UNOWNED : result; } finally { autoload(original); } }); }
@Override public final void commit(byte[] value) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); try { LocalTransaction txn = mTxn; if (txn == null) { txn = mTree.mDatabase.newAlwaysRedoTransaction(); try { doCommit(true, txn, key, value); } catch (Throwable e) { txn.reset(); throw e; } } else { doCommit(txn.durabilityMode() != DurabilityMode.NO_REDO, txn, key, value); } } catch (Throwable e) { throw handleException(e, false); } } }
@Override public void commit(byte[] value) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); try { final _LocalTransaction txn = mTxn; if (txn == null) { final _Locker locker = mTree.lockExclusiveLocal(key, keyHash()); try { store(txn, leafExclusive(), value); } finally { locker.unlock(); } } else { doCommit(txn, key, value); } } catch (Throwable e) { throw handleException(e, false); } }
@Override public void commit(byte[] value) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); try { final _LocalTransaction txn = mTxn; if (txn == null) { final _Locker locker = mTree.lockExclusiveLocal(key, keyHash()); try { store(txn, leafExclusive(), value); } finally { locker.unlock(); } } else { doCommit(false, txn, key, value); } } catch (Throwable e) { throw handleException(e, false); } }
@Override public void commit(byte[] value) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); try { final LocalTransaction txn = mTxn; if (txn == null) { final Locker locker = mTree.lockExclusiveLocal(key, keyHash()); try { store(txn, leafExclusive(), value); } finally { locker.unlock(); } } else { doCommit(false, txn, key, value); } } catch (Throwable e) { throw handleException(e, false); } }