public final class BPage extends Object implements Serializer
The page contains a number of key-value pairs. Keys are ordered to allow dichotomic search.
If the page is a leaf page, the keys and values are user-defined and represent entries inserted by the user.
If the page is non-leaf, each key represents the greatest key in the underlying BPages and the values are recids pointing to the children BPages. The only exception is the rightmost BPage, which is considered to have an "infinite" key value, meaning that any insert will be to the left of this pseudo-key
Modifier and Type | Field and Description |
---|---|
protected long[] |
_children
Children pages (recids) associated with keys.
|
protected int |
_first
Index of first used item at the page
|
protected boolean |
_isLeaf
Flag indicating if this is a leaf BPage.
|
protected Object[] |
_keys
Keys of children nodes
|
protected long |
_next
Next leaf BPage (only if this BPage is a leaf)
|
protected long |
_previous
Previous leaf BPage (only if this BPage is a leaf)
|
protected long |
_recid
This BPage's record ID in the PageManager.
|
protected Object[] |
_values
Values associated with keys.
|
Constructor and Description |
---|
BPage()
No-argument constructor used by serialization.
|
Modifier and Type | Method and Description |
---|---|
Object |
deserialize(byte[] serialized)
Deserialize the content of an object from a byte array.
|
byte[] |
serialize(Object obj)
Serialize the content of an object into a byte array.
|
protected transient long _recid
protected boolean _isLeaf
protected Object[] _keys
protected Object[] _values
protected long[] _children
protected int _first
protected long _previous
protected long _next
public Object deserialize(byte[] serialized) throws IOException
deserialize
in interface Serializer
serialized
- Byte array representation of the objectIOException
public byte[] serialize(Object obj) throws IOException
serialize
in interface Serializer
obj
- Object to serializeIOException
Copyright © 2003-2013 Apache Software Foundation. All Rights Reserved.