예제 #1
0
파일: LN.java 프로젝트: bungaca/abstools
 /** Delete this LN's data and log the new version. */
 public long delete(DatabaseImpl database, byte[] lnKey, byte[] dupKey, long oldLsn, Locker locker)
     throws DatabaseException {
   makeDeleted();
   EnvironmentImpl env = database.getDbEnvironment();
   long newLsn = DbLsn.NULL_LSN;
   if (dupKey != null) {
     LogEntryType entryType;
     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;
       logTxn = null;
     }
     if (oldLsn == logAbortLsn) {
       oldLsn = DbLsn.NULL_LSN;
     }
     DeletedDupLNLogEntry logEntry =
         new DeletedDupLNLogEntry(
             entryType,
             this,
             database.getId(),
             dupKey,
             lnKey,
             logAbortLsn,
             logAbortKnownDeleted,
             logTxn);
     LogManager logManager = env.getLogManager();
     newLsn = logManager.log(logEntry, false, oldLsn);
   } else {
     newLsn = log(env, database.getId(), lnKey, oldLsn, locker);
   }
   return newLsn;
 }
예제 #2
0
 /** Clear out the obsoleteOffsets to save memory when the LN is deleted. */
 @Override
 void makeDeleted() {
   super.makeDeleted();
   obsoleteOffsets = new PackedOffsets();
 }