/** * Allows access to internal indexes which can use the redo log. */ Index anyIndexById(long id) throws IOException { return anyIndexById(null, id); }
/** * Allows access to internal indexes which can use the redo log. */ Index anyIndexById(long id) throws IOException { return anyIndexById(null, id); }
/** * Allows access to internal indexes which can use the redo log. */ Index anyIndexById(long id) throws IOException { return anyIndexById(null, id); }
/** * @return null if index was deleted */ private Index findIndex(Index activeIndex) throws IOException { if (activeIndex == null || activeIndex.isClosed()) { activeIndex = mDatabase.anyIndexById(mActiveIndexId); } return activeIndex; }
/** * @return null if index was deleted */ private Index findIndex(Index activeIndex) throws IOException { if (activeIndex == null || activeIndex.isClosed()) { activeIndex = mDatabase.anyIndexById(mActiveIndexId); } return activeIndex; }
/** * @return null if index was deleted */ private Index findIndex(Index activeIndex) throws IOException { if (activeIndex == null || activeIndex.isClosed()) { activeIndex = mDatabase.anyIndexById(mActiveIndexId); } return activeIndex; }
private Index openIndex(long indexId) throws IOException { LHashTable.ObjEntry<Index> entry = mIndexes.get(indexId); if (entry != null) { return entry.value; } Index ix = mDatabase.anyIndexById(indexId); if (ix != null) { // Maintain a strong reference to the index. mIndexes.insert(indexId).value = ix; } return ix; } }
private Index openIndex(long indexId) throws IOException { LHashTable.ObjEntry<Index> entry = mIndexes.get(indexId); if (entry != null) { return entry.value; } Index ix = mDatabase.anyIndexById(indexId); if (ix != null) { // Maintain a strong reference to the index. mIndexes.insert(indexId).value = ix; } return ix; } }
/** * Opens the index and puts it into the local cache, replacing the existing entry. * * @param cleanup non-null to remove cleared references * @return null if not found */ private Index openIndex(Transaction txn, long indexId, Object cleanup) throws IOException { Index ix = mDatabase.anyIndexById(txn, indexId); if (ix == null) { return null; } SoftReference<Index> ref = new SoftReference<>(ix); synchronized (mIndexes) { mIndexes.insert(indexId).value = ref; if (cleanup != null) { // Remove entries for all other cleared references, freeing up memory. mIndexes.traverse(e -> e.value.get() == null); } } return ix; }
private Index openIndex(long indexId) throws IOException { LHashTable.ObjEntry<Index> entry = mIndexes.get(indexId); if (entry != null) { return entry.value; } Index ix = mDatabase.anyIndexById(indexId); if (ix != null) { // Maintain a strong reference to the index. mIndexes.insert(indexId).value = ix; } return ix; } }
/** * Opens the index and puts it into the local cache, replacing the existing entry. * * @return null if not found */ private Index openIndex(Transaction txn, long indexId, LHashTable.ObjEntry<SoftReference<Index>> entry) throws IOException { Index ix = mDatabase.anyIndexById(txn, indexId); if (ix == null) { return null; } SoftReference<Index> ref = new SoftReference<>(ix); if (entry == null) { mIndexes.insert(indexId).value = ref; } else { entry.value = ref; } if (entry != null) { // Remove entries for all other cleared references, freeing up memory. mIndexes.traverse((e) -> e.value.get() == null); } return ix; }
/** * Opens the index and puts it into the local cache, replacing the existing entry. * * @return null if not found */ private Index openIndex(Transaction txn, long indexId, LHashTable.ObjEntry<SoftReference<Index>> entry) throws IOException { Index ix = mDatabase.anyIndexById(txn, indexId); if (ix == null) { return null; } SoftReference<Index> ref = new SoftReference<>(ix); if (entry == null) { mIndexes.insert(indexId).value = ref; } else { entry.value = ref; } if (entry != null) { // Remove entries for all other cleared references, freeing up memory. mIndexes.traverse(e -> e.value.get() == null); } return ix; }
@Override public boolean deleteIndex(long txnId, long indexId) throws IOException { _LocalTransaction txn = txn(txnId); // Close the index for now. After recovery is complete, trashed indexes are deleted in // a separate thread. Index ix; { LHashTable.ObjEntry<Index> entry = mIndexes.remove(indexId); if (entry == null) { ix = mDatabase.anyIndexById(txn, indexId); } else { ix = entry.value; } } if (ix != null) { ix.close(); } return true; }
@Override public boolean deleteIndex(long txnId, long indexId) throws IOException { _LocalTransaction txn = txn(txnId); // Close the index for now. After recovery is complete, trashed indexes are deleted in // a separate thread. Index ix; { LHashTable.ObjEntry<Index> entry = mIndexes.remove(indexId); if (entry == null) { ix = mDatabase.anyIndexById(txn, indexId); } else { ix = entry.value; } } if (ix != null) { ix.close(); } return true; }
@Override public boolean deleteIndex(long txnId, long indexId) throws IOException { _LocalTransaction txn = txn(txnId); // Close the index for now. After recovery is complete, trashed indexes are deleted in // a separate thread. Index ix; { LHashTable.ObjEntry<Index> entry = mIndexes.remove(indexId); if (entry == null) { ix = mDatabase.anyIndexById(txn, indexId); } else { ix = entry.value; } } if (ix != null) { ix.close(); } return true; }
.mSharedLockOwnersObj = mDatabase.anyIndexById(mActiveIndexId);
Index ix = db.anyIndexById(lock.mIndexId); if (!(ix instanceof _Tree)) {
Index ix = db.anyIndexById(mIndexId); if (!(ix instanceof _Tree)) {
Index ix = db.anyIndexById(mIndexId); if (!(ix instanceof _Tree)) {