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

All known Subclasses:   org.apache.derby.impl.store.access.btree.LeafControlRow,  org.apache.derby.impl.store.access.btree.BranchControlRow,
ControlRow
abstract public class ControlRow implements AuxObject,TypedFormat(Code)
Base class for leaf and branch control rows.

Concurrency Notes

All access through control rows is serialized by an exclusive latch on the page the control row is for. The page is latched when the control row is "gotten" (ControlRow#Get), and unlatched when the control row is released (ControlRow#release).

To Do List

  • [NOTE1] The code is arranged to fault in fields from the row as necessary. many of the fields of a control row are rarely used (left sibling, parent). The accessors fault in the underlying column only when requested by allocating the appropriate object and calling fetchFromSlot and only fetching the requested field.
  • [NOTE2] Currently, all the fields of the control row are stored as StorableU8s for simplicity. This is too few bits to hold the long page numbers, and too many to hold the version, level, and isRoot flag. Some consideration will have to be given to the appropriate storage format for these values.
  • [NOTE3] The implementation relies on the existance of page "auxiliary" pointers which keep Object versions of the control row.


    See Also:   ControlRow.Get
    See Also:   ControlRow.release



Field Summary
final protected static  intCR_COLID_FIRST
     Column number assignments for columns of the control row.

The control row is stored as the first row in a btree page.

final protected static  intCR_COLID_LAST
    
final protected static  FormatableBitSetCR_CONGLOM_BITSET
    
final protected static  intCR_CONGLOM_COLID
    
final protected static  FormatableBitSetCR_ISROOT_BITSET
    
final protected static  intCR_ISROOT_COLID
    
final protected static  FormatableBitSetCR_LEFTSIB_BITSET
    
final protected static  intCR_LEFTSIB_COLID
    
final protected static  FormatableBitSetCR_LEVEL_BITSET
    
final protected static  intCR_LEVEL_COLID
    
final protected static  intCR_NCOLUMNS
    
final protected static  FormatableBitSetCR_PARENT_BITSET
    
final protected static  intCR_PARENT_COLID
    
final protected static  FormatableBitSetCR_RIGHTSIB_BITSET
    
final protected static  intCR_RIGHTSIB_COLID
    
final protected static  intCR_SLOT
     The slot at which all control rows reside.
final protected static  FormatableBitSetCR_VERSION_BITSET
     bit sets used to fetch single columns at a time.
final protected static  intCR_VERSION_COLID
    
final public static  intSPLIT_FLAG_FIRST_IN_TABLE
    
final public static  intSPLIT_FLAG_FIRST_ON_PAGE
    
final public static  intSPLIT_FLAG_LAST_IN_TABLE
    
final public static  intSPLIT_FLAG_LAST_ON_PAGE
     Values passed in the flag argument to splitFor.
protected  FetchDescriptorfetchDesc
     FetchDescriptor used to replace fetchFieldFromSlot() calls.
protected transient  intlast_search_result
     In memory hint about where to begin the binary search to find a key on the the current control page.
protected  Pagepage
     The page that this control row describes.
protected  DataValueDescriptorrow
     The page that this control row describes.
protected  DataValueDescriptor[]scratch_row
     row used to replace fetchFieldFromSlot() calls.
protected transient  booleanuse_last_search_result_hint
     In memory hint about whether to use the last_search_result hint during search.

Constructor Summary
protected  ControlRow()
     No arg constructor.
protected  ControlRow(OpenBTree btree, Page page, int level, ControlRow parent, boolean isRoot)
     Constructor for making a new control row as part of allocating a new page.
protected  ControlRow(ContainerHandle container, Page page)
     Constructor for making a control row for an existing page.

Method Summary
public static  intCompareIndexRowFromPageToKey(ControlRow indexpage, int slot, DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc)
     Compare two orderable rows, considering nCompareCols, and return -1, 0, or 1 depending on whether the first row (indexrow) is less than, equal to, or greater than the second (key).
public static  intCompareIndexRowToKey(DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc)
    
abstract protected  voidControlRowInit()
     Perform page specific initialization.
public static  ControlRowGet(OpenBTree open_btree, long pageNumber)
     Get the control row from the given page in the b-tree.
public static  ControlRowGet(ContainerHandle container, long pageNumber)
    
protected static  ControlRowGetControlRowForPage(ContainerHandle container, Page page)
    
public static  ControlRowGetNoWait(OpenBTree open_btree, long pageNumber)
     Get the control row for the given page if the latch on the page can be obtained without waiting, else return null.
public  voidauxObjectInvalidated()
    
abstract protected  intcheckConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages)
     Check consistency of the page and its children, returning the number of pages seen, and throwing errors if inconsistencies are found.
protected  voidcheckGeneric(OpenBTree btree, ControlRow parent, boolean check_other_pages)
     Perform consistency checks which are common to all pages that derive from ControlRow (both leaf and branch pages).
protected  booleancheckRowOrder(OpenBTree btree, ControlRow parent)
     Check that all rows on the page are in order.
protected  voidcheckSiblings(OpenBTree btree)
     Perform checks on the siblings of this page: make sure that they're at the same level as this page, that they're mutually linked together, and that the first/last keys on sibling pages are in order.
protected  booleancompareRowsOnSiblings(OpenBTree btree, ControlRow left_sib, ControlRow right_sib)
    
public  StringdebugPage(OpenBTree open_btree)
     Dump complete information about control row and rows on the page.
public  BTreegetConglom(int format_id)
     Get format id information for row on page.

Returns the format id information for a row on the page.

protected  booleangetIsRoot()
    
abstract protected  ControlRowgetLeftChild(OpenBTree btree)
     Return the left child pointer for the page.
public  ControlRowgetLeftSibling(OpenBTree btree)
     Get the control row for this page's left sibling, or null if there is no left sibling (which probably means it's the leftmost page at its level).
protected  intgetLevel()
    
abstract protected  intgetNumberOfControlRowColumns()
     Get the number of columns in the control row.
public  PagegetPage()
    
protected  longgetParentPageNumber()
     Get the page number of the parent, if it's being maintained.
abstract protected  ControlRowgetRightChild(OpenBTree btree)
     Return the right child pointer for the page.
protected  ControlRowgetRightSibling(OpenBTree open_btree)
     Return the control row for this page's right sibling.
final protected  DataValueDescriptor[]getRow()
     Get the row.
public  DataValueDescriptor[]getRowTemplate(OpenBTree open_btree)
     Return a new template for reading a data row from the current page.
protected  intgetVersion()
     Get version of the control row.
public  longgetleftSiblingPageNumber()
     Get the page number of the left sibling.
protected  longgetrightSiblingPageNumber()
     Get the page number of the right sibling.
abstract public  booleanisLeftmostLeaf()
    
abstract public  booleanisRightmostLeaf()
    
 voidlinkRight(OpenBTree btree, ControlRow target)
     Link this page to the right of the target page.

Upon entry, this page and the target must be latched.

abstract public  voidprintTree(OpenBTree btree)
     Recursively print the tree starting at current node in tree.
public  voidrelease()
     Release this control row's resources.
abstract public  ControlRowsearch(SearchParameters search_params)
     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  voidsearchForEntry(SearchParameters params)
     Search this index page.

This method is very performance sensitive.

protected  voidsearchForEntryBackward(SearchParameters params)
    
abstract 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.

abstract 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  voidsetIsRoot(boolean isRoot)
    
protected  voidsetLeftSibling(ControlRow leftsib)
    
protected  voidsetLevel(int newlevel)
    
 voidsetParent(long parent)
    
protected  voidsetRightSibling(ControlRow rightsib)
    
protected  voidsetVersion(int version)
     Set version of the control row.

Sets the version of the control row.

abstract 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.
abstract protected  longsplitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parentpage, DataValueDescriptor[] row, 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().
 booleanunlink(OpenBTree btree)
     Unlink this page from its siblings.

Field Detail
CR_COLID_FIRST
final protected static int CR_COLID_FIRST(Code)
Column number assignments for columns of the control row.

The control row is stored as the first row in a btree page. The row is an array of columns. The Control row columns are the columns numbered from ControlRow.CR_COLID_FIRST through ControlRow.CR_COLID_LAST. The classes which implement the concrete derived classes of ControlRow may add columns to the control row, but they must be added after the ControlRow columns.




CR_COLID_LAST
final protected static int CR_COLID_LAST(Code)



CR_CONGLOM_BITSET
final protected static FormatableBitSet CR_CONGLOM_BITSET(Code)



CR_CONGLOM_COLID
final protected static int CR_CONGLOM_COLID(Code)



CR_ISROOT_BITSET
final protected static FormatableBitSet CR_ISROOT_BITSET(Code)



CR_ISROOT_COLID
final protected static int CR_ISROOT_COLID(Code)



CR_LEFTSIB_BITSET
final protected static FormatableBitSet CR_LEFTSIB_BITSET(Code)



CR_LEFTSIB_COLID
final protected static int CR_LEFTSIB_COLID(Code)



CR_LEVEL_BITSET
final protected static FormatableBitSet CR_LEVEL_BITSET(Code)



CR_LEVEL_COLID
final protected static int CR_LEVEL_COLID(Code)



CR_NCOLUMNS
final protected static int CR_NCOLUMNS(Code)



CR_PARENT_BITSET
final protected static FormatableBitSet CR_PARENT_BITSET(Code)



CR_PARENT_COLID
final protected static int CR_PARENT_COLID(Code)



CR_RIGHTSIB_BITSET
final protected static FormatableBitSet CR_RIGHTSIB_BITSET(Code)



CR_RIGHTSIB_COLID
final protected static int CR_RIGHTSIB_COLID(Code)



CR_SLOT
final protected static int CR_SLOT(Code)
The slot at which all control rows reside.



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



CR_VERSION_COLID
final protected static int CR_VERSION_COLID(Code)



SPLIT_FLAG_FIRST_IN_TABLE
final public static int SPLIT_FLAG_FIRST_IN_TABLE(Code)



SPLIT_FLAG_FIRST_ON_PAGE
final public static int SPLIT_FLAG_FIRST_ON_PAGE(Code)



SPLIT_FLAG_LAST_IN_TABLE
final public static int SPLIT_FLAG_LAST_IN_TABLE(Code)



SPLIT_FLAG_LAST_ON_PAGE
final public static int SPLIT_FLAG_LAST_ON_PAGE(Code)
Values passed in the flag argument to splitFor.



fetchDesc
protected FetchDescriptor fetchDesc(Code)
FetchDescriptor used to replace fetchFieldFromSlot() calls.



last_search_result
protected transient int last_search_result(Code)
In memory hint about where to begin the binary search to find a key on the the current control page.



page
protected Page page(Code)
The page that this control row describes.



row
protected DataValueDescriptor row(Code)
The page that this control row describes.



scratch_row
protected DataValueDescriptor[] scratch_row(Code)
row used to replace fetchFieldFromSlot() calls.



use_last_search_result_hint
protected transient boolean use_last_search_result_hint(Code)
In memory hint about whether to use the last_search_result hint during search.




Constructor Detail
ControlRow
protected ControlRow()(Code)
No arg constructor.

GetControlRowForPage() will call this constructor when it uses the monitor to create a control row dynamically given a given format id.




ControlRow
protected ControlRow(OpenBTree btree, Page page, int level, ControlRow parent, boolean isRoot) throws StandardException(Code)
Constructor for making a new control row as part of allocating a new page. Fills in all the fields but does not write them anywhere.

Changes to this constructor will probably require changes to the corresponding accessor(s).
Parameters:
  btree - Static information about the btree.
Parameters:
  page - The page described by this control row.
Parameters:
  parent - The parent page of this page, "null" if this page is root or if not maintaining parent links.
Parameters:
  isRoot - Is this page the root of the tree?
exception:
  StandardException - Standard exception policy.




ControlRow
protected ControlRow(ContainerHandle container, Page page) throws StandardException(Code)
Constructor for making a control row for an existing page.

Not all the fields are filled in; their values will get faulted in from the page as necessary.

Classes which extend ControlRow must delegate to this constructor and may want to override it as well. Changes to this constructor will probably require changes to the corresponding accessor(s).
Parameters:
  container - Open container
Parameters:
  page - The page described by this control row.
exception:
  StandardException - Standard exception policy.





Method Detail
CompareIndexRowFromPageToKey
public static int CompareIndexRowFromPageToKey(ControlRow indexpage, int slot, DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc) throws StandardException(Code)
Compare two orderable rows, considering nCompareCols, and return -1, 0, or 1 depending on whether the first row (indexrow) is less than, equal to, or greater than the second (key). The key may have fewer columns present than nCompareCols. In such a case, if all the columns of the partial key match all of the corresponding columns in the index row, then the value passed in in partialKeyOrder is returned. The caller should pass in partialKeyOrder=1 if the index rows which match a partial key should be considered to be greater than the partial key, and -1 if they should be considered to be less. This routine only reads objects off the page if it needs them, so if a multi-part key differs in the first column the subsequent columns are not read.
Parameters:
  indexpage - Controlrow of page to get target row from.
Parameters:
  slot - Slot to get control row from.
Parameters:
  indexrow - template of the target row (the row in the index).
Parameters:
  key - the (possibly partial) search key.
Parameters:
  nCompareCols - the number of columns to compare.
Parameters:
  partialKeyOrder - what to return on a partial key match.
Parameters:
  ascOrDesc - column sort order information
throws:
  StandardException - if lower levels have a problem.
exception:
  StandardException - Standard exception policy.



CompareIndexRowToKey
public static int CompareIndexRowToKey(DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc) throws StandardException(Code)



ControlRowInit
abstract protected void ControlRowInit()(Code)
Perform page specific initialization.




Get
public static ControlRow Get(OpenBTree open_btree, long pageNumber) throws StandardException(Code)
Get the control row from the given page in the b-tree. The returned control row will be of the correct type for the page (i.e., either a LeafControlRow or a BranchControlRow).
exception:
  StandardException - Standard exception policy.



Get
public static ControlRow Get(ContainerHandle container, long pageNumber) throws StandardException(Code)



GetControlRowForPage
protected static ControlRow GetControlRowForPage(ContainerHandle container, Page page) throws StandardException(Code)



GetNoWait
public static ControlRow GetNoWait(OpenBTree open_btree, long pageNumber) throws StandardException(Code)
Get the control row for the given page if the latch on the page can be obtained without waiting, else return null.
exception:
  StandardException - Standard exception policy.



auxObjectInvalidated
public void auxObjectInvalidated()(Code)
Called when the page is being evicted from cache or when a rollback happened on the page and may possibly have changed the control row's value
See Also:   AuxObject.auxObjectInvalidated



checkConsistency
abstract protected int checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException(Code)
Check consistency of the page and its children, returning the number of pages seen, and throwing errors if inconsistencies are found.

The identifier to be used to open the conglomerate later.
Parameters:
  btree - The open btree to associate latches/locks with.
Parameters:
  parent - The parent page of this page, "null" if this page is root or if not maintaining parent links.
Parameters:
  check_other_pages - Should the consistency check go to other pages (this option breaks the latch protocol).
exception:
  StandardException - Standard exception policy.




checkGeneric
protected void checkGeneric(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException(Code)
Perform consistency checks which are common to all pages that derive from ControlRow (both leaf and branch pages). The checks are:
  • This page thinks the parent argument is actually its parent.
  • The level of this page is 1 less than the level of the parent.
  • All the rows on the page are in order.
  • Both left and right siblings, if they exist, are at the same level of this page.
  • This page is the left sibling of its right sibling, and it's the right sibling of its left sibling.
  • The last row on the left sibling is < the first row on this page.
  • The first row on the right sibling is > than the the last row on this page.
  • Note that these last two are really only true if there are never duplicate keys.
    exception:
      StandardException - Standard exception policy.



    checkRowOrder
    protected boolean checkRowOrder(OpenBTree btree, ControlRow parent) throws StandardException(Code)
    Check that all rows on the page are in order. This means that each key is > than the previous key.
    exception:
      StandardException - Standard exception policy.



    checkSiblings
    protected void checkSiblings(OpenBTree btree) throws StandardException(Code)
    Perform checks on the siblings of this page: make sure that they're at the same level as this page, that they're mutually linked together, and that the first/last keys on sibling pages are in order.
    exception:
      StandardException - Standard exception policy.



    compareRowsOnSiblings
    protected boolean compareRowsOnSiblings(OpenBTree btree, ControlRow left_sib, ControlRow right_sib) throws StandardException(Code)



    debugPage
    public String debugPage(OpenBTree open_btree) throws StandardException(Code)
    Dump complete information about control row and rows on the page.

    string with all info.
    exception:
      StandardException - Standard exception policy.




    getConglom
    public BTree getConglom(int format_id) throws StandardException(Code)
    Get format id information for row on page.

    Returns the format id information for a row on the page. faulting it in from the page if necessary. format id of a row on the page.
    exception:
      StandardException - Standard exception policy.




    getIsRoot
    protected boolean getIsRoot() throws StandardException(Code)



    getLeftChild
    abstract 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.




    getLeftSibling
    public ControlRow getLeftSibling(OpenBTree btree) throws StandardException, WaitError(Code)
    Get the control row for this page's left sibling, or null if there is no left sibling (which probably means it's the leftmost page at its level). Since right-to-left traversal of an index level is deadlock-prone, this method will only get get the left sibling if it can latch it without waiting.
    exception:
      WaitError - if the latch request would have had to wait.
    exception:
      StandardException - Standard exception policy.



    getLevel
    protected int getLevel() throws StandardException(Code)



    getNumberOfControlRowColumns
    abstract 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.




    getPage
    public Page getPage()(Code)



    getParentPageNumber
    protected long getParentPageNumber() throws StandardException(Code)
    Get the page number of the parent, if it's being maintained. Note that there is intentionally no way to get the control row for the parent page - the b-tree code NEVER traverses up the tree, even in consistency checks.
    exception:
      StandardException - Standard exception policy.



    getRightChild
    abstract 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.




    getRightSibling
    protected ControlRow getRightSibling(OpenBTree open_btree) throws StandardException(Code)
    Return the control row for this page's right sibling. Unlike getting the left sibling, it's ok to wait for the right sibling latch since left-to-right is the deadlock-free ordering.
    exception:
      StandardException - Standard exception policy.



    getRow
    final protected DataValueDescriptor[] getRow()(Code)
    Get the row.

    Return the object array that represents the control row for use in raw store fetch, insert, and/or update. The row.




    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.




    getVersion
    protected int getVersion() throws StandardException(Code)
    Get version of the control row.

    Returns the version of the control row, faulting it in from the page if necessary. version of the control row.
    exception:
      StandardException - Standard exception policy.




    getleftSiblingPageNumber
    public long getleftSiblingPageNumber() throws StandardException(Code)
    Get the page number of the left sibling. Fault it's value in if it hasn't been yet.
    exception:
      StandardException - Standard exception policy.



    getrightSiblingPageNumber
    protected long getrightSiblingPageNumber() throws StandardException(Code)
    Get the page number of the right sibling. Fault it's value in if it hasn't been yet.
    exception:
      StandardException - Standard exception policy.



    isLeftmostLeaf
    abstract 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
    abstract 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.




    linkRight
    void linkRight(OpenBTree btree, ControlRow target) throws StandardException(Code)
    Link this page to the right of the target page.

    Upon entry, this page and the target must be latched. Upon exit, this page and the target remain latched.

    This method carefully acquires pages from left to right in order to avoid deadlocks.
    exception:
      StandardException - Standard exception policy.




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



    release
    public void release()(Code)
    Release this control row's resources.



    search
    abstract public ControlRow search(SearchParameters search_params) 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 resultExact field will be true. Otherwise, resultExact field 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.



    searchForEntry
    protected void searchForEntry(SearchParameters params) throws StandardException(Code)
    Search this index page.

    This method is very performance sensitive. It is the intention that no object allocations occur during the execution of this method.

    This method performs a binary search on the page and finds the entry i on the page such that entry[i] <= key < entry[i+1]. The result of the search is filled into the passed in params structure.
    Parameters:
      params - the parameters of the search
    exception:
      StandardException - could be thrown by underlying raw store operations.
    See Also:   SearchParameters




    searchForEntryBackward
    protected void searchForEntryBackward(SearchParameters params) throws StandardException(Code)



    searchLeft
    abstract 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
    abstract 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.




    setIsRoot
    protected void setIsRoot(boolean isRoot) throws StandardException(Code)



    setLeftSibling
    protected void setLeftSibling(ControlRow leftsib) throws StandardException(Code)



    setLevel
    protected void setLevel(int newlevel) throws StandardException(Code)



    setParent
    void setParent(long parent) throws StandardException(Code)



    setRightSibling
    protected void setRightSibling(ControlRow rightsib) throws StandardException(Code)



    setVersion
    protected void setVersion(int version) throws StandardException(Code)
    Set version of the control row.

    Sets the version of the control row. Updates both the in-memory control row and the disk copy.
    exception:
      StandardException - Standard exception policy.




    shrinkFor
    abstract 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.

    As currently implemented shrinkFor must be executed while holding an exclusive container lock on the entire table. It is expected that this call is made within an internal transaction which has been called by a post commit thread. Latches are released by the code. The raw store guarantees that deallocated pages are not seen by other xacts until the transaction has been committed.

    Note that a non-table level lock implementation must hold latches on pages affected until end transaction.

    On entry, the current page is latched. On exit, all pages will have been unlatched.
    exception:
      StandardException - Standard exception policy.




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

    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:
      parentpage - The parent page of the current page in the split pass.starts at null for root.
    Parameters:
      row - 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().

    This is a concise print out of the info in the control row, does not include anything the page.




    unlink
    boolean unlink(OpenBTree btree) throws StandardException(Code)
    Unlink this page from its siblings. This method will give up and return false rather than run the risk of a deadlock.

    On entry this page must be latched. The siblings are latched and unlatched during the operation. Upon exit, this page will remain latched, but unlinked from its siblings and deallocated from the container.

    The seemingly odd situation that this page will be returned latched but deallocated is intentional. The container will not be able to reuse this page until the latch is released, and the caller may still need to read information out of it.
    exception:
      StandardException - Standard exception policy.




    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___._ja__v__a__2s_._c___om | Contact Us
    Copyright 2009 - 12 Demo Source and Support. All rights reserved.
    All other trademarks are property of their respective owners.