Java Doc for BranchControlRow.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » store » access » btree » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.impl.store.access.btree 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.impl.store.access.btree.ControlRow
      org.apache.derby.impl.store.access.btree.BranchControlRow

BranchControlRow
public class BranchControlRow extends ControlRow (Code)
A branch row contains key fields and the pointer to the child page.


Field Summary
final protected static  FormatableBitSetCR_LEFTCHILD_BITMAP
     bit sets used to fetch single columns at a time.
transient  SQLLongintchild_pageno_buf
     Only allocate one child_pageno_buf to read the page pointer field into, then cache to "empty" object for reuse by the page itself.
protected  SQLLongintleft_child_page
    

Constructor Summary
public  BranchControlRow()
     No arg constructor.
public  BranchControlRow(OpenBTree open_btree, Page page, int level, ControlRow parent, boolean isRoot, long left_child)
    

Method Summary
final protected  voidControlRowInit()
     Perform page specific initialization.
public  intcheckConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages)
     Perform consistency checks for a branch page.
protected  ControlRowgetChildPageAtSlot(OpenBTree open_btree, int slot)
    
public  ControlRowgetLeftChild(OpenBTree open_btree)
     Return the left child pointer for the page.
 longgetLeftChildPageno()
     Return the left child page number for the page.
final protected  intgetNumberOfControlRowColumns()
     Get the number of columns in the control row.
protected  ControlRowgetRightChild(OpenBTree open_btree)
     Return the right child pointer for the page.
public  DataValueDescriptor[]getRowTemplate(OpenBTree open_btree)
     Return a new template for reading a data row from the current page.
public  intgetTypeFormatId()
     Return my format identifier.
public  booleanisLeftmostLeaf()
    
public  booleanisRightmostLeaf()
    
public  voidprintTree(OpenBTree btree)
     Recursively print the tree starting at current node in tree.
public static  longrestartSplitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, ControlRow child, DataValueDescriptor[] newbranchrow, DataValueDescriptor[] splitrow, int flag)
    
public  ControlRowsearch(SearchParameters sp)
     Perform a recursive search, ultimately returning the latched leaf page and row slot after which the given key belongs. The slot is returned in the result structure.
protected  ControlRowsearchLeft(OpenBTree btree)
     Search and return the left most leaf page.

Perform a recursive search, ultimately returning the leftmost leaf page which is the first leaf page in the leaf sibling chain.

protected  ControlRowsearchRight(OpenBTree btree)
     Search and return the right most leaf page.

Perform a recursive search, ultimately returning the rightmost leaf page which is the last leaf page in the leaf sibling chain.

protected  voidsetLeftChild(ControlRow leftchild)
    
protected  voidsetLeftChildPageno(long leftchild_pageno)
    
protected  booleanshrinkFor(OpenBTree open_btree, DataValueDescriptor[] shrink_key)
     Perform a recursive shrink operation for the key. If this method returns true, the caller should remove the corresponding entry for the page. This routine is not guaranteed to successfully shrink anything.
protected  longsplitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, DataValueDescriptor[] splitrow, int flag)
     Perform a top down split pass making room for the the key in "row".

Perform a split such that a subsequent call to insert given the argument index row will likely find room for it.

public  StringtoString()
     The standard toString.

Field Detail
CR_LEFTCHILD_BITMAP
final protected static FormatableBitSet CR_LEFTCHILD_BITMAP(Code)
bit sets used to fetch single columns at a time.



child_pageno_buf
transient SQLLongint child_pageno_buf(Code)
Only allocate one child_pageno_buf to read the page pointer field into, then cache to "empty" object for reuse by the page itself.



left_child_page
protected SQLLongint left_child_page(Code)




Constructor Detail
BranchControlRow
public BranchControlRow()(Code)
No arg constructor.

Public no arg constructor is for the monitor to call for format id implementation, it should not be called for any other reason.




BranchControlRow
public BranchControlRow(OpenBTree open_btree, Page page, int level, ControlRow parent, boolean isRoot, long left_child) throws StandardException(Code)




Method Detail
ControlRowInit
final protected void ControlRowInit()(Code)
Perform page specific initialization.




checkConsistency
public int checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException(Code)
Perform consistency checks for a branch page. The checks specific to a branch page are:
  • The rows on the page are indeed branch rows, and they all have the correct number of fields (which is the b-tree's key fields plus one for the child page number.
  • The child pages pointed to by the left child pointer and the index rows are linked together in the same order that they appear on the page.
  • The child pages themselves are all consistent.
  • This method also performs the consistency checks that are common to both leaf and branch pages (see ControlRow.checkGeneric).
    exception:
      StandardException - Standard exception policy.



    getChildPageAtSlot
    protected ControlRow getChildPageAtSlot(OpenBTree open_btree, int slot) throws StandardException(Code)



    getLeftChild
    public ControlRow getLeftChild(OpenBTree open_btree) throws StandardException(Code)
    Return the left child pointer for the page.

    Leaf pages don't have children, so they override this and return null. The page which is the leftmost child of this page.
    Parameters:
      open_btree - The open btree to associate latches/locks with.
    exception:
      StandardException - Standard exception policy.




    getLeftChildPageno
    long getLeftChildPageno() throws StandardException(Code)
    Return the left child page number for the page. Leaf pages don't have left children, so they override this and return null.



    getNumberOfControlRowColumns
    final protected int getNumberOfControlRowColumns()(Code)
    Get the number of columns in the control row.

    Control rows all share the first columns as defined by this class and then add columns to the end of the control row. For instance a branch control row add a child page pointer field.

    The total number of columns in the control row.




    getRightChild
    protected ControlRow getRightChild(OpenBTree open_btree) throws StandardException(Code)
    Return the right child pointer for the page.

    Leaf pages don't have children, so they override this and return null. The page which is the rightmost child of this page.
    Parameters:
      open_btree - The open btree to associate latches/locks with.
    exception:
      StandardException - Standard exception policy.




    getRowTemplate
    public DataValueDescriptor[] getRowTemplate(OpenBTree open_btree) throws StandardException(Code)
    Return a new template for reading a data row from the current page.

    Default implementation for rows which are the same as the conglomerates template, sub-classes can alter if underlying template is different (for instance branch rows add an extra field at the end). Newly allocated template.
    exception:
      StandardException - Standard exception policy.




    getTypeFormatId
    public int getTypeFormatId()(Code)
    Return my format identifier.
    See Also:   org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId



    isLeftmostLeaf
    public boolean isLeftmostLeaf() throws StandardException(Code)
    Is the current page the leftmost leaf of tree?

    true if the current page is the leftmost leaf of the tree,else return false.
    exception:
      StandardException - Standard exception policy.




    isRightmostLeaf
    public boolean isRightmostLeaf() throws StandardException(Code)
    Is the current page the rightmost leaf of tree?

    true if the current page is the rightmost leaf of the tree,else return false.
    exception:
      StandardException - Standard exception policy.




    printTree
    public void printTree(OpenBTree btree) throws StandardException(Code)
    Recursively print the tree starting at current node in tree.
    Parameters:
      btree - the open btree to print.
    exception:
      StandardException - Standard exception policy.



    restartSplitFor
    public static long restartSplitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, ControlRow child, DataValueDescriptor[] newbranchrow, DataValueDescriptor[] splitrow, int flag) throws StandardException(Code)



    search
    public ControlRow search(SearchParameters sp) throws StandardException(Code)
    Perform a recursive search, ultimately returning the latched leaf page and row slot after which the given key belongs. The slot is returned in the result structure. If the key exists on the page, the result.exact will be true. Otherwise, result.exact will be false, and the row slot returned will be the one immediately preceding the position at which the key belongs.
    exception:
      StandardException - Standard exception policy.



    searchLeft
    protected ControlRow searchLeft(OpenBTree btree) throws StandardException(Code)
    Search and return the left most leaf page.

    Perform a recursive search, ultimately returning the leftmost leaf page which is the first leaf page in the leaf sibling chain. (This method might better be called getFirstLeafPage()). The leftmost leaf page.
    Parameters:
      btree - The open btree to associate latches/locks with.
    exception:
      StandardException - Standard exception policy.




    searchRight
    protected ControlRow searchRight(OpenBTree btree) throws StandardException(Code)
    Search and return the right most leaf page.

    Perform a recursive search, ultimately returning the rightmost leaf page which is the last leaf page in the leaf sibling chain. (This method might better be called getLastLeafPage()). The rightmost leaf page.
    Parameters:
      btree - The open btree to associate latches/locks with.
    exception:
      StandardException - Standard exception policy.




    setLeftChild
    protected void setLeftChild(ControlRow leftchild) throws StandardException(Code)



    setLeftChildPageno
    protected void setLeftChildPageno(long leftchild_pageno) throws StandardException(Code)



    shrinkFor
    protected boolean shrinkFor(OpenBTree open_btree, DataValueDescriptor[] shrink_key) throws StandardException(Code)
    Perform a recursive shrink operation for the key. If this method returns true, the caller should remove the corresponding entry for the page. This routine is not guaranteed to successfully shrink anything. The page lead to by the key might turn out not to be empty by the time shrink gets there, and shrinks will give up if there is a deadlock.

    The receiver page must be latched on entry and is returned latched.
    exception:
      StandardException - Standard exception policy.




    splitFor
    protected long splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, DataValueDescriptor[] splitrow, int flag) throws StandardException(Code)
    Perform a top down split pass making room for the the key in "row".

    Perform a split such that a subsequent call to insert given the argument index row will likely find room for it. Since latches are released the client must code for the case where another user has grabbed the space made available by the split pass and be ready to do another split.

    Latches: o PARENT : is latched on entry (unless the split is the root then there is no parent. o THISBRANCH: the current page is latched on entry. o CHILD : latch the child page which will be pointed at by the left child pointer of the new page. RESOLVE (mikem) -see comments below o NEWPAGE : Allocate and latch new page. o CHILD : release. (RESOLVE) o fixparents: latch pages and reset their parent pointers. Conditionally fix up the parent links on the pages pointed at by the newly allocated page. First get latch and release on the left child page and then loop through slots on NEWPAGE, from left to right getting and releasing latches. page number of the newly allocated leaf page created by split.
    Parameters:
      open_btree - The open btree to associate latches with.
    Parameters:
      template - A scratch area to use while searching for split pass.
    Parameters:
      parent - The parent page of the current page in the split pass.starts at null for root.
    Parameters:
      splitrow - The key to make room for during the split pass.
    Parameters:
      flag - A flag used to direct where point of split should bechosen.
    exception:
      StandardException - Standard exception policy.




    toString
    public String toString()(Code)
    The standard toString.



    Fields inherited from org.apache.derby.impl.store.access.btree.ControlRow
    final protected static int CR_COLID_FIRST(Code)(Java Doc)
    final protected static int CR_COLID_LAST(Code)(Java Doc)
    final protected static FormatableBitSet CR_CONGLOM_BITSET(Code)(Java Doc)
    final protected static int CR_CONGLOM_COLID(Code)(Java Doc)
    final protected static FormatableBitSet CR_ISROOT_BITSET(Code)(Java Doc)
    final protected static int CR_ISROOT_COLID(Code)(Java Doc)
    final protected static FormatableBitSet CR_LEFTSIB_BITSET(Code)(Java Doc)
    final protected static int CR_LEFTSIB_COLID(Code)(Java Doc)
    final protected static FormatableBitSet CR_LEVEL_BITSET(Code)(Java Doc)
    final protected static int CR_LEVEL_COLID(Code)(Java Doc)
    final protected static int CR_NCOLUMNS(Code)(Java Doc)
    final protected static FormatableBitSet CR_PARENT_BITSET(Code)(Java Doc)
    final protected static int CR_PARENT_COLID(Code)(Java Doc)
    final protected static FormatableBitSet CR_RIGHTSIB_BITSET(Code)(Java Doc)
    final protected static int CR_RIGHTSIB_COLID(Code)(Java Doc)
    final protected static int CR_SLOT(Code)(Java Doc)
    final protected static FormatableBitSet CR_VERSION_BITSET(Code)(Java Doc)
    final protected static int CR_VERSION_COLID(Code)(Java Doc)
    final public static int SPLIT_FLAG_FIRST_IN_TABLE(Code)(Java Doc)
    final public static int SPLIT_FLAG_FIRST_ON_PAGE(Code)(Java Doc)
    final public static int SPLIT_FLAG_LAST_IN_TABLE(Code)(Java Doc)
    final public static int SPLIT_FLAG_LAST_ON_PAGE(Code)(Java Doc)
    protected FetchDescriptor fetchDesc(Code)(Java Doc)
    protected transient int last_search_result(Code)(Java Doc)
    protected Page page(Code)(Java Doc)
    protected DataValueDescriptor row(Code)(Java Doc)
    protected DataValueDescriptor[] scratch_row(Code)(Java Doc)
    protected transient boolean use_last_search_result_hint(Code)(Java Doc)

    Methods inherited from org.apache.derby.impl.store.access.btree.ControlRow
    public static int CompareIndexRowFromPageToKey(ControlRow indexpage, int slot, DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc) throws StandardException(Code)(Java Doc)
    public static int CompareIndexRowToKey(DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc) throws StandardException(Code)(Java Doc)
    abstract protected void ControlRowInit()(Code)(Java Doc)
    public static ControlRow Get(OpenBTree open_btree, long pageNumber) throws StandardException(Code)(Java Doc)
    public static ControlRow Get(ContainerHandle container, long pageNumber) throws StandardException(Code)(Java Doc)
    protected static ControlRow GetControlRowForPage(ContainerHandle container, Page page) throws StandardException(Code)(Java Doc)
    public static ControlRow GetNoWait(OpenBTree open_btree, long pageNumber) throws StandardException(Code)(Java Doc)
    public void auxObjectInvalidated()(Code)(Java Doc)
    abstract protected int checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException(Code)(Java Doc)
    protected void checkGeneric(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException(Code)(Java Doc)
    protected boolean checkRowOrder(OpenBTree btree, ControlRow parent) throws StandardException(Code)(Java Doc)
    protected void checkSiblings(OpenBTree btree) throws StandardException(Code)(Java Doc)
    protected boolean compareRowsOnSiblings(OpenBTree btree, ControlRow left_sib, ControlRow right_sib) throws StandardException(Code)(Java Doc)
    public String debugPage(OpenBTree open_btree) throws StandardException(Code)(Java Doc)
    public BTree getConglom(int format_id) throws StandardException(Code)(Java Doc)
    protected boolean getIsRoot() throws StandardException(Code)(Java Doc)
    abstract protected ControlRow getLeftChild(OpenBTree btree) throws StandardException(Code)(Java Doc)
    public ControlRow getLeftSibling(OpenBTree btree) throws StandardException, WaitError(Code)(Java Doc)
    protected int getLevel() throws StandardException(Code)(Java Doc)
    abstract protected int getNumberOfControlRowColumns()(Code)(Java Doc)
    public Page getPage()(Code)(Java Doc)
    protected long getParentPageNumber() throws StandardException(Code)(Java Doc)
    abstract protected ControlRow getRightChild(OpenBTree btree) throws StandardException(Code)(Java Doc)
    protected ControlRow getRightSibling(OpenBTree open_btree) throws StandardException(Code)(Java Doc)
    final protected DataValueDescriptor[] getRow()(Code)(Java Doc)
    public DataValueDescriptor[] getRowTemplate(OpenBTree open_btree) throws StandardException(Code)(Java Doc)
    protected int getVersion() throws StandardException(Code)(Java Doc)
    public long getleftSiblingPageNumber() throws StandardException(Code)(Java Doc)
    protected long getrightSiblingPageNumber() throws StandardException(Code)(Java Doc)
    abstract public boolean isLeftmostLeaf() throws StandardException(Code)(Java Doc)
    abstract public boolean isRightmostLeaf() throws StandardException(Code)(Java Doc)
    void linkRight(OpenBTree btree, ControlRow target) throws StandardException(Code)(Java Doc)
    abstract public void printTree(OpenBTree btree) throws StandardException(Code)(Java Doc)
    public void release()(Code)(Java Doc)
    abstract public ControlRow search(SearchParameters search_params) throws StandardException(Code)(Java Doc)
    protected void searchForEntry(SearchParameters params) throws StandardException(Code)(Java Doc)
    protected void searchForEntryBackward(SearchParameters params) throws StandardException(Code)(Java Doc)
    abstract protected ControlRow searchLeft(OpenBTree btree) throws StandardException(Code)(Java Doc)
    abstract protected ControlRow searchRight(OpenBTree btree) throws StandardException(Code)(Java Doc)
    protected void setIsRoot(boolean isRoot) throws StandardException(Code)(Java Doc)
    protected void setLeftSibling(ControlRow leftsib) throws StandardException(Code)(Java Doc)
    protected void setLevel(int newlevel) throws StandardException(Code)(Java Doc)
    void setParent(long parent) throws StandardException(Code)(Java Doc)
    protected void setRightSibling(ControlRow rightsib) throws StandardException(Code)(Java Doc)
    protected void setVersion(int version) throws StandardException(Code)(Java Doc)
    abstract protected boolean shrinkFor(OpenBTree btree, DataValueDescriptor[] key) throws StandardException(Code)(Java Doc)
    abstract protected long splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parentpage, DataValueDescriptor[] row, int flag) throws StandardException(Code)(Java Doc)
    public String toString()(Code)(Java Doc)
    boolean unlink(OpenBTree btree) throws StandardException(Code)(Java Doc)

    Methods inherited from java.lang.Object
    native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
    public boolean equals(Object obj)(Code)(Java Doc)
    protected void finalize() throws Throwable(Code)(Java Doc)
    final native public Class getClass()(Code)(Java Doc)
    native public int hashCode()(Code)(Java Doc)
    final native public void notify()(Code)(Java Doc)
    final native public void notifyAll()(Code)(Java Doc)
    public String toString()(Code)(Java Doc)
    final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
    final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
    final public void wait() throws InterruptedException(Code)(Java Doc)

    w__w_w.__j___a_v___a2_s_.__c__om___ | Contact Us
    Copyright 2009 - 12 Demo Source and Support. All rights reserved.
    All other trademarks are property of their respective owners.