Package org.apache.derby.impl.store.access.btree

Examples of org.apache.derby.impl.store.access.btree.OpenBTree


                false,
                TransactionController.OPENMODE_FOR_LOCK_ONLY,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_SERIALIZABLE);
       
        OpenBTree open_btree = new OpenBTree();

        BTreeLockingPolicy b2i_locking_policy =
            new B2ITableLocking3(
                rawtran,
                TransactionController.MODE_TABLE,
                rawtran.newLockingPolicy(
                    LockingPolicy.MODE_CONTAINER,
                    TransactionController.ISOLATION_SERIALIZABLE, true), base_cc, open_btree);


        // The following call will "open" the new btree.  Create is
        // an interesting case.  What we really want is read only table lock
        // on the base conglomerate and update locks on the index.  For now
        // just get the update lock on the base table, this is done by the
        // lockTable() call made by base class.

        open_btree.init(
            (TransactionManager) xact_manager,  // current user xact
            (TransactionManager) xact_manager,  // current xact
            (ContainerHandle) null,     // have init open the container.
            rawtran,
            false,
            (ContainerHandle.MODE_FORUPDATE),
            TransactionController.MODE_TABLE,
            b2i_locking_policy,         // get table level lock.
            this,                      
            (LogicalUndo) null,         // no logical undo necessary, as
                                        // initEmptyBtree()
                                        // work will be done single user and
                                        // rows will not move.
            (DynamicCompiledOpenConglomInfo) null);
                                       
    // Open the newly created container, and insert the first control row.
        LeafControlRow.initEmptyBtree(open_btree);

        open_btree.close();

        base_cc.close();
  }


                false,
                TransactionController.OPENMODE_FOR_LOCK_ONLY,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_SERIALIZABLE);
       
        OpenBTree open_btree = new OpenBTree();

        BTreeLockingPolicy b2i_locking_policy =
            new B2ITableLocking3(
                rawtran,
                TransactionController.MODE_TABLE,
                rawtran.newLockingPolicy(
                    LockingPolicy.MODE_CONTAINER,
                    TransactionController.ISOLATION_SERIALIZABLE, true), base_cc, open_btree);


        // The following call will "open" the new btree.  Create is
        // an interesting case.  What we really want is read only table lock
        // on the base conglomerate and update locks on the index.  For now
        // just get the update lock on the base table, this is done by the
        // lockTable() call made by base class.

        open_btree.init(
            (TransactionManager) xact_manager,  // current user xact
            (TransactionManager) xact_manager,  // current xact
            (ContainerHandle) null,     // have init open the container.
            rawtran,
            false,
            (ContainerHandle.MODE_FORUPDATE),
            TransactionController.MODE_TABLE,
            b2i_locking_policy,         // get table level lock.
            this,                      
            (LogicalUndo) null,         // no logical undo necessary, as
                                        // initEmptyBtree()
                                        // work will be done single user and
                                        // rows will not move.
            (DynamicCompiledOpenConglomInfo) null);
                                       
    // Open the newly created container, and insert the first control row.
        LeafControlRow.initEmptyBtree(open_btree);

        open_btree.close();

        base_cc.close();
  }

        ok_exit = false;
        try
        {
            // "open" the btree, using recovery's already opened container
            OpenBTree open_btree = new OpenBTree();

            open_btree.init(
                (TransactionManager) null,  // current user xact - not needed
                (TransactionManager) null,  // current xact      - not needed
                pageOp.getContainer(),      // recovery already opened container
                rawtran,
                false,
                ContainerHandle.MODE_FORUPDATE,
                                            // open_mode not used - container is
                                            // already opened.
                TransactionManager.MODE_NONE,
                (BTreeLockingPolicy) null,  // don't get locks during undo
                btree,                      
                (LogicalUndo) null,         // no logical undo necessary, as
                                            // this code only does read.
                (DynamicCompiledOpenConglomInfo) null);

            // System.out.println(
              //   "calling logical undo, recordhandle = " + rechandle);
            // System.out.println("calling logical undo, record= " +
              //    logged_index_row_template);

            // Get the page where the record was originally, before splits
            // could have possibly moved it.
            control_row = ControlRow.Get(open_btree, rechandle.getPageNumber());

            // init compare_result, if record doesn't exist do the search
            compare_result = 1;

            if (control_row.getPage().recordExists(rechandle, true))
            {

                if (SanityManager.DEBUG)
                {
                    SanityManager.ASSERT(
                        control_row.getPage().fetchNumFields(rechandle) ==
                        logged_index_row_template.length);
                }

                // create template for the page index row from the conglomerate.
                RecordHandle ret_rechandle =
                    control_row.getPage().fetchFromSlot(
                        (RecordHandle) null,
                        control_row.getPage().getSlotNumber(rechandle),
                        template,
                        (FetchDescriptor) null,
                        true);

                // compare the 2 rows, and if they are the same then the raw
                // store has the right page and record and there is no work to
                // be done (this is usual case).
                compare_result = ControlRow.CompareIndexRowToKey(
                    template, logged_index_row_template,
                    logged_index_row_template.length, 1,
                    open_btree.getColumnSortOrderInfo());
            }

            if (compare_result == 0)
            {
                ret_page = control_row.getPage();

        ok_exit = false;
        try
        {
            // "open" the btree, using recovery's already opened container
            OpenBTree open_btree = new OpenBTree();

            open_btree.init(
                (TransactionManager) null,  // current user xact - not needed
                (TransactionManager) null,  // current xact      - not needed
                pageOp.getContainer(),      // recovery already opened container
                rawtran,
                false,
                ContainerHandle.MODE_FORUPDATE,
                                            // open_mode not used - container is
                                            // already opened.
                TransactionManager.MODE_NONE,
                (BTreeLockingPolicy) null,  // don't get locks during undo
                btree,                      
                (LogicalUndo) null,         // no logical undo necessary, as
                                            // this code only does read.
                (DynamicCompiledOpenConglomInfo) null);

            // System.out.println(
              //   "calling logical undo, recordhandle = " + rechandle);
            // System.out.println("calling logical undo, record= " +
              //    logged_index_row_template);

            // Get the page where the record was originally, before splits
            // could have possibly moved it.
            control_row = ControlRow.get(open_btree, rechandle.getPageNumber());

            // init compare_result, if record doesn't exist do the search
            compare_result = 1;

            if (control_row.getPage().recordExists(rechandle, true))
            {

                if (SanityManager.DEBUG)
                {
                    SanityManager.ASSERT(
                        control_row.getPage().fetchNumFields(rechandle) ==
                        logged_index_row_template.length);
                }

                // create template for the page index row from the conglomerate.
                RecordHandle ret_rechandle =
                    control_row.getPage().fetchFromSlot(
                        (RecordHandle) null,
                        control_row.getPage().getSlotNumber(rechandle),
                        template,
                        (FetchDescriptor) null,
                        true);

                // compare the 2 rows, and if they are the same then the raw
                // store has the right page and record and there is no work to
                // be done (this is usual case).
                compare_result = ControlRow.compareIndexRowToKey(
                    template, logged_index_row_template,
                    logged_index_row_template.length, 1,
                    open_btree.getColumnSortOrderInfo());
            }

            if (compare_result == 0)
            {
                ret_page = control_row.getPage();

                false,
                TransactionController.OPENMODE_FOR_LOCK_ONLY,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_SERIALIZABLE);
       
        OpenBTree open_btree = new OpenBTree();

        BTreeLockingPolicy b2i_locking_policy =
            new B2ITableLocking3(
                rawtran,
                TransactionController.MODE_TABLE,
                rawtran.newLockingPolicy(
                    LockingPolicy.MODE_CONTAINER,
                    TransactionController.ISOLATION_SERIALIZABLE, true),
                base_cc, open_btree);


        // The following call will "open" the new btree.  Create is
        // an interesting case.  What we really want is read only table lock
        // on the base conglomerate and update locks on the index.  For now
        // just get the update lock on the base table, this is done by the
        // lockTable() call made by base class.

        open_btree.init(
            (TransactionManager) xact_manager,  // current user xact
            (TransactionManager) xact_manager,  // current xact
            (ContainerHandle) null,     // have init open the container.
            rawtran,
            false,
            (ContainerHandle.MODE_FORUPDATE),
            TransactionController.MODE_TABLE,
            b2i_locking_policy,         // get table level lock.
            this,                      
            (LogicalUndo) null,         // no logical undo necessary, as
                                        // initEmptyBtree()
                                        // work will be done single user and
                                        // rows will not move.
            (DynamicCompiledOpenConglomInfo) null);
                                       
    // Open the newly created container, and insert the first control row.
        LeafControlRow.initEmptyBtree(open_btree);

        open_btree.close();

        base_cc.close();
  }

                false,
                TransactionController.OPENMODE_FOR_LOCK_ONLY,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_SERIALIZABLE);
       
        OpenBTree open_btree = new OpenBTree();

        BTreeLockingPolicy b2i_locking_policy =
            new B2ITableLocking3(
                rawtran,
                TransactionController.MODE_TABLE,
                rawtran.newLockingPolicy(
                    LockingPolicy.MODE_CONTAINER,
                    TransactionController.ISOLATION_SERIALIZABLE, true), base_cc, open_btree);


        // The following call will "open" the new btree.  Create is
        // an interesting case.  What we really want is read only table lock
        // on the base conglomerate and update locks on the index.  For now
        // just get the update lock on the base table, this is done by the
        // lockTable() call made by base class.

        open_btree.init(
            (TransactionManager) xact_manager,  // current user xact
            (TransactionManager) xact_manager,  // current xact
            (ContainerHandle) null,     // have init open the container.
            rawtran,
            false,
            (ContainerHandle.MODE_FORUPDATE),
            TransactionController.MODE_TABLE,
            b2i_locking_policy,         // get table level lock.
            this,                      
            (LogicalUndo) null,         // no logical undo necessary, as
                                        // initEmptyBtree()
                                        // work will be done single user and
                                        // rows will not move.
            (DynamicCompiledOpenConglomInfo) null);
                                       
    // Open the newly created container, and insert the first control row.
        LeafControlRow.initEmptyBtree(open_btree);

        open_btree.close();

        base_cc.close();
  }

                false,
                TransactionController.OPENMODE_FOR_LOCK_ONLY,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_SERIALIZABLE);
       
        OpenBTree open_btree = new OpenBTree();

        BTreeLockingPolicy b2i_locking_policy =
            new B2ITableLocking3(
                rawtran,
                TransactionController.MODE_TABLE,
                rawtran.newLockingPolicy(
                    LockingPolicy.MODE_CONTAINER,
                    TransactionController.ISOLATION_SERIALIZABLE, true), base_cc, open_btree);


        // The following call will "open" the new btree.  Create is
        // an interesting case.  What we really want is read only table lock
        // on the base conglomerate and update locks on the index.  For now
        // just get the update lock on the base table, this is done by the
        // lockTable() call made by base class.

        open_btree.init(
            (TransactionManager) xact_manager,  // current user xact
            (TransactionManager) xact_manager,  // current xact
            (ContainerHandle) null,     // have init open the container.
            rawtran,
            false,
            (ContainerHandle.MODE_FORUPDATE),
            TransactionController.MODE_TABLE,
            b2i_locking_policy,         // get table level lock.
            this,                      
            (LogicalUndo) null,         // no logical undo necessary, as
                                        // initEmptyBtree()
                                        // work will be done single user and
                                        // rows will not move.
            (DynamicCompiledOpenConglomInfo) null);
                                       
    // Open the newly created container, and insert the first control row.
        LeafControlRow.initEmptyBtree(open_btree);

        open_btree.close();

        base_cc.close();
  }

TOP

Related Classes of org.apache.derby.impl.store.access.btree.OpenBTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.