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.dupConvert;
  
 
A DBIN represents an Duplicate Bottom Internal Node in the JE tree. Obsolete in log version 8, only used by DupConvert and some log readers.
 
 public final class DBIN extends BIN implements Loggable {
     private static final String BEGIN_TAG = "<dbin>";
     private static final String END_TAG = "</dbin>";

    
Full key for this set of duplicates.
 
     private byte[] dupKey;
 
     public DBIN() {
         super();
     }

    
For Sizeof, set all array fields to null, since they are not part of the fixed overhead.
 
     public DBIN(SizeofMarker marker) {
         super(marker);
          = null;
     }

    

Returns:
true if this node is a duplicate-bearing node type, false if otherwise.
 
     @Override
     public boolean containsDuplicates() {
         return true;
     }
 
     @Override
     protected long getFixedMemoryOverhead() {
         return .;
     }
 
     @Override
     protected boolean isEvictionProhibited() {
         return true;
     }
 
     @Override
     public String beginTag() {
         return ;
     }
 
     @Override
     public String endTag() {
         return ;
     }

    
For unit test support:

Returns:
a string that dumps information about this IN, without
 
     @Override
     public String dumpString(int nSpacesboolean dumpTags) {
         StringBuilder sb = new StringBuilder();
         sb.append(TreeUtils.indent(nSpaces));
         sb.append(beginTag());
         sb.append('\n');
 
         sb.append(TreeUtils.indent(nSpaces+2));
         sb.append("<dupkey>");
         sb.append( == null ? "" : Key.dumpString(, 0));
         sb.append("</dupkey>");
         sb.append('\n');
 
         sb.append(super.dumpString(nSpacesfalse));
 
         sb.append(TreeUtils.indent(nSpaces));
         sb.append(endTag());
        return sb.toString();
    }

    
    @Override
    public LogEntryType getLogType() {
        return .;
    }
    /*
     * Logging support
     */

    
    @Override
    public int getLogSize() {
        throw EnvironmentFailureException.unexpectedState();
    }

    
    @Override
    public void writeToLog(ByteBuffer logBuffer) {
        throw EnvironmentFailureException.unexpectedState();
    }

    
    @Override
    public void readFromLog(ByteBuffer itemBufferint entryVersion) {
        super.readFromLog(itemBufferentryVersion);
         = LogUtils.readByteArray(itemBuffer, (entryVersion < 6));
    }

    
DBINS need to dump their dup key
    @Override
    protected void dumpLogAdditional(StringBuilder sb) {
        super.dumpLogAdditional(sb);
        sb.append(Key.dumpString(, 0));
    }
    @Override
    public String shortClassName() {
        return "DBIN";
    }
New to GrepCode? Check out our FAQ X