Package com.sleepycat.je.txn

Examples of com.sleepycat.je.txn.WriteLockInfo


         * inserted.
         */
        setIndex(insertIndex &= ~IN.INSERT_SUCCESS);

        /* Log the new LN. */
        final WriteLockInfo writeLockInfo = LockStanding.prepareForInsert();
        long newLsn = DbLsn.NULL_LSN;
        try {
            newLsn = ln.optionalLog
                (envImpl, databaseImpl, key, null /*oldKey*/, DbLsn.NULL_LSN,
                 locker, writeLockInfo, repContext);
View Full Code Here


         * this locker, a WriteLockInfo is created with the old LSN as the
         * abortLsn.
         */
        public WriteLockInfo prepareForUpdate() {
            final boolean abortKnownDeleted = !recordExists();
            WriteLockInfo wri = null;
            if (lockResult != null) {
                lockResult.setAbortLsn(lsn, abortKnownDeleted);
                wri = lockResult.getWriteLockInfo();
            }
            if (wri == null) {
                wri = new WriteLockInfo();
                wri.setAbortLsn(lsn);
                wri.setAbortKnownDeleted(abortKnownDeleted);
            }
            return wri;
        }
View Full Code Here

         * copied into the WriteLockInfo for the new LSN.  This method is
         * static because lockLN is never called prior to logging an LN for a
         * newly inserted slot.
         */
        public static WriteLockInfo prepareForInsert() {
            final WriteLockInfo wri = new WriteLockInfo();
            wri.setCreatedThisTxn(true);
            return wri;
        }
View Full Code Here

         * Set abortLsn and database for utilization tracking.  We don't know
         * lastLoggedSize, so a default will be used for utilization counting.
         * This should not be common.
         */
        result.setAbortLsn(abortLsn, abortKnownDeleted);
        final WriteLockInfo wli = result.getWriteLockInfo();
        if (wli == null) {
            throw EnvironmentFailureException.unexpectedState
               ("Resurrected lock has no write info txn=" + txn.getId() +
                " logLsn=" + DbLsn.getNoFormatString(logLsn) +
                " abortLsn=" + DbLsn.getNoFormatString(abortLsn));
        }

        wli.setAbortInfo(db, 0 /*lastLoggedSize*/);
    }
View Full Code Here

                    boolean abortKnownDeleted = true;
                    if (currentLN != null &&
                        currentLock.getLockGrant() == LockGrantType.EXISTING) {
                        long nodeId = currentLN.getNodeId();
                        Locker locker = cursor.getLocker();
                        WriteLockInfo info = locker.getWriteLockInfo(nodeId);
                        abortLsn = info.getAbortLsn();
                        abortKnownDeleted = info.getAbortKnownDeleted();
                        /* Copy the size/DatabaseImpl of the existing lock. */
                        lnLock.copyAbortInfo(info);
                    }
                    lnLock.setAbortLsn(abortLsn, abortKnownDeleted);

View Full Code Here

                        if (currentLN != null &&
                            currentLock.getLockGrant() ==
                            LockGrantType.EXISTING) {
                            long nodeId = currentLN.getNodeId();
                            Locker locker = cursor.getLocker();
                            WriteLockInfo info =
                                locker.getWriteLockInfo(nodeId);
                            abortLsn = info.getAbortLsn();
                            abortKnownDeleted = info.getAbortKnownDeleted();
                            /* Copy size/DatabaseImpl of the existing lock. */
                            lnLock.copyAbortInfo(info);
                        }
                        lnLock.setAbortLsn(abortLsn, abortKnownDeleted);

View Full Code Here

        if (locker != null && locker.isTransactional()) {
            entryType = isDelDup ?
                LogEntryType.LOG_DEL_DUPLN_TRANSACTIONAL :
                getTransactionalLogType();
            WriteLockInfo info = locker.getWriteLockInfo(getNodeId());
            logAbortLsn = info.getAbortLsn();
            logAbortKnownDeleted = info.getAbortKnownDeleted();
            logTxn = locker.getTxnLocker();
            assert logTxn != null;
            if (oldLsn == logAbortLsn) {
                info.setAbortInfo(dbImpl, getLastLoggedSize());
            }
            context.obsoleteDupsAllowed = locker.isRolledBack();
        } else {
            entryType = isDelDup ? LogEntryType.LOG_DEL_DUPLN : getLogType();
            logAbortLsn = DbLsn.NULL_LSN;
View Full Code Here

                    boolean abortKnownDeleted = true;
                    if (currentLN != null &&
                        currentLock.getLockGrant() == LockGrantType.EXISTING) {
                        long nodeId = currentLN.getNodeId();
                        Locker locker = cursor.getLocker();
      WriteLockInfo info = locker.getWriteLockInfo(nodeId);
      abortLsn = info.getAbortLsn();
      abortKnownDeleted = info.getAbortKnownDeleted();
                    }
        lnLock.setAbortLsn(abortLsn, abortKnownDeleted);

                    /*
                     * Current entry is a deleted entry. Replace it with LN.
View Full Code Here

                        if (currentLN != null &&
                            currentLock.getLockGrant() ==
                            LockGrantType.EXISTING) {
                            long nodeId = currentLN.getNodeId();
                            Locker locker = cursor.getLocker();
          WriteLockInfo info =
        locker.getWriteLockInfo(nodeId);
          abortLsn = info.getAbortLsn();
          abortKnownDeleted = info.getAbortKnownDeleted();
      }
      lnLock.setAbortLsn(abortLsn, abortKnownDeleted);

                        /*
                         * Current entry is a deleted entry. Replace it with
View Full Code Here

            long logAbortLsn;
            boolean logAbortKnownDeleted;
            Txn logTxn;
            if (locker.isTransactional()) {
                entryType = LogEntryType.LOG_DEL_DUPLN_TRANSACTIONAL;
    WriteLockInfo info = locker.getWriteLockInfo(getNodeId());
    logAbortLsn = info.getAbortLsn();
    logAbortKnownDeleted = info.getAbortKnownDeleted();
                logTxn = locker.getTxnLocker();
            } else {
                entryType = LogEntryType.LOG_DEL_DUPLN;
                logAbortLsn = DbLsn.NULL_LSN;
                logAbortKnownDeleted = true;
View Full Code Here

TOP

Related Classes of com.sleepycat.je.txn.WriteLockInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.