Java Doc for BTreeController.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.OpenBTree
      org.apache.derby.impl.store.access.btree.BTreeController

All known Subclasses:   org.apache.derby.impl.store.access.btree.index.B2IController,
BTreeController
public class BTreeController extends OpenBTree implements ConglomerateController(Code)
A b-tree controller corresponds to an instance of an open b-tree conglomerate.

Concurrency Notes<\B>

The concurrency rules are derived from OpenBTree.


See Also:   OpenBTree



Field Summary
 booleanget_insert_row_lock
     Whether to get lock on the row being inserted, usually this lock has already been gotten when the row was inserted into the base table.
transient  DataValueDescriptor[]scratch_template
    

Constructor Summary
public  BTreeController()
    

Method Summary
public  voidclose()
     Close the conglomerate controller.

Any changes to this method will probably have to be reflected in close as well.

Currently delegates to OpenBTree.

public  booleancloseForEndTransaction(boolean closeHeldScan)
     Close conglomerate controller as part of terminating a transaction.

Use this call to close the conglomerate controller resources as part of committing or aborting a transaction.

public  booleandelete(RowLocation loc)
     Delete a row from the conglomerate.
public  booleanfetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns)
     Fetch the row at the given location.
public  booleanfetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns, boolean waitForLock)
     Fetch the row at the given location.
public  PropertiesgetInternalTablePropertySet(Properties prop)
     Request set of properties associated with a table.
public  voidgetTableProperties(Properties prop)
    
public  voidinit(TransactionManager xact_manager, boolean hold, ContainerHandle container, Transaction rawtran, int open_mode, int lock_level, BTreeLockingPolicy btree_locking_policy, BTree conglomerate, LogicalUndo undo, StaticCompiledOpenConglomInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info)
     Initialize the controller for use.

Any changes to this method will probably have to be reflected in close as well.

Currently delegates to OpenBTree.

public  intinsert(DataValueDescriptor[] row)
     Insert a row into the conglomerate.
See Also:   ConglomerateController.insert
Parameters:
  row - The row to insert into the conglomerate.
public  voidinsertAndFetchLocation(DataValueDescriptor[] row, RowLocation templateRowLocation)
     Insert a row into the conglomerate, and store its location in the provided template row location.
public  booleanisKeyed()
     Return whether this is a keyed conglomerate.
public  longload(TransactionManager xact_manager, boolean createConglom, RowLocationRetRowSource rowSource)
     Load rows from rowSource into the opened btree.

Efficiently load rows into the already opened btree.

public  booleanlockRow(RowLocation loc, int lock_operation, boolean wait, int lock_duration)
     Lock the given row location.
public  booleanlockRow(long page_num, int record_id, int lock_operation, boolean wait, int lock_duration)
    
public  RowLocationnewRowLocationTemplate()
     Return a row location object of the correct type to be used in calls to insertAndFetchLocation.
public  booleanreplace(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns)
     Replace the entire row at the given location.
public  voidunlockRowAfterRead(RowLocation loc, boolean forUpdate, boolean row_qualifies)
    

Field Detail
get_insert_row_lock
boolean get_insert_row_lock(Code)
Whether to get lock on the row being inserted, usually this lock has already been gotten when the row was inserted into the base table.



scratch_template
transient DataValueDescriptor[] scratch_template(Code)




Constructor Detail
BTreeController
public BTreeController()(Code)




Method Detail
close
public void close() throws StandardException(Code)
Close the conglomerate controller.

Any changes to this method will probably have to be reflected in close as well.

Currently delegates to OpenBTree. If the btree controller ends up not having any state of its own, we can remove this method (the VM will dispatch to OpenBTree), gaining some small efficiency. For now, this method remains for clarity.
See Also:   ConglomerateController.close




closeForEndTransaction
public boolean closeForEndTransaction(boolean closeHeldScan) throws StandardException(Code)
Close conglomerate controller as part of terminating a transaction.

Use this call to close the conglomerate controller resources as part of committing or aborting a transaction. The normal close() routine may do some cleanup that is either unnecessary, or not correct due to the unknown condition of the controller following a transaction ending error. Use this call when closing all controllers as part of an abort of a transaction. RESOLVE (mikem) - move this call to ConglomerateManager so it is obvious that non-access clients should not call this.
Parameters:
  closeHeldScan - If true, means to close controller even ifit has been opened to be kept opened across commit. This isused to close these controllers on abort. boolean indicating that the close has resulted in a real closeof the controller. A held scan will return false if called by closeForEndTransaction(false), otherwise it will return true. A non-held scan will always return true.
exception:
  StandardException - Standard exception policy.




delete
public boolean delete(RowLocation loc) throws StandardException(Code)
Delete a row from the conglomerate.
See Also:   ConglomerateController.delete
exception:
  StandardException - Standard exception policy.



fetch
public boolean fetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns) throws StandardException(Code)
Fetch the row at the given location.
See Also:   ConglomerateController.fetch
exception:
  StandardException - Standard exception policy.



fetch
public boolean fetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns, boolean waitForLock) throws StandardException(Code)
Fetch the row at the given location.
See Also:   ConglomerateController.fetch
exception:
  StandardException - Standard exception policy.



getInternalTablePropertySet
public Properties getInternalTablePropertySet(Properties prop) throws StandardException(Code)
Request set of properties associated with a table.

Returns a property object containing all properties that the store knows about, which are stored persistently by the store. This set of properties may vary from implementation to implementation of the store.

This call is meant to be used only for internal query of the properties by jbms, for instance by language during bulk insert so that it can create a new conglomerate which exactly matches the properties that the original container was created with. This call should not be used by the user interface to present properties to users as it may contain properties that are meant to be internal to jbms. Some properties are meant only to be specified by jbms code and not by users on the command line.

Note that not all properties passed into createConglomerate() are stored persistently, and that set may vary by store implementation.
Parameters:
  prop - Property list to add properties to. If null, routine willcreate a new Properties object, fill it in and return it.
exception:
  StandardException - Standard exception policy.




getTableProperties
public void getTableProperties(Properties prop) throws StandardException(Code)



init
public void init(TransactionManager xact_manager, boolean hold, ContainerHandle container, Transaction rawtran, int open_mode, int lock_level, BTreeLockingPolicy btree_locking_policy, BTree conglomerate, LogicalUndo undo, StaticCompiledOpenConglomInfo static_info, DynamicCompiledOpenConglomInfo dynamic_info) throws StandardException(Code)
Initialize the controller for use.

Any changes to this method will probably have to be reflected in close as well.

Currently delegates to OpenBTree. If the btree controller ends up not having any state of its own, we can remove this method (the VM will dispatch to OpenBTree), gaining some small efficiency. For now, this method remains for clarity.
exception:
  StandardException - Standard exception policy.




insert
public int insert(DataValueDescriptor[] row) throws StandardException(Code)
Insert a row into the conglomerate.
See Also:   ConglomerateController.insert
Parameters:
  row - The row to insert into the conglomerate. The storedrepresentations of the row's columns are copied into a new rowsomewhere in the conglomerate. Returns 0 if insert succeeded. Returns ConglomerateController.ROWISDUPLICATE if conglomerate supports uniquenesschecks and has been created to disallow duplicates, and the row insertedhad key columns which were duplicate of a row already in the table. Otherinsert failures will raise StandardException's.
exception:
  StandardException - Standard exception policy.



insertAndFetchLocation
public void insertAndFetchLocation(DataValueDescriptor[] row, RowLocation templateRowLocation) throws StandardException(Code)
Insert a row into the conglomerate, and store its location in the provided template row location. Unimplemented by btree.
See Also:   ConglomerateController.insertAndFetchLocation
exception:
  StandardException - Standard exception policy.



isKeyed
public boolean isKeyed()(Code)
Return whether this is a keyed conglomerate.

All b-trees are keyed.
See Also:   ConglomerateController.isKeyed




load
public long load(TransactionManager xact_manager, boolean createConglom, RowLocationRetRowSource rowSource) throws StandardException(Code)
Load rows from rowSource into the opened btree.

Efficiently load rows into the already opened btree. The btree must be table locked, as no row locks will be requested by this routine. On exit from this routine the conglomerate will be closed (on both error or success).

This routine does an almost bottom up build of a btree. It assumes all rows arrive in sorted order, and inserts them directly into the next (to the right) spot in the current leaf until there is no space. Then it calls the generic split code to add the next leaf (RESOLVE - in the future we could optimize this to split bottom up rather than top down for create index).
exception:
  StandardException - Standard exception policy. If conglomeratesupports uniqueness checks and has been created to disallow duplicates, and one of the rows being loaded had key columns whichwere duplicate of a row already in the conglomerate, then raise SQLState.STORE_CONGLOMERATE_DUPLICATE_KEY_EXCEPTION.
See Also:   Conglomerate.load




lockRow
public boolean lockRow(RowLocation loc, int lock_operation, boolean wait, int lock_duration) throws StandardException(Code)
Lock the given row location.

Should only be called by access.

This call can be made on a ConglomerateController that was opened for locking only.

RESOLVE (mikem) - move this call to ConglomerateManager so it is obvious that non-access clients should not call this. true if lock was granted, only can be false if wait was false.
Parameters:
  loc - The "RowLocation" which describes the exact row to lock.
Parameters:
  wait - Should the lock call wait to be granted?
exception:
  StandardException - Standard exception policy.




lockRow
public boolean lockRow(long page_num, int record_id, int lock_operation, boolean wait, int lock_duration) throws StandardException(Code)



newRowLocationTemplate
public RowLocation newRowLocationTemplate() throws StandardException(Code)
Return a row location object of the correct type to be used in calls to insertAndFetchLocation.
See Also:   ConglomerateController.newRowLocationTemplate
exception:
  StandardException - Standard exception policy.



replace
public boolean replace(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns) throws StandardException(Code)
Replace the entire row at the given location.
See Also:   ConglomerateController.replace
exception:
  StandardException - Standard exception policy.



unlockRowAfterRead
public void unlockRowAfterRead(RowLocation loc, boolean forUpdate, boolean row_qualifies) throws StandardException(Code)



Fields inherited from org.apache.derby.impl.store.access.btree.OpenBTree
protected LogicalUndo btree_undo(Code)(Java Doc)
protected ContainerHandle container(Code)(Java Doc)
protected long err_containerid(Code)(Java Doc)
protected int init_lock_level(Code)(Java Doc)
protected TransactionManager init_open_user_scans(Code)(Java Doc)
protected OpenConglomerateScratchSpace runtime_mem(Code)(Java Doc)

Methods inherited from org.apache.derby.impl.store.access.btree.OpenBTree
public void checkConsistency() throws StandardException(Code)(Java Doc)
public void close() throws StandardException(Code)(Java Doc)
public void debugConglomerate() throws StandardException(Code)(Java Doc)
public boolean[] getColumnSortOrderInfo() throws StandardException(Code)(Java Doc)
final public BTree getConglomerate()(Code)(Java Doc)
final public ContainerHandle getContainer()(Code)(Java Doc)
public ContainerHandle getContainerHandle()(Code)(Java Doc)
public long getEstimatedRowCount() throws StandardException(Code)(Java Doc)
public int getHeight() throws StandardException(Code)(Java Doc)
final public boolean getHold()(Code)(Java Doc)
final public int getLockLevel()(Code)(Java Doc)
final public BTreeLockingPolicy getLockingPolicy()(Code)(Java Doc)
final public int getOpenMode()(Code)(Java Doc)
final public Transaction getRawTran()(Code)(Java Doc)
final public OpenConglomerateScratchSpace getRuntimeMem()(Code)(Java Doc)
public SpaceInfo getSpaceInfo() throws StandardException(Code)(Java Doc)
final public TransactionManager getXactMgr()(Code)(Java Doc)
public void init(TransactionManager open_user_scans, TransactionManager xact_manager, ContainerHandle input_container, Transaction rawtran, boolean hold, int open_mode, int lock_level, BTreeLockingPolicy btree_locking_policy, BTree conglomerate, LogicalUndo undo, DynamicCompiledOpenConglomInfo dynamic_info) throws StandardException(Code)(Java Doc)
final public boolean isClosed()(Code)(Java Doc)
void isIndexableRowConsistent(DataValueDescriptor[] row) throws StandardException(Code)(Java Doc)
public boolean isTableLocked()(Code)(Java Doc)
public RecordHandle makeRecordHandle(long page_number, int rec_id) throws StandardException(Code)(Java Doc)
public ContainerHandle reopen() throws StandardException(Code)(Java Doc)
public void setEstimatedRowCount(long count) throws StandardException(Code)(Java Doc)
final public void setLockingPolicy(BTreeLockingPolicy policy)(Code)(Java Doc)
public static boolean test_errors(OpenBTree open_btree, String debug_string, boolean release_scan_lock, BTreeLockingPolicy btree_locking_policy, LeafControlRow leaf, boolean input_latch_released) 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___a__2___s__._co___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.