Java Doc for LeafControlRow.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.LeafControlRow

LeafControlRow
public class LeafControlRow extends ControlRow (Code)



Constructor Summary
public  LeafControlRow()
     No arg constructor.
 LeafControlRow(OpenBTree btree, Page page, ControlRow parent, boolean isRoot)
     Constructs a leaf-page control row, for a newly allocated leaf page.

Method Summary
final protected  voidControlRowInit()
     Perform page specific initialization.
public  intcheckConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages)
     Perform consistency checks on a leaf page.
protected  ControlRowgetLeftChild(OpenBTree btree)
     Return the left child pointer for the page.
final protected  intgetNumberOfControlRowColumns()
     Get the number of columns in the control row.
protected  ControlRowgetRightChild(OpenBTree btree)
     Return the right child pointer for the page.
public  intgetTypeFormatId()
     Return my format identifier.
public static  voidinitEmptyBtree(OpenBTree open_btree)
     Initialize conglomerate with one page, to be a 1 page btree. Given a conglomerate which already has one page allocated to it, initialize the page to be a leaf-root page with no entries.
public  booleanisLeftmostLeaf()
    
public  booleanisRightmostLeaf()
    
public  voidprintTree(OpenBTree btree)
     Recursively print the tree starting at current node in tree.
public  ControlRowsearch(SearchParameters sp)
     Perform a search of this leaf page, 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  booleanshrinkFor(OpenBTree btree, DataValueDescriptor[] 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_page, 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.



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

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




LeafControlRow
LeafControlRow(OpenBTree btree, Page page, ControlRow parent, boolean isRoot) throws StandardException(Code)
Constructs a leaf-page control row, for a newly allocated leaf page.
Parameters:
  btree - The open btree to allocate this page from.
Parameters:
  page - The newly allocated page where the control row willbe inserted.
Parameters:
  parent - The parent of the leaf page. Set to null for root.RESOLVE (mikem) - set to null otherwise?
Parameters:
  isRoot - Is this page the root of the tree?
exception:
  StandardException - Standard exception policy.




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 on a leaf page. Check consistency of the page and its children, returning the number of pages seen, and throwing errors if inconsistencies are found. The checks specific to a leaf page are:
  • Page is at level 0.
  • Version is a valid leaf page version.
  • Control row has right number of columns for leaf.
  • This method also performs the consistency checks that are common to both leaf and branch pages.
    See Also:   ControlRow.checkGeneric
    exception:
      StandardException - Standard exception policy.



    getLeftChild
    protected ControlRow getLeftChild(OpenBTree 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:
      btree - The open btree to associate latches/locks with.
    exception:
      StandardException - Standard exception policy.




    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 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:
      btree - The open btree to associate latches/locks with.
    exception:
      StandardException - Standard exception policy.




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



    initEmptyBtree
    public static void initEmptyBtree(OpenBTree open_btree) throws StandardException(Code)
    Initialize conglomerate with one page, to be a 1 page btree. Given a conglomerate which already has one page allocated to it, initialize the page to be a leaf-root page with no entries. Allocate the control row and store it on the page.
    Parameters:
      open_btree - The open btree to initialize (container is open).
    exception:
      StandardException - Standard exception policy.



    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. This is a leaf so return.
    exception:
      StandardException - Standard exception policy.



    search
    public ControlRow search(SearchParameters sp) throws StandardException(Code)
    Perform a search of this leaf page, 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.




    shrinkFor
    protected boolean shrinkFor(OpenBTree btree, DataValueDescriptor[] 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 unlatched.
    exception:
      StandardException - Standard exception policy.




    splitFor
    protected long splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent_page, 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.

    On entry, the parent is either null or latched, and the current page is latched. On exit, all pages will have been unlatched. If the parent is null, then this page is a root leaf page. 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_page - 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.




    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)

    www_.j_av___a2s.__c___o_m__ | Contact Us
    Copyright 2009 - 12 Demo Source and Support. All rights reserved.
    All other trademarks are property of their respective owners.