org.helidb.util.bplus
Class FixedSizeNodeSizeStrategy

java.lang.Object
  extended by org.helidb.util.bplus.FixedSizeNodeSizeStrategy
All Implemented Interfaces:
NodeSizeStrategy

public class FixedSizeNodeSizeStrategy
extends Object
implements NodeSizeStrategy

This node size strategy gives a fixed node size.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
helidb-core

Constructor Summary
FixedSizeNodeSizeStrategy(int nodeSize)
          Constructor.
 
Method Summary
 int getMaxNumberOfRecordsPerNode(int headerSize, int recordSize, long pos)
          Given the supplied size of the node header and records, how many records will fit in a node?
 int getNodeSize(int headerSize, int valueSize, long pos)
          Given the supplied size of the node header and records, how many bytes will a node occupy?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedSizeNodeSizeStrategy

public FixedSizeNodeSizeStrategy(int nodeSize)
Constructor.

Parameters:
nodeSize - The node size, in bytes.
Method Detail

getNodeSize

public int getNodeSize(int headerSize,
                       int valueSize,
                       long pos)
Description copied from interface: NodeSizeStrategy
Given the supplied size of the node header and records, how many bytes will a node occupy?

Specified by:
getNodeSize in interface NodeSizeStrategy
Parameters:
headerSize - The size of the node header.
valueSize - The size of a record.
pos - The position of the node in the file.
Returns:
The size of a node, in bytes.

getMaxNumberOfRecordsPerNode

public int getMaxNumberOfRecordsPerNode(int headerSize,
                                        int recordSize,
                                        long pos)
Description copied from interface: NodeSizeStrategy
Given the supplied size of the node header and records, how many records will fit in a node?

Specified by:
getMaxNumberOfRecordsPerNode in interface NodeSizeStrategy
Parameters:
headerSize - The size of the node header.
recordSize - The size of a record.
pos - The position of the node in the file.
Returns:
The number of records that fit in a node.