Together, the btreestorage and btreeindex packages provide the btree storage implementation for the NetBeans meta-data repository. btreeindex contains the implementation of a btree structure for storing key-value pairs. It is used by the repository in two ways: as a primary index on the BtreeDatabase, and as a way to store MOF associations. In the former case, a key-value pair stored in the index consists of a MOFID and the offset into the repository file where that object is located.

The btree index implementation is a general-purpose data structure and is almost entirely independent of the btreestorage implementation. However, there are a few dependencies which would need to be addressed if this code was to be used with some other storage mechanism. These are listed in the Btree class.

Main classes

Btree/SinglevaluedBtree/MultivaluedBtree/MultivaluedOrderedBtree

These implement the Index interface and corresponding subinterfaces SinglevaluedIndex, MultivaluedIndex, and MultivaluedOrderedIndex. They contain the persistent state of a Btree and the public interface methods for accessing it.

BtreePage

The main logic for searching and updating the structure of a Btree is contained in the BtreePage class. Subclasses representing specific types of pages handle retrieval and updates of the items on the page.

BtreePageSource/BtreeMDRSource/BtreeFileSource

BtreePageSource is an interface through which a Btree creates and retrieves its pages. The BtreeFileSource implementation is used for the primary repository index, whose pages are stored in their own file. The BtreeMDRSource implementation is used for the MOF association indexes, whose pages are stored as MOF repository objects.

EntryTypeInfo

All data stored in a Btree index is stored in a byte array. EntryTypeInfo is an abstract class with a subclass for each type of data that can be stored in a Btree (defined in org.netbeans.mdr.persistence.Storage.EntryType). These implement methods for converting an Object of the appropriate type back and forth between the byte array representation and for doing comparisons of keys stored in the byte array format.