1 5 package org.h2.index; 6 7 import java.sql.SQLException ; 8 9 import org.h2.store.DataPage; 10 import org.h2.store.Record; 11 12 public class LinearHashHead extends Record { 13 14 private LinearHashIndex index; 15 int baseSize; 16 int nextToSplit; 17 int recordCount, bucketCount; 18 19 LinearHashHead(LinearHashIndex index) { 20 this.index = index; 21 } 22 23 LinearHashHead(LinearHashIndex index, DataPage s) { 24 this.index = index; 25 baseSize = s.readInt(); 26 nextToSplit = s.readInt(); 27 recordCount = s.readInt(); 28 bucketCount = s.readInt(); 29 } 30 31 public int getByteCount(DataPage dummy) throws SQLException { 32 return index.getBucketSize(); 33 } 34 35 public void write(DataPage buff) throws SQLException { 36 buff.writeByte((byte)'H'); 37 buff.writeInt(baseSize); 38 buff.writeInt(nextToSplit); 39 buff.writeInt(recordCount); 40 buff.writeInt(bucketCount); 41 } 42 43 public boolean isPinned() { 44 return true; 45 } 46 47 } 48 | Popular Tags |