| 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 |
Method Summary | |
public void | close() Close the conglomerate controller.
Any changes to this method will probably have to be reflected in close as
well.
Currently delegates to OpenBTree. | public boolean | closeForEndTransaction(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 boolean | delete(RowLocation loc) Delete a row from the conglomerate. | public boolean | fetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns) Fetch the row at the given location. | public boolean | fetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns, boolean waitForLock) Fetch the row at the given location. | public Properties | getInternalTablePropertySet(Properties prop) Request set of properties associated with a table. | public void | getTableProperties(Properties prop) | 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) 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 int | insert(DataValueDescriptor[] row) Insert a row into the conglomerate.
See Also: ConglomerateController.insert Parameters: row - The row to insert into the conglomerate. | public void | insertAndFetchLocation(DataValueDescriptor[] row, RowLocation templateRowLocation) Insert a row into the conglomerate, and store its location in the
provided template row location. | public boolean | isKeyed() Return whether this is a keyed conglomerate. | public long | load(TransactionManager xact_manager, boolean createConglom, RowLocationRetRowSource rowSource) Load rows from rowSource into the opened btree.
Efficiently load rows into the already opened btree. | public boolean | lockRow(RowLocation loc, int lock_operation, boolean wait, int lock_duration) Lock the given row location. | public boolean | lockRow(long page_num, int record_id, int lock_operation, boolean wait, int lock_duration) | public RowLocation | newRowLocationTemplate() Return a row location object of the correct type to be
used in calls to insertAndFetchLocation. | public boolean | replace(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns) Replace the entire row at the given location. | public void | unlockRowAfterRead(RowLocation loc, boolean forUpdate, boolean row_qualifies) |
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.
|
BTreeController | public BTreeController()(Code) | | |
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. |
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. |
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. |
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) | | |
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)
|
|
|