@SuppressWarnings("unchecked") public EnvironmentStatistics(@NotNull final EnvironmentImpl env) { super(getObjectName(env)); this.env = env; statistics = env.getStatistics(); }
public ReadonlyTransaction(@NotNull final EnvironmentImpl env, final boolean exclusive, @Nullable final Runnable beginHook) { super(env, exclusive); this.beginHook = getWrappedBeginHook(beginHook); env.holdNewestSnapshotBy(this); env.getStatistics().getStatisticsItem(READONLY_TRANSACTIONS).incTotal(); }
ReadWriteTransaction(@NotNull final EnvironmentImpl env, @Nullable final Runnable beginHook, final boolean isExclusive, final boolean cloneMeta) { super(env, isExclusive); mutableTrees = new TreeMap<>(); removedStores = new LongHashMap<>(); createdStores = new HashMapDecorator<>(); this.beginHook = new Runnable() { @Override public void run() { final MetaTreeImpl currentMetaTree = env.getMetaTreeInternal(); setMetaTree(cloneMeta ? currentMetaTree.getClone() : currentMetaTree); env.registerTransaction(ReadWriteTransaction.this); if (beginHook != null) { beginHook.run(); } } }; replayCount = 0; setExclusive(isExclusive() | env.shouldTransactionBeExclusive(this)); env.holdNewestSnapshotBy(this); env.getStatistics().getStatisticsItem(TRANSACTIONS).incTotal(); }
/** * Constructor for creating new snapshot transaction. */ ReadonlyTransaction(@NotNull final TransactionBase origin) { super(origin.getEnvironment(), false); beginHook = null; setMetaTree(origin.getMetaTree()); final EnvironmentImpl env = getEnvironment(); env.acquireTransaction(this); env.registerTransaction(this); env.getStatistics().getStatisticsItem(READONLY_TRANSACTIONS).incTotal(); }
ReadWriteTransaction(@NotNull final TransactionBase origin, @Nullable final Runnable beginHook) { super(origin.getEnvironment(), false); mutableTrees = new TreeMap<>(); removedStores = new LongHashMap<>(); createdStores = new HashMapDecorator<>(); final EnvironmentImpl env = getEnvironment(); this.beginHook = getWrappedBeginHook(beginHook); replayCount = 0; setMetaTree(origin.getMetaTree()); setExclusive(env.shouldTransactionBeExclusive(this)); env.acquireTransaction(this); env.registerTransaction(this); env.getStatistics().getStatisticsItem(TRANSACTIONS).incTotal(); }