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.cleaner;
  
 
Per-DB-per-file utilization counters. The DatabaseImpl stores a persistent map of file number to DbFileSummary.
 
 public class DbFileSummary implements LoggableCloneable {
 
     /* Persistent fields. */
     public int totalINCount;    // Number of IN log entries
     public int totalINSize;     // Byte size of IN log entries
     public int totalLNCount;    // Number of LN log entries
     public int totalLNSize;     // Byte size of LN log entries
     public int obsoleteINCount// Number of obsolete IN log entries
     public int obsoleteLNCount// Number of obsolete LN log entries
     public int obsoleteLNSize;  // Byte size of obsolete LN log entries
     public int obsoleteLNSizeCounted;  // Number obsolete LNs with size counted
 
    
Creates an empty summary.
 
     public DbFileSummary() {
     }

    
Add the totals of the given summary object to the totals of this object.
 
     public void add(DbFileSummary o) {
 
          += o.totalINCount;
          += o.totalINSize;
          += o.totalLNCount;
          += o.totalLNSize;
          += o.obsoleteINCount;
          += o.obsoleteLNCount;
          += o.obsoleteLNSize;
          += o.obsoleteLNSizeCounted;
     }

    
 
     public int getLogSize() {
         return
             LogUtils.getPackedIntLogSize() +
             LogUtils.getPackedIntLogSize() +
             LogUtils.getPackedIntLogSize() +
             LogUtils.getPackedIntLogSize() +
             LogUtils.getPackedIntLogSize() +
             LogUtils.getPackedIntLogSize() +
             LogUtils.getPackedIntLogSize() +
             LogUtils.getPackedIntLogSize();
     }

    
 
     public void writeToLog(ByteBuffer buf) {
 
         LogUtils.writePackedInt(buf);
         LogUtils.writePackedInt(buf);
         LogUtils.writePackedInt(buf);
         LogUtils.writePackedInt(buf);
         LogUtils.writePackedInt(buf);
         LogUtils.writePackedInt(buf);
         LogUtils.writePackedInt(buf);
         LogUtils.writePackedInt(buf);
     }

    
 
     public void readFromLog(ByteBuffer bufint entryTypeVersion) {
 
          = LogUtils.readPackedInt(buf);
          = LogUtils.readPackedInt(buf);
          = LogUtils.readPackedInt(buf);
          = LogUtils.readPackedInt(buf);
          = LogUtils.readPackedInt(buf);
          = LogUtils.readPackedInt(buf);
          = LogUtils.readPackedInt(buf);
          = LogUtils.readPackedInt(buf);
     }

    
 
    public void dumpLog(StringBuilder bufboolean verbose) {
        buf.append("<summary totalINCount=\"");
        buf.append();
        buf.append("\" totalINSize=\"");
        buf.append();
        buf.append("\" totalLNCount=\"");
        buf.append();
        buf.append("\" totalLNSize=\"");
        buf.append();
        buf.append("\" obsoleteINCount=\"");
        buf.append();
        buf.append("\" obsoleteLNCount=\"");
        buf.append();
        buf.append("\" obsoleteLNSize=\"");
        buf.append();
        buf.append("\" obsoleteLNSizeCounted=\"");
        buf.append();
        buf.append("\"/>");
    }

    
    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;
    }
    @Override
    public DbFileSummary clone() {
        try {
            return (DbFileSummarysuper.clone();
        } catch (CloneNotSupportedException e) {
            /* Should never happen. */
            throw new IllegalStateException(e);
        }
    }
    @Override
    public String toString() {
        StringBuilder buf = new StringBuilder();
        dumpLog(buftrue);
        return buf.toString();
    }
New to GrepCode? Check out our FAQ X