Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.store.access.btree
Class BranchRow  view BranchRow download BranchRow.java

java.lang.Object
  extended byorg.apache.derby.impl.store.access.btree.BranchRow

public class BranchRow
extends java.lang.Object

Implements row which is stored in the branch pages of a btree. A non-suffix compressed branch row contains all of the columns of the leaf rows of a btree and contains an additional field at the end. The extra field of a branch row in a branch page at level N, is the child page field pointing the page at level N-1 which has keys which follow or equal the branch row entry. There are 3 ways to use this class to produce a branch row: createEmptyTemplate() creates a empty row template createBranchRowFromOldBranchRow() creates a new row with reference to an old branch row. createBranchRowFromOldLeafRow() creates a new row with reference to an old leaf row.


Field Summary
private  org.apache.derby.iapi.types.DataValueDescriptor[] branchrow
          The array of object to be used as the row.
static long DUMMY_PAGE_NUMBER
           
 
Constructor Summary
private BranchRow()
          Constuctor for creating an "empty" BranchRow template, suitable for reading in a branchRow from disk.
private BranchRow(BTree btree)
           
 
Method Summary
 BranchRow createBranchRowFromOldBranchRow(long childpageno)
          Create a new branch row, given a old branch row and a new child page.
static BranchRow createBranchRowFromOldLeafRow(org.apache.derby.iapi.types.DataValueDescriptor[] leafrow, long childpageno)
          Create a new branch row, given a old leaf row and a new child page.
static BranchRow createEmptyTemplate(BTree btree)
          Create an empty branch row template suitable for reading branch rows in from disk.
private  org.apache.derby.iapi.types.SQLLongint getChildPage()
          Accessor for the child page field of the branch row.
protected  org.apache.derby.iapi.types.DataValueDescriptor[] getRow()
          Return the branch row.
protected  void setPageNumber(long page_number)
          Set the page number field of the branch row to a new value.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DUMMY_PAGE_NUMBER

public static final long DUMMY_PAGE_NUMBER
See Also:
Constant Field Values

branchrow

private org.apache.derby.iapi.types.DataValueDescriptor[] branchrow
The array of object to be used as the row.

Constructor Detail

BranchRow

private BranchRow()
Constuctor for creating an "empty" BranchRow template, suitable for reading in a branchRow from disk.


BranchRow

private BranchRow(BTree btree)
           throws org.apache.derby.iapi.error.StandardException
Method Detail

getChildPage

private org.apache.derby.iapi.types.SQLLongint getChildPage()
Accessor for the child page field of the branch row.


createEmptyTemplate

public static BranchRow createEmptyTemplate(BTree btree)
                                     throws org.apache.derby.iapi.error.StandardException
Create an empty branch row template suitable for reading branch rows in from disk. This routine will create newly allocated "empty" objects for every column in the template row.


createBranchRowFromOldBranchRow

public BranchRow createBranchRowFromOldBranchRow(long childpageno)
Create a new branch row, given a old branch row and a new child page. Used by BranchControlRow to manufacture new branch rows when splitting or growing the tree. There is no way to "copy" values of a template row, so this class just stores a reference to each of the columns of the Indexable row passed in. This is ok as all usages of this class when instantiated this way, have an old branch row from which they are creating a new branch row with the same key values, and a different child page number. WARNING - this branch row is only valid while the old branch row is valid, as it contains references to the columns of the old branch row. So use of the row should only provide read-only access to the objects of the old branch row which are referenced.


createBranchRowFromOldLeafRow

public static BranchRow createBranchRowFromOldLeafRow(org.apache.derby.iapi.types.DataValueDescriptor[] leafrow,
                                                      long childpageno)
Create a new branch row, given a old leaf row and a new child page. Used by LeafControlRow to manufacture new branch rows when splitting or growing the tree. There is no way to "copy" values of a template row, so this class just stores a referece to the Indexable row passed in. This is ok as all usages of this class when instantiated this way, have an old leaf row from which they are creating a new branch row with the same key values, and a different child page number. WARNING - this branch row is only valid while the old leaf row is valid, as it contains references to the columns of the old leaf row. So use of the row should only provide read-only access to the objects of the old leaf row which are referenced.


getRow

protected org.apache.derby.iapi.types.DataValueDescriptor[] getRow()
Return the branch row.

Return the DataValueDescriptor array that represents the branch row, for use in raw store calls to fetch, insert, and update.


setPageNumber

protected void setPageNumber(long page_number)
Set the page number field of the branch row to a new value.


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).