Documentation of 'org.apache.derby.impl.store.access.btree.BTreeController' Java class
BTreeController
org.apache.derby.impl.store.access.btree

Class BTreeController

    • Constructor Detail

      • BTreeController

        public BTreeController()
    • Method Detail

      • close

        public void close()
                   throws StandardException
        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.

        Specified by:
        close in interface ConglomerateController
        Overrides:
        close in class OpenBTree
        Throws:
        StandardException - Standard exception policy.
        See Also:
        ConglomerateController.close()
      • closeForEndTransaction

        public boolean closeForEndTransaction(boolean closeHeldScan)
                                       throws StandardException
        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.

        Specified by:
        closeForEndTransaction in interface ConglomerateController
        Parameters:
        closeHeldScan - If true, means to close controller even if it has been opened to be kept opened across commit. This is used to close these controllers on abort.
        Returns:
        boolean indicating that the close has resulted in a real close of 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.
        Throws:
        StandardException - Standard exception policy.
      • getTableProperties

        public void getTableProperties(java.util.Properties prop)
                                throws StandardException
        Request the system properties associated with a table.

        Request the value of properties that are associated with a table. The following properties can be requested: derby.storage.pageSize derby.storage.pageReservedSpace derby.storage.minimumRecordSize derby.storage.initialPages

        To get the value of a particular property add it to the property list, and on return the value of the property will be set to it's current value. For example: get_prop(ConglomerateController cc) { Properties prop = new Properties(); prop.put("derby.storage.pageSize", ""); cc.getTableProperties(prop); System.out.println( "table's page size = " + prop.getProperty("derby.storage.pageSize"); }

        Specified by:
        getTableProperties in interface ConglomPropertyQueryable
        Parameters:
        prop - Property list to fill in.
        Throws:
        StandardException - Standard exception policy.
      • getInternalTablePropertySet

        public java.util.Properties getInternalTablePropertySet(java.util.Properties prop)
                                                         throws StandardException
        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.

        Specified by:
        getInternalTablePropertySet in interface ConglomPropertyQueryable
        Parameters:
        prop - Property list to add properties to. If null, routine will create a new Properties object, fill it in and return it.
        Throws:
        StandardException - Standard exception policy.
      • load

        public long load(TransactionManager xact_manager,
                         boolean createConglom,
                         RowLocationRetRowSource rowSource)
                  throws StandardException
        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).

        Throws:
        StandardException - Standard exception policy. If conglomerate supports uniqueness checks and has been created to disallow duplicates, and one of the rows being loaded had key columns which were duplicate of a row already in the conglomerate, then raise SQLState.STORE_CONGLOMERATE_DUPLICATE_KEY_EXCEPTION.
        See Also:
        Conglomerate.load(org.apache.derby.iapi.store.access.conglomerate.TransactionManager, boolean, org.apache.derby.iapi.store.access.RowLocationRetRowSource)
      • lockRow

        public boolean lockRow(RowLocation loc,
                               int lock_operation,
                               boolean wait,
                               int lock_duration)
                        throws StandardException
        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.

        Specified by:
        lockRow in interface ConglomerateController
        Parameters:
        loc - The "RowLocation" which describes the exact row to lock.
        wait - Should the lock call wait to be granted?
        lock_operation - For what operation are we requesting the lock, this should be one of the following 4 options: LOCK_READ [read lock], (LOCK_INS | LOCK_UPD) [ lock for insert], (LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for previous key to insert], (LOCK_UPD) [lock for delete or replace] (LOCK_UPD | LOCK_UPDATE_LOCKS) [lock scan for update, will upgrade lock later if actual update is take place]
        lock_duration - If set to TransactionManager.LOCK_INSTANT_DURATION, then lock will be released immediately after being granted.
        Returns:
        true if lock was granted, only can be false if wait was false.
        Throws:
        StandardException - Standard exception policy.
      • lockRow

        public boolean lockRow(long page_num,
                               int record_id,
                               int lock_operation,
                               boolean wait,
                               int lock_duration)
                        throws StandardException
        Description copied from interface: ConglomerateController
        Lock the given record id/page num pair.

        Should only be called by access, to lock "special" locks formed from the Recordhandle.* reserved constants for page specific locks.

        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.

        Specified by:
        lockRow in interface ConglomerateController
        Parameters:
        page_num - page number of record to lock.
        record_id - record id of record to lock.
        lock_operation - For what operation are we requesting the lock, this should be one of the following 4 options: LOCK_READ [read lock], (LOCK_INS | LOCK_UPD) [ lock for insert], (LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for previous key to insert], (LOCK_UPD) [lock for delete or replace] (LOCK_UPD | LOCK_UPDATE_LOCKS) [lock scan for update, will upgrade lock later if actual update is take place]
        wait - Should the lock call wait to be granted?
        lock_duration - If set to TransactionManager.LOCK_INSTANT_DURATION, then lock will be released immediately after being granted.
        Returns:
        true if lock was granted, only can be false if wait was false.
        Throws:
        StandardException - Standard exception policy.
      • unlockRowAfterRead

        public void unlockRowAfterRead(RowLocation loc,
                                       boolean forUpdate,
                                       boolean row_qualifies)
                                throws StandardException
        Description copied from interface: ConglomerateController
        UnLock 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.

        Specified by:
        unlockRowAfterRead in interface ConglomerateController
        Parameters:
        loc - The "RowLocation" which describes the row to unlock.
        forUpdate - Row was locked for read or update.
        row_qualifies - Row was qualified and returned to the user.
        Throws:
        StandardException - Standard exception policy.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.