public static int calcBlockSize(RecordFactory factory, int maxRec) { return RecordBufferPageBase.calcBlockSize(factory, maxRec, HashBucket.FIELD_LENGTH) ; } }
public static int calcRecordSize(RecordFactory factory, int blkSize) { return RecordBufferPageBase.calcRecordSize(factory, blkSize, FIELD_LENGTH) ; }
protected RecordBufferPageBase(Block block, int offset, RecordFactory factory, int count) { // This code knows the alignment of the records in the ByteBuffer. super(block) ; this.headerLength = FIELD_LENGTH+offset ; // NB +4 for the count field this.factory = factory ; reset(block, count) ; }
public static int calcRecordSize(RecordFactory factory, int blkSize, int headerOffset) { // Length = X*recordLength + HEADER int x = blkSize-totalOffset(headerOffset) ; return x / factory.recordLength() ; }
@Override public void output(IndentedWriter out) { out.print(toString()) ; } }
@Override public String toString() { return String.format("RecordBufferPageBase[id=%d]: %s", getBackingBlock().getId(), recBuff) ; }
public static int calcBlockSize(RecordFactory factory, int maxRec, int headerOffset) { return totalOffset(headerOffset) + factory.recordLength()*maxRec ; }
@Override protected void _reset(Block block) { super.reset(block, this.getCount()) ; this.link = block.getByteBuffer().getInt(LINK) ; }
public static int calcBlockSize(RecordFactory factory, int maxRec) { return RecordBufferPageBase.calcBlockSize(factory, maxRec, FIELD_LENGTH) ; }
public static int calcRecordSize(RecordFactory factory, int blkSize) { return RecordBufferPageBase.calcRecordSize(factory, blkSize, HashBucket.FIELD_LENGTH) ; }