1 8 9 package com.sleepycat.je.cleaner; 10 11 import com.sleepycat.je.dbi.DatabaseId; 12 import com.sleepycat.je.dbi.MemoryBudget; 13 import com.sleepycat.je.tree.LN; 14 15 22 public final class LNInfo { 23 24 private LN ln; 25 private DatabaseId dbId; 26 private byte[] key; 27 private byte[] dupKey; 28 29 public LNInfo(LN ln, DatabaseId dbId, byte[] key, byte[] dupKey) { 30 this.ln = ln; 31 this.dbId = dbId; 32 this.key = key; 33 this.dupKey = dupKey; 34 } 35 36 LN getLN() { 37 return ln; 38 } 39 40 DatabaseId getDbId() { 41 return dbId; 42 } 43 44 byte[] getKey() { 45 return key; 46 } 47 48 byte[] getDupKey() { 49 return dupKey; 50 } 51 52 int getMemorySize() { 53 int size = MemoryBudget.LN_INFO_OVERHEAD; 54 if (ln != null) { 55 size += ln.getMemorySizeIncludedByParent(); 56 } 57 if (key != null) { 58 size += MemoryBudget.byteArraySize(key.length); 59 } 60 if (dupKey != null) { 61 size += MemoryBudget.byteArraySize(dupKey.length); 62 } 63 return size; 64 } 65 } 66 | Popular Tags |