public default Cursor newCursorOn(final Index index) { checkNotNull(index, "Precondition violation - argument 'index' must not be NULL!"); return index.newCursor(this.getRawTx()); }
@Override public boolean cursorRegister(long cursorId, long indexId) throws IOException { long scrambledCursorId = mix(cursorId); Index ix = getIndex(indexId); if (ix != null) { _TreeCursor tc = (_TreeCursor) ix.newCursor(Transaction.BOGUS); tc.mKeyOnly = true; synchronized (mCursors) { mCursors.insert(scrambledCursorId).mCursor = tc; } } return true; }
@Override public boolean cursorRegister(long cursorId, long indexId) throws IOException { Index ix = openIndex(indexId); if (ix != null) { _TreeCursor c = (_TreeCursor) ix.newCursor(Transaction.BOGUS); c.autoload(false); mCursors.insert(cursorId).value = c; } return true; }
@Override public boolean cursorRegister(long cursorId, long indexId) throws IOException { Index ix = openIndex(indexId); if (ix != null) { TreeCursor c = (TreeCursor) ix.newCursor(Transaction.BOGUS); c.autoload(false); mCursors.insert(cursorId).value = c; } return true; }
@Override public boolean cursorRegister(long cursorId, long indexId) throws IOException { long scrambledCursorId = mix(cursorId); Index ix = getIndex(indexId); if (ix != null) { TreeCursor tc = (TreeCursor) ix.newCursor(Transaction.BOGUS); tc.mKeyOnly = true; synchronized (mCursors) { mCursors.insert(scrambledCursorId).mCursor = tc; } } return true; }
private Map<String, String> readMetaProperties() { Database database = TuplUtils.openDatabase(this.metaFile, CACHE_SIZE_BYTES); try { Index index = database.openIndex(INDEX_NAME); Transaction tx = database.newTransaction(); try { Map<String, String> resultMap = Maps.newHashMap(); Cursor cursor = index.newCursor(tx); cursor.first(); while (cursor.key() != null) { String key = TuplUtils.decodeString(cursor.key()); String val = TuplUtils.decodeString(cursor.value()); resultMap.put(key, val); cursor.next(); } return resultMap; } finally { tx.reset(); } } catch (IOException e) { throw new ChronosIOException("Failed to open index '" + INDEX_NAME + "'! See root cause for details.", e); } finally { TuplUtils.shutdownQuietly(database); } }
tc.reset(); tc = (TreeCursor) ix.newCursor(txn); tc.mKeyOnly = true; tc.mTxn = txn;
tc.reset(); tc = (_TreeCursor) ix.newCursor(txn); tc.mKeyOnly = true; tc.mTxn = txn;