@Override public final void close(final boolean force, final boolean onDelete) { try { doClose(force, onDelete); } catch (final RuntimeException ee) { throw logAndPrepareForRethrow(ee); } catch (final Error ee) { throw logAndPrepareForRethrow(ee); } catch (final Throwable t) { throw logAndPrepareForRethrow(t); } }
/** * Rollbacks the micro-transaction after failed commit attempt. */ public void rollbackAfterFailedCommit() { if (active) throw error("Active micro-transaction on rollback after failed commit"); if (level != 0) throw error("Unbalanced micro-transaction, level = " + level); doRollback(); }
/** * Traditional commit that support already temporary rid and already assigned rids * * @param clientTx the transaction to commit * * @return The list of operations applied by the transaction */ @Override public final List<ORecordOperation> commit(final OTransactionInternal clientTx) { return commit(clientTx, false); }
public OAtomicOperationsManager(OAbstractPaginatedStorage storage) { this.storage = storage; this.writeAheadLog = storage.getWALInstance(); this.readCache = storage.getReadCache(); this.writeCache = storage.getWriteCache(); }
@Override public final void reload() { try { close(); open(null, null, null); } catch (final RuntimeException ee) { throw logAndPrepareForRethrow(ee); } catch (final Error ee) { throw logAndPrepareForRethrow(ee); } catch (final Throwable t) { throw logAndPrepareForRethrow(t); } }
public ODurableComponent(final OAbstractPaginatedStorage storage, final String name, final String extension, final String lockName) { super(true); assert name != null; this.extension = extension; this.storage = storage; this.fullName = name + extension; this.name = name; this.atomicOperationsManager = storage.getAtomicOperationsManager(); this.readCache = storage.getReadCache(); this.writeCache = storage.getWriteCache(); this.lockName = lockName; }
private void onScannedLink(final ORepairStats stats, final OIdentifiable fieldValue) { stats.scannedLinks++; if (eventListener != null) eventListener.onScannedLink(fieldValue); }
private void onRemovedLink(final ORepairStats stats, final OIdentifiable fieldValue) { stats.removedLinks++; if (eventListener != null) eventListener.onRemovedLink(fieldValue); }
@Override public final long count(final int iClusterId) { return count(iClusterId, false); }
@Override public boolean hasNext() { if (page == null) { page = nextPage(finalClusterId, lastPos); if (page != null) { lastPos = page.getLastPosition(); } } return page != null; }
@Override protected void postCloseStepsAfterLock(Map<String, Object> params) { super.postCloseStepsAfterLock(params); }
/** * Begins the micro-transaction. Micro-transactions may be nested. */ public void begin() { if (level < 0) throw error("Unbalanced micro-transaction, level = " + level); ++level; active = true; }
@Override public OTransactionIndexChanges getIndexChangesInternal(String indexName) { return getIndexChanges(indexName); }
@Override public void updateIdentityAfterCommit(ORID oldRID, ORID rid) { updateIdentityAfterRecordCommit(oldRID, rid); }
@Override public final void open(final String iUserName, final String iUserPassword, final OContextConfiguration contextConfiguration) { open(contextConfiguration); }
/** * @return Returns current instance of read cache and initializes local reference if such one is not initialized yet. */ private O2QCache gerReadCache() { if (readCacheInitialized) return readCache; final OReadCache cache = storage.getReadCache(); if (cache instanceof O2QCache) { this.readCache = (O2QCache) cache; } else { this.readCache = null; } readCacheInitialized = true; return readCache; }
private void onScannedLink(final ORepairStats stats, final OIdentifiable fieldValue) { stats.scannedLinks++; if (eventListener != null) eventListener.onScannedLink(fieldValue); }
private void onRemovedLink(final ORepairStats stats, final OIdentifiable fieldValue) { stats.removedLinks++; if (eventListener != null) eventListener.onRemovedLink(fieldValue); }
/** * Commit a transaction where the rid where pre-allocated in a previous phase * * @param clientTx the pre-allocated transaction to commit * * @return The list of operations applied by the transaction */ @SuppressWarnings("UnusedReturnValue") public List<ORecordOperation> commitPreAllocated(final OTransactionInternal clientTx) { return commit(clientTx, true); }
@Override public final long count(final int[] iClusterIds) { return count(iClusterIds, false); }