Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * See the file LICENSE for redistribution information.
   *
   * Copyright (c) 2002, 2013 Oracle and/or its affiliates.  All rights reserved.
   *
   */
  
  package com.sleepycat.je.tree;
  
 
DeltaInfo holds the delta for one BIN entry in a partial BIN log entry. The data here is all that we need to update a BIN to its proper state.
 
 public class DeltaInfo implements Loggable {
     private byte[] key;
     private long lsn;
     private byte state;
 
     DeltaInfo(byte[] keylong lsnbyte state) {
         this. = key;
         this. = lsn;
         this. = state;
     }

    
For reading from the log only. Is public for Sizeof.
 
     public DeltaInfo() {
          = .;
     }
 
     /*
      * @see Loggable#getLogSize()
      */
     public int getLogSize() {
         return
             LogUtils.getByteArrayLogSize() +
             LogUtils.getPackedLongLogSize() + // LSN
             1; // state
     }
 
     /*
      * @see Loggable#writeToLog(java.nio.ByteBuffer)
      */
     public void writeToLog(ByteBuffer logBuffer) {
         LogUtils.writeByteArray(logBuffer);
         LogUtils.writePackedLong(logBuffer);
         logBuffer.put();
     }
 
     /*
      * @seeLoggable#readFromLog
      */
     public void readFromLog(ByteBuffer itemBufferint entryVersion) {
         boolean unpacked = (entryVersion < 6);
          = LogUtils.readByteArray(itemBufferunpacked);
          = LogUtils.readLong(itemBufferunpacked);
          = itemBuffer.get();
     }
 
     /*
      * @see Loggable#dumpLog(java.lang.StringBuilder)
      */
     public void dumpLog(StringBuilder sbboolean verbose) {
         sb.append(Key.dumpString(, 0));
             sb.append(DbLsn.toString());
         IN.dumpDeletedState(sb);
     }

    
 
     public long getTransactionId() {
         return 0;
     }

    

See also:
com.sleepycat.je.log.Loggable.logicalEquals(com.sleepycat.je.log.Loggable) Always return false, this item should never be compared.
 
     public boolean logicalEquals(Loggable other) {
         return false;
     }

    

Returns:
the Key.
 
     byte[] getKey() {
         return ;
     }

    

Returns:
the state flags.
    byte getState() {
        return ;
    }

    

Returns:
true if this is known to be deleted.
    boolean isKnownDeleted() {
        return IN.isStateKnownDeleted();
    }

    

Returns:
the LSN.
    long getLsn() {
        return ;
    }

    
Returns the number of bytes occupied by this object. Deltas are not stored in the Btree, but they are budgeted during a SortedLSNTreeWalker run.
    long getMemorySize() {
        return . +
               MemoryBudget.byteArraySize(.);
    }
New to GrepCode? Check out our FAQ X