Package org.apache.derby.iapi.store.access

Examples of org.apache.derby.iapi.store.access.ScanController


                throw T_Fail.testFailMsg("insert failed");

            // now delete the row.
            base_cc.delete(row_loc);

            ScanController delete_scan =
                tc.openScan(index_conglomid, false,
                            TransactionController.OPENMODE_FORUPDATE,
                            TransactionController.MODE_RECORD,
                            TransactionController.ISOLATION_SERIALIZABLE,
                            (FormatableBitSet) null,
                            template.getRow(), ScanController.GE,
                            null,
                            template.getRow(), ScanController.GT);

            if (!delete_scan.next())
            {
                throw T_Fail.testFailMsg("delete could not find key");
            }
            else
            {
                delete_scan.delete();

                if (delete_scan.next())
                    throw T_Fail.testFailMsg("delete found more than one key");
            }

            delete_scan.close();
        }

        ret_val = t_ascdesc_scan_test_cases(tc, index_conglomid, template);

View Full Code Here


                throw T_Fail.testFailMsg("insert failed");

            // now delete the row.
            base_cc.delete(row_loc);

            ScanController delete_scan =
                tc.openScan(index_conglomid, false,
                            TransactionController.OPENMODE_FORUPDATE,
                            TransactionController.MODE_RECORD,
                            TransactionController.ISOLATION_SERIALIZABLE,
                            (FormatableBitSet) null,
                            template.getRow(), ScanController.GE,
                            null,
                            template.getRow(), ScanController.GT);

            if (!delete_scan.next())
            {
                throw T_Fail.testFailMsg("delete could not find key");
            }
            else
            {
                delete_scan.delete();

                if (delete_scan.next())
                    throw T_Fail.testFailMsg("delete found more than one key");
            }

            delete_scan.close();
        }

        ret_val = t_ascdesc1_scan_test_cases(tc, index_conglomid, template);

View Full Code Here

   * @exception  T_Fail  Throws T_Fail on any test failure.
     **/
    protected boolean t_020(TransactionController tc)
        throws StandardException, T_Fail
    {
        ScanController scan         = null;

        REPORT("Starting t_020");

        T_CreateConglomRet create_ret = new T_CreateConglomRet();

View Full Code Here

    IndexRowGenerator      indexRowGenerator = tabInfo.getIndexRowGenerator( indexNumber );
    CatalogRowFactory      rowFactory = tabInfo.getCatalogRowFactory();
    ExecRow            heapRow = rowFactory.makeEmptyRow();
    ExecIndexRow        indexableRow = indexRowGenerator.getIndexRowTemplate();

    ScanController        heapScan =
      tc.openScan(
        heapConglomerateNumber,       // conglomerate to open
        false,                          // don't hold open across commit
        0,                              // for read
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_REPEATABLE_READ,
        (FormatableBitSet) null,                 // all fields as objects
        null,                           // start position - first row
        ScanController.GE,              // startSearchOperation
        null,                           //scanQualifier,
        null,                           //stop position-through last row
        ScanController.GT);             // stopSearchOperation

    RowLocation          heapLocation =
            heapScan.newRowLocationTemplate();

    ConglomerateController    indexController =
      tc.openConglomerate(
        indexConglomerateNumber,
                false,
        TransactionController.OPENMODE_FORUPDATE,
        TransactionController.MODE_TABLE,
        TransactionController.ISOLATION_REPEATABLE_READ);

    while ( heapScan.fetchNext(heapRow.getRowArray()) )
        {
       heapScan.fetchLocation( heapLocation );

      indexRowGenerator.getIndexRow( heapRow, heapLocation, indexableRow, (FormatableBitSet) null );

      indexController.insert(indexableRow.getRowArray());
    }

    indexController.close();
    heapScan.close();
  }
View Full Code Here

                  (long[]) null);

    closeBulkFetchScan();

    // Set the "estimated" row count
    ScanController compressHeapSC = tc.openScan(
              newHeapConglom,
              false,
              TransactionController.OPENMODE_FORUPDATE,
              TransactionController.MODE_TABLE,
                            TransactionController.ISOLATION_SERIALIZABLE,
              (FormatableBitSet) null,
              (DataValueDescriptor[]) null,
              0,
              (Qualifier[][]) null,
              (DataValueDescriptor[]) null,
              0);
   
    compressHeapSC.setEstimatedRowCount(rowCount);

    compressHeapSC.close();
    compressHeapSC = null; // RESOLVE DJD CLEANUP

    /*
    ** Inform the data dictionary that we are about to write to it.
    ** There are several calls to data dictionary "get" methods here
View Full Code Here

  private int getSemiRowCount(TransactionController tc)
    throws StandardException
  {
    int         numRows = 0;

    ScanController sc = tc.openScan(td.getHeapConglomerateId(),
             false,  // hold
             0,      // open read only
                         TransactionController.MODE_TABLE,
                         TransactionController.ISOLATION_SERIALIZABLE,
             RowUtil.EMPTY_ROW_BITSET, // scanColumnList
             null,  // start position
             ScanController.GE,      // startSearchOperation
             null, // scanQualifier
             null, //stop position - through last row
             ScanController.GT);     // stopSearchOperation

    while (sc.next())
    {
      numRows++;

      // We're only interested in whether the table has 0, 1 or > 1 rows
      if (numRows == 2)
      {
        break;
      }
    }
    sc.close();

    return numRows;
  }
View Full Code Here

    T_ConsistencyChecker t_cc = new T_ConsistencyChecker(schemaName, tableName, null);
    t_cc.getContexts();
    t_cc.getDescriptors();

    /* Open a scan on the heap */
    ScanController heapScan = t_cc.openUnqualifiedHeapScan();

    // Move to the 1st row in the heap
    heapScan.next();

    // Delete the 1st row in the heap
    heapScan.delete();

    heapScan.close();
  }
View Full Code Here

    T_ConsistencyChecker t_cc = new T_ConsistencyChecker(schemaName, tableName, null);
    t_cc.getContexts();
    t_cc.getDescriptors();

    /* Open a scan on the heap */
    ScanController heapScan = t_cc.openUnqualifiedHeapScan();

    // Move to the 1st row in the heap
    heapScan.next();

    // Fetch the 1st row
    ExecRow firstRow = t_cc.getHeapRowOfNulls();
    heapScan.fetch(firstRow.getRowArray());
    heapScan.close();

    // Insert another copy of the 1st row into the heap
    ConglomerateController heapCC = t_cc.openHeapCC();
    heapCC.insert(firstRow.getRowArray());
    heapCC.close();
View Full Code Here

    T_ConsistencyChecker t_cc = new T_ConsistencyChecker(schemaName, tableName, null);
    t_cc.getContexts();
    t_cc.getDescriptors();

    /* Open a scan on the heap */
    ScanController heapScan = t_cc.openUnqualifiedHeapScan();

    // Move to the 1st row in the heap
    heapScan.next();

    // Get the RowLocation
    RowLocation baseRL = heapScan.newRowLocationTemplate();
    heapScan.fetchLocation(baseRL);

    // Replace the current row with nulls
    heapScan.replace(
      t_cc.getHeapRowOfNulls().getRowArray(),
      (FormatableBitSet) null);

    heapScan.close();
  }
View Full Code Here

    t_cc.getContexts();
    t_cc.getDescriptors();


    /* Open a scan on the heap */
    ScanController heapScan = t_cc.openUnqualifiedHeapScan();

    // Get the RowLocation
    RowLocation baseRL = heapScan.newRowLocationTemplate();
    RowLocation badRL = heapScan.newRowLocationTemplate();
    heapScan.close();

    /* Open a scan on the index */
    ExecRow    indexRow = t_cc.getIndexTemplateRow(baseRL);
    ScanController indexScan = t_cc.openUnqualifiedIndexScan();

    // Move to the 1st row in the index
    indexScan.next();

    // Fetch the 1st row
    indexScan.fetch(indexRow.getRowArray());
    indexScan.close();

    // Insert another copy of the 1st row into the index with a bad row location
    int keyLength =
        t_cc.getIndexDescriptor().getIndexDescriptor().baseColumnPositions().length;
    indexRow.setColumn(keyLength + 1, badRL);
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.store.access.ScanController

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.