org.netbeans.mdr.persistence.btreeimpl.btreeindex
Class BigKeyPage
java.lang.Object
org.netbeans.mdr.persistence.btreeimpl.btreeindex.BtreePage
org.netbeans.mdr.persistence.btreeimpl.btreeindex.BigKeyPage
- All Implemented Interfaces:
- Streamable
- public class BigKeyPage
- extends BtreePage
These pages contain keys which are too big to be handled normally.
Each BigKeyPage contains a single key or a portion of a single key,
and possibly the data associated with the key. All of the BigKeyPages
are in a single chain attached to the root (i.e., root.nextPage points to
the first BigKeyPage). They are maintained in key order.
The first page for a given key contains the full key length in keyLength.
If the key doesn't fit on a single page it is continued on subsequent pages.
If the data fits completely on the same page as the last portion of the key,
it is put there; otherwise, it is put on a separate page.
When a big key record gets deleted, the pages are removed from the chain
and the space is never reused.
This is not a very efficient implementation because we don't really expect
it to be used (it gets used if a key is longer than 670 bytes).
- Version:
- 1.0
- Author:
- Dana Bergen
Method Summary |
void |
dumpPageEntries(java.io.PrintWriter out)
Print BtreePage entries for debugging. |
void |
dumpPageHeader(java.io.PrintWriter out)
Print BtreePage header for debugging. |
void |
init(Btree btree,
byte[] pageId,
byte[] pageBuffer,
boolean isNew)
Initialize a newly-instantiated or recycled BigKeyPage. |
void |
store()
Write BigKeyPage header data to the page buffer. |
Methods inherited from class org.netbeans.mdr.persistence.btreeimpl.btreeindex.BtreePage |
compare, compareData, consistencyCheck, dumpPage, dumpPageBuffer, dumpTree, get, getLocation, makeRoot, put, put, read, remove, remove, remove, split, uninit, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BigKeyPage
public BigKeyPage()
init
public void init(Btree btree,
byte[] pageId,
byte[] pageBuffer,
boolean isNew)
throws StorageException
- Initialize a newly-instantiated or recycled BigKeyPage. Note that the
isNew parameter pertains to whether a new page is being added to the
btree, not to whether this BtreePage object is new or recycled.
- Overrides:
init
in class BtreePage
- Parameters:
btree
- btree to which this page belongspageId
- page ID in byte arraypageBuffer
- page bufferisNew
- is this page new to the btree
- Throws:
StorageException
store
public void store()
- Write BigKeyPage header data to the page buffer.
- Overrides:
store
in class BtreePage
dumpPageHeader
public void dumpPageHeader(java.io.PrintWriter out)
- Description copied from class:
BtreePage
- Print BtreePage header for debugging.
- Overrides:
dumpPageHeader
in class BtreePage
- Parameters:
out
- PrintWriter to print to
dumpPageEntries
public void dumpPageEntries(java.io.PrintWriter out)
throws StorageException
- Description copied from class:
BtreePage
- Print BtreePage entries for debugging.
- Overrides:
dumpPageEntries
in class BtreePage
- Parameters:
out
- PrintWriter to print to
- Throws:
StorageException
Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.