org.netbeans.mdr.persistence.btreeimpl.btreeindex
Class ShrinkablePage
java.lang.Object
org.netbeans.mdr.persistence.btreeimpl.btreeindex.BtreePage
org.netbeans.mdr.persistence.btreeimpl.btreeindex.ShrinkablePage
- All Implemented Interfaces:
- Streamable
- public class ShrinkablePage
- extends BtreePage
Implementation of a BtreePage with fixed key length and fixed data length that
are stored in compressed form if all the stored keys or data prefixes are
strings of zeros (these prefixes are excluded then).
Method Summary |
protected byte |
compare(byte[] key,
int entryNum)
Compares the key with that of the specified entry. |
protected byte |
compareData(byte[] data,
int entryNum)
|
void |
dump()
|
void |
dumpBuffer()
|
void |
init(Btree btree,
byte[] pageId,
byte[] pageBuffer,
boolean isNew)
Initialize a newly-instantiated or recycled ShrinkablePage. |
void |
store()
Write BtreePage header data to the page buffer. |
Methods inherited from class org.netbeans.mdr.persistence.btreeimpl.btreeindex.BtreePage |
consistencyCheck, dumpPage, dumpPageBuffer, dumpPageEntries, dumpPageHeader, 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 |
ShrinkablePage
public ShrinkablePage()
init
public void init(Btree btree,
byte[] pageId,
byte[] pageBuffer,
boolean isNew)
throws StorageException
- Initialize a newly-instantiated or recycled ShrinkablePage. 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
compare
protected byte compare(byte[] key,
int entryNum)
- Description copied from class:
BtreePage
- Compares the key with that of the specified entry. Just handles one
special case and then calls btree.keyInfo.compare().
- Overrides:
compare
in class BtreePage
- Parameters:
key
- search keyentryNum
- entry number of target entry
- Returns:
- EntryTypeInfo.EQUAL if the two keys are equal
EntryTypeInfo.GREATER if search key is greater than entry's key
EntryTypeInfo.LESS if search key is less than entry's key
compareData
protected byte compareData(byte[] data,
int entryNum)
- Overrides:
compareData
in class BtreePage
store
public void store()
- Description copied from class:
BtreePage
- Write BtreePage header data to the page buffer.
- Overrides:
store
in class BtreePage
dump
public void dump()
dumpBuffer
public void dumpBuffer()
Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.