| java.lang.Object org.apache.derby.impl.store.access.btree.OpenBTree
All known Subclasses: org.apache.derby.impl.store.access.btree.BTreeCostController, org.apache.derby.impl.store.access.btree.BTreeScan, org.apache.derby.impl.store.access.btree.BTreeController,
OpenBTree | public class OpenBTree (Code) | | An open b-tree contains fields and methods common to scans and controllers.
Concurrency Notes<\B>
An instance of an open b-tree is owned by a single context. The b-tree code
assumes that the context ensures that only one thread at a time is using
the open b-tree. The open b-tree itself does not enforce or check this.
|
Method Summary | |
public void | checkConsistency() Check consistency of a btree.
Read in root and check consistency of entire tree. | public void | close() Close the open conglomerate. | public void | debugConglomerate() Dump information about tree into the log. | public boolean[] | getColumnSortOrderInfo() | final public BTree | getConglomerate() | final public ContainerHandle | getContainer() | public ContainerHandle | getContainerHandle() Return the container handle. | public long | getEstimatedRowCount() Get the total estimated number of rows in the container.
The number is a rough estimate and may be grossly off. | public int | getHeight() get height of the tree.
Read in root and return the height (number of levels) of the tree.
The level of a tree is 0 in the leaf and increases by 1 for each
level of the tree as you go up the tree. | final public boolean | getHold() | final public int | getLockLevel() | final public BTreeLockingPolicy | getLockingPolicy() | final public int | getOpenMode() | final public Transaction | getRawTran() | final public OpenConglomerateScratchSpace | getRuntimeMem() | public SpaceInfo | getSpaceInfo() | final public TransactionManager | getXactMgr() | 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) Initialize the open conglomerate.
If container is null, open the container, otherwise use the container
passed in. | final public boolean | isClosed() | void | isIndexableRowConsistent(DataValueDescriptor[] row) Check if all the
columns are Indexable and Storable. | public boolean | isTableLocked() | public RecordHandle | makeRecordHandle(long page_number, int rec_id) | public ContainerHandle | reopen() Open the container after it has been closed previously.
Open the container, obtaining necessary locks. | public void | setEstimatedRowCount(long count) Set the total estimated number of rows in the container.
Often, after a scan, the client of RawStore has a much better estimate
of the number of rows in the container than what store has. | final public void | setLockingPolicy(BTreeLockingPolicy policy) | 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) Testing infrastructure to cause unusual paths through the code.
Through the use of debug flags allow test code to cause otherwise
hard to cause paths through the code. |
err_containerid | protected long err_containerid(Code) | | The conglomerate containerid for error reporting.
|
init_lock_level | protected int init_lock_level(Code) | | Table or page locking?
|
init_open_user_scans | protected TransactionManager init_open_user_scans(Code) | | In the case of splits, notify all scans in this transaction to save their
current position by key, because the split may move the row they are
positioned on. This is done by calling open_user_scans.saveScanPositions().
Note that not all OpenBTree's will have a non-null open_user_scans. For
instance logical undo of btree operations will get a OpenBTree with a null
open_user_scans, this is all right because this operation should never need
to call saveScanPositions() (ie. it will never do a split).
|
checkConsistency | public void checkConsistency() throws StandardException(Code) | | Check consistency of a btree.
Read in root and check consistency of entire tree. Currently raises
sanity check errors.
RESOLVE (mikem) if this is to be supported in non-sanity servers what
should it do?
exception: StandardException - Standard exception policy. |
debugConglomerate | public void debugConglomerate() throws StandardException(Code) | | Dump information about tree into the log.
Traverse the tree dumping info about tree into the log.
exception: StandardException - Standard exception policy. |
getConglomerate | final public BTree getConglomerate()(Code) | | |
getContainerHandle | public ContainerHandle getContainerHandle()(Code) | | Return the container handle.
The open container handle of the btree. |
getEstimatedRowCount | public long getEstimatedRowCount() throws StandardException(Code) | | Get the total estimated number of rows in the container.
The number is a rough estimate and may be grossly off. In general
the server will cache the row count and then occasionally write
the count unlogged to a backing store. If the system happens to
shutdown before the store gets a chance to update the row count it
may wander from reality.
This call is currently only supported on Heap conglomerates, it
will throw an exception if called on btree conglomerates.
The total estimated number of rows in the conglomerate. exception: StandardException - Standard exception policy. |
getHeight | public int getHeight() throws StandardException(Code) | | get height of the tree.
Read in root and return the height (number of levels) of the tree.
The level of a tree is 0 in the leaf and increases by 1 for each
level of the tree as you go up the tree.
exception: StandardException - Standard exception policy. |
getHold | final public boolean getHold()(Code) | | |
getLockLevel | final public int getLockLevel()(Code) | | |
getOpenMode | final public int getOpenMode()(Code) | | |
init | 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) | | Initialize the open conglomerate.
If container is null, open the container, otherwise use the container
passed in. The container is always opened with no locking, it is up
to the caller to make the appropriate container locking call.
Parameters: open_user_scans - The user transaction which opened this btree. Parameters: xact_manager - The current transaction, usually the same as"open_user_scans", but in the case of split itis the internal xact nested below the user xact. Parameters: input_container - The open container holding the index, if it isalready open, else null which will mean thisroutine will open it. Parameters: rawtran - The current raw store transaction. Parameters: open_mode - The opening mode for the ContainerHandle. Parameters: conglomerate - Readonly description of the conglomerate. Parameters: undo - Logical undo object to associate with all updatesdone on this open btree. exception: StandardException - Standard exception policy. |
isClosed | final public boolean isClosed()(Code) | | |
isIndexableRowConsistent | void isIndexableRowConsistent(DataValueDescriptor[] row) throws StandardException(Code) | | Check if all the
columns are Indexable and Storable. Eventually this routine could
check whether all the types were right also.
exception: StandardException - Standard Exception Policy. |
isTableLocked | public boolean isTableLocked()(Code) | | is the open btree table locked?
|
reopen | public ContainerHandle reopen() throws StandardException(Code) | | Open the container after it has been closed previously.
Open the container, obtaining necessary locks. Most work is actually
done by RawStore.openContainer(). Will only reopen() if the container
is not already open.
exception: StandardException - Standard exception policy. |
setEstimatedRowCount | public void setEstimatedRowCount(long count) throws StandardException(Code) | | Set the total estimated number of rows in the container.
Often, after a scan, the client of RawStore has a much better estimate
of the number of rows in the container than what store has. For
instance if we implement some sort of update statistics command, or
just after a create index a complete scan will have been done of the
table. In this case this interface allows the client to set the
estimated row count for the container, and store will use that number
for all future references.
This call is currently only supported on Heap conglomerates, it
will throw an exception if called on btree conglomerates.
Parameters: count - the estimated number of rows in the container. exception: StandardException - Standard exception policy. |
test_errors | 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) | | Testing infrastructure to cause unusual paths through the code.
Through the use of debug flags allow test code to cause otherwise
hard to cause paths through the code.
whether the latch has been released by this routine. exception: StandardException - Standard exception policy. |
|
|