private synchronized void close(boolean checkForStaleScan) { if (status != TxStatus.CLOSED) { status = TxStatus.CLOSED; if (checkForStaleScan && !commitAttempted) { Stamp stamp = env.getSharedResources().getOracleClient().getStamp(); if (startTs < stamp.getGcTimestamp()) { throw new StaleScanException(); } } env.getSharedResources().getTimestampTracker().removeTimestamp(startTs); } }
public boolean commitPrimaryColumn(CommitData cd, long commitTs) throws AccumuloException, AccumuloSecurityException { // set weak notifications after all locks are written, but before finishing commit. If weak // notifications were set after the commit, then information // about weak notifications would need to be persisted in the lock phase. Setting here is safe // because any observers that run as a result of the weak // notification will wait for the commit to finish. Setting here may cause an observer to run // unnecessarily in the case of rollback, but that is ok. // TODO look into setting weak notification as part of lock and commit phases to avoid this // synchronous step writeWeakNotifications(commitTs); // try to delete lock and add write for primary column IteratorSetting iterConf = new IteratorSetting(10, PrewriteIterator.class); PrewriteIterator.setSnaptime(iterConf, startTs); boolean isTrigger = isTriggerRow(cd.prow) && cd.pcol.equals(notification.getColumn()); Condition lockCheck = new FluoCondition(env, cd.pcol).setIterators(iterConf).setValue( LockValue.encode(cd.prow, cd.pcol, cd.pval != null, cd.pval == DELETE, isTrigger, getTransactorID())); ConditionalMutation delLockMutation = new ConditionalFlutation(env, cd.prow, lockCheck); ColumnUtil.commitColumn(env, isTrigger, true, cd.pcol, cd.pval != null, cd.pval == DELETE, startTs, commitTs, observedColumns, delLockMutation); Status mutationStatus = cd.cw.write(delLockMutation).getStatus(); while (mutationStatus == Status.UNKNOWN) {