Examples of ScanController


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

   */
  public Hashtable hashAllTableDescriptorsByTableId(TransactionController tc)
    throws StandardException
  {
    Hashtable ht = new Hashtable();
    ScanController        scanController;
    ExecRow           outRow;
    TabInfoImpl          ti = coreInfo[SYSTABLES_CORE_NUM];
    SYSTABLESRowFactory
          rf = (SYSTABLESRowFactory) ti.getCatalogRowFactory();

    outRow = rf.makeEmptyRow();

    scanController = tc.openScan(
        ti.getHeapConglomerate(),       // sys.systable
        false,                          // don't hold open across commit
        0,                              // for read
                TransactionController.MODE_RECORD,// scans whole table.
                TransactionController.ISOLATION_READ_UNCOMMITTED,
        (FormatableBitSet) null,                 // all fields as objects
        (DataValueDescriptor[])null,    // start position - first row
        ScanController.GE,              // startSearchOperation
        (ScanQualifier[][])null,        //scanQualifier,
        (DataValueDescriptor[])null,    //stop position-through last row
        ScanController.GT);             // stopSearchOperation

        // it is important for read uncommitted scans to use fetchNext() rather
        // than fetch, so that the fetch happens while latch is held, otherwise
        // the next() might position the scan on a row, but the subsequent
        // fetch() may find the row deleted or purged from the table.
    while(scanController.fetchNext(outRow.getRowArray()))
    {
      TableDescriptor td = (TableDescriptor)
        rf.buildDescriptor(outRow, (TupleDescriptor)null,
                   this);
      ht.put(td.getUUID(), td);
    }
    scanController.close();
    return ht;
  }
View Full Code Here

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

   */
    public ConglomerateDescriptor[] getConglomerateDescriptors(
                    long conglomerateNumber)
                    throws StandardException
    {
      ScanController        scanController;
      TransactionController    tc;
      ExecRow           outRow;
      DataValueDescriptor      conglomNumberOrderable = null;
      TabInfoImpl            ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];
      SYSCONGLOMERATESRowFactory  rf = (SYSCONGLOMERATESRowFactory) ti.getCatalogRowFactory();
View Full Code Here

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

   * @exception StandardException    Thrown on failure
   */
  public List getAllDependencyDescriptorsList()
        throws StandardException
  {
    ScanController         scanController;
    TransactionController      tc;
    ExecRow              outRow;
    ExecRow             templateRow;
    List            ddl = newSList();
    TabInfoImpl            ti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);
    SYSDEPENDSRowFactory    rf = (SYSDEPENDSRowFactory) ti.getCatalogRowFactory();


    // Get the current transaction controller
    tc = getTransactionCompile();

    outRow = rf.makeEmptyRow();

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

    while (scanController.fetchNext(outRow.getRowArray()))
        {
      DependencyDescriptor    dependencyDescriptor;

      dependencyDescriptor = (DependencyDescriptor)
             rf.buildDescriptor(outRow,
                        (TupleDescriptor) null,
                        this);

      ddl.add(dependencyDescriptor);
        }

        scanController.close();

    return ddl;
  }
View Full Code Here

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

    ConglomerateController  heapCC;
    ExecIndexRow        indexRow1;
    ExecRow          row;
    DataValueDescriptor      schemaIDOrderable;
    DataValueDescriptor    tableNameOrderable;
    ScanController      scanController;
    TabInfoImpl          ti = coreInfo[SYSTABLES_CORE_NUM];
        SYSTABLESRowFactory    rf = (SYSTABLESRowFactory) ti.getCatalogRowFactory();

    // We only want the 1st column from the heap
    row = exFactory.getValueRow(1);

    /* Use tableNameOrderable and schemaIdOrderable in both start
     * and stop position for scan.
     */
    tableNameOrderable = new SQLVarchar(tableName);
    schemaIDOrderable = new SQLChar(schemaUUID);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(2);
    keyRow.setColumn(1, tableNameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);

    heapCC = tc.openConglomerate(
                ti.getHeapConglomerate(), false, 0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ);

    ExecRow indexTemplateRow = rf.buildEmptyIndexRow( SYSTABLESRowFactory.SYSTABLES_INDEX1_ID, heapCC.newRowLocationTemplate() );

    /* Scan the index and go to the data pages for qualifying rows to
     * build the column descriptor.
     */
    scanController = tc.openScan(
        ti.getIndexConglomerate(SYSTABLESRowFactory.SYSTABLES_INDEX1_ID)// conglomerate to open
        false, // don't hold open across commit
        0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ,
        (FormatableBitSet) null,         // all fields as objects
        keyRow.getRowArray(),   // start position - first row
        ScanController.GE,      // startSearchOperation
        (ScanQualifier[][]) null, //scanQualifier,
        keyRow.getRowArray(),   // stop position - through last row
        ScanController.GT);     // stopSearchOperation

        /* OK to fetch into the template row,
         * since we won't be doing a next.
         */
    if (scanController.fetchNext(indexTemplateRow.getRowArray()))
    {
      RowLocation  baseRowLocation;


      baseRowLocation = (RowLocationindexTemplateRow.getColumn(
                        indexTemplateRow.nColumns());
 
      /* 1st column is TABLEID (UUID - char(36)) */
      row.setColumn(SYSTABLESRowFactory.SYSTABLES_TABLEID, new SQLChar());
      FormatableBitSet bi = new FormatableBitSet(1);
      bi.set(0);
      boolean base_row_exists =
                heapCC.fetch(
                    baseRowLocation, row.getRowArray(), (FormatableBitSet) null);

            if (SanityManager.DEBUG)
            {
                // it can not be possible for heap row to disappear while
                // holding scan cursor on index at ISOLATION_REPEATABLE_READ.
                SanityManager.ASSERT(base_row_exists, "base row not found");
            }
    }

        scanController.close();
    heapCC.close();

    return uuidFactory.recreateUUID(row.getColumn(1).toString());
  }
View Full Code Here

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

    if (!isCoreTable)
      faultInTabInfo(ti);

    /* Scan the entire heap */
    ScanController sc =
            tc.openScan(
                ti.getHeapConglomerate(),
                false,
                TransactionController.OPENMODE_FORUPDATE,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_REPEATABLE_READ,
                RowUtil.EMPTY_ROW_BITSET,
                (DataValueDescriptor[]) null,
                ScanController.NA,
                (Qualifier[][]) null,
                (DataValueDescriptor[]) null,
                ScanController.NA);

    while (sc.next())
    {
      /* Replace the column in the table */
      sc.replace(replaceRow, columnsToUpdateSet);
    }

    sc.close();
  }
View Full Code Here

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

    ConglomerateController  heapCC;
    ExecIndexRow        indexRow1;
    ExecIndexRow      indexTemplateRow;
    ExecRow         outRow;
    RowLocation        baseRowLocation;
    ScanController      scanController;
    TransactionController  tc;
    TupleDescriptor      td = null;

    // Get the current transaction controller
    tc = getTransactionCompile();

    outRow = rf.makeEmptyRow();

    heapCC = tc.openConglomerate(
                ti.getHeapConglomerate(), false, 0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ);

    /* Scan the index and go to the data pages for qualifying rows to
     * build the column descriptor.
     */
    scanController = tc.openScan(
        ti.getIndexConglomerate(indexId)// conglomerate to open
        false, // don't hold open across commit
        (forUpdate) ? TransactionController.OPENMODE_FORUPDATE : 0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ,
        (FormatableBitSet) null,         // all fields as objects
        keyRow.getRowArray(),   // start position - first row
        ScanController.GE,      // startSearchOperation
        scanQualifiers,         //scanQualifier,
        keyRow.getRowArray(),   // stop position - through last row
        ScanController.GT);     // stopSearchOperation

    while (scanController.next())
    {
       // create an index row template
      indexRow1 = getIndexRowFromHeapRow(
                  ti.getIndexRowGenerator(indexId),
                  heapCC.newRowLocationTemplate(),
                  outRow);

      scanController.fetch(indexRow1.getRowArray());

      baseRowLocation = (RowLocationindexRow1.getColumn(
                        indexRow1.nColumns());

            // RESOLVE paulat - remove the try catch block when track 3677 is fixed
            // just leave the contents of the try block
            // adding to get more info on track 3677

            boolean base_row_exists = false;
            try
            {
          base_row_exists =
                    heapCC.fetch(
                        baseRowLocation, outRow.getRowArray(), (FormatableBitSet) null);
            }
            catch (RuntimeException re)
            {
                if (SanityManager.DEBUG)
                {
                    if (re instanceof AssertFailure)
                    {
              StringBuffer strbuf = new StringBuffer("Error retrieving base row in table "+ti.getTableName());
              strbuf.append(": An ASSERT was thrown when trying to locate a row matching index row "+indexRow1+" from index "+ti.getIndexName(indexId)+", conglom number "+ti.getIndexConglomerate(indexId));
                        debugGenerateInfo(strbuf,tc,heapCC,ti,indexId);
                    }
                }
                throw re;
            }
            catch (StandardException se)
            {
                if (SanityManager.DEBUG)
                {
                    // only look for a specific error i.e. that of record on page
                    // no longer exists
                    // do not want to catch lock timeout errors here
                    if (se.getSQLState().equals("XSRS9"))
                    {
              StringBuffer strbuf = new StringBuffer("Error retrieving base row in table "+ti.getTableName());
              strbuf.append(": A StandardException was thrown when trying to locate a row matching index row "+indexRow1+" from index "+ti.getIndexName(indexId)+", conglom number "+ti.getIndexConglomerate(indexId));
                        debugGenerateInfo(strbuf,tc,heapCC,ti,indexId);
                    }
                }
                throw se;
            }

            if (SanityManager.DEBUG)
            {
                // it can not be possible for heap row to disappear while
                // holding scan cursor on index at ISOLATION_REPEATABLE_READ.
        if (! base_row_exists)
        {
          StringBuffer strbuf = new StringBuffer("Error retrieving base row in table "+ti.getTableName());
          strbuf.append(": could not locate a row matching index row "+indexRow1+" from index "+ti.getIndexName(indexId)+", conglom number "+ti.getIndexConglomerate(indexId));
                    debugGenerateInfo(strbuf,tc,heapCC,ti,indexId);
                    // RESOLVE: for now, we are going to kill the VM
                    // to help debug this problem.
                    System.exit(1);

                    // RESOLVE: not currently reached
                    //SanityManager.THROWASSERT(strbuf.toString());
        }
            }

      td = rf.buildDescriptor(outRow, parentTupleDescriptor, this);

      /* If list is null, then caller only wants a single descriptor - we're done
       * else just add the current descriptor to the list.
       */
      if (list == null)
      {
        break;
      }
      else
      {
        list.add(td);
      }
    }
        scanController.close();
    heapCC.close();
    return td;
  }
View Full Code Here

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

      throws StandardException
  {
    CatalogRowFactory    rf = ti.getCatalogRowFactory();
    ConglomerateController  heapCC;
    ExecRow         outRow;
    ScanController      scanController;
    TransactionController  tc;
    TupleDescriptor      td = null;

    // Get the current transaction controller
    tc = getTransactionCompile();

    outRow = rf.makeEmptyRow();

    /*
    ** Table scan
    */
    scanController = tc.openScan(
        ti.getHeapConglomerate()// 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
        (DataValueDescriptor[]) null,    // start position - first row
        0,              // startSearchOperation - none
        scanQualifiers,     // scanQualifier,
        (DataValueDescriptor[]) null,    // stop position - through last row
        0);             // stopSearchOperation - none

    while (scanController.fetchNext(outRow.getRowArray()))
    {
      td = rf.buildDescriptor(outRow, parentTupleDescriptor, this);

      /* If dList is null, then caller only wants a single descriptor - we're done
       * else just add the current descriptor to the list.
       */
      if (list == null)
      {
        break;
      }
      else
      {
        list.add(td);
      }
    }
    scanController.close();
    return td;
  }
View Full Code Here

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

    private void setHeapRowEstimate(TransactionController tc, long tableId,
                                    long rowEstimate)
            throws StandardException {
        // DERBY-4116: If we know the row count, update the store estimated row
        // count for the table.
        ScanController sc = tc.openScan(
                tableId,
                false,  // hold
                0,      // openMode: for read
                TransactionController.MODE_RECORD, // locking
                TransactionController.ISOLATION_READ_UNCOMMITTED, //iso level
                null,   // scancolumnlist-- want everything.
                null,   // startkeyvalue-- start from the beginning.
                0,
                null,   // qualifiers, none!
                null,   // stopkeyvalue,
                0);

        try {
            sc.setEstimatedRowCount(rowEstimate);
        } finally {
            sc.close();
        }
    }
View Full Code Here

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

    ConglomerateDescriptor  indexCD;
    ExecRow          baseRow;
    ExecRow          indexRow;
    RowLocation        rl = null;
    RowLocation        scanRL = null;
    ScanController      scan = null;
    int[]          baseColumnPositions;
    int            baseColumns = 0;
    DataValueFactory    dvf;
    long          indexRows;
    ConglomerateController  baseCC = null;
    ConglomerateController  indexCC = null;
    SchemaDescriptor    sd;
    ConstraintDescriptor  constraintDesc;

    LanguageConnectionContext lcc = ConnectionUtil.getCurrentLCC();
    tc = lcc.getTransactionExecute();

    try {

            dd = lcc.getDataDictionary();

            dvf = lcc.getDataValueFactory();
           
            ExecutionFactory ef = lcc.getLanguageConnectionFactory().getExecutionFactory();

            sd = dd.getSchemaDescriptor(schemaName, tc, true);
            td = dd.getTableDescriptor(tableName, sd);

            if (td == null)
            {
                throw StandardException.newException(
                    SQLState.LANG_TABLE_NOT_FOUND,
                    schemaName + "." + tableName);
            }

            /* Skip views */
            if (td.getTableType() == TableDescriptor.VIEW_TYPE)
            {
                return true;
            }

      /* Open the heap for reading */
      baseCC = tc.openConglomerate(
                  td.getHeapConglomerateId(), false, 0,
                TransactionController.MODE_TABLE,
              TransactionController.ISOLATION_SERIALIZABLE);

      /* Check the consistency of the heap */
      baseCC.checkConsistency();

      heapCD = td.getConglomerateDescriptor(td.getHeapConglomerateId());

      /* Get a row template for the base table */
      baseRow = ef.getValueRow(td.getNumberOfColumns());

      /* Fill the row with nulls of the correct type */
      ColumnDescriptorList cdl = td.getColumnDescriptorList();
      int           cdlSize = cdl.size();

      for (int index = 0; index < cdlSize; index++)
      {
        ColumnDescriptor cd = (ColumnDescriptor) cdl.elementAt(index);
        baseRow.setColumn(cd.getPosition(),
                    cd.getType().getNull());
      }

      /* Look at all the indexes on the table */
      ConglomerateDescriptor[] cds = td.getConglomerateDescriptors();
      for (int index = 0; index < cds.length; index++)
      {
        indexCD = cds[index];
        /* Skip the heap */
        if ( ! indexCD.isIndex())
          continue;

        /* Check the internal consistency of the index */
        indexCC =
              tc.openConglomerate(
                indexCD.getConglomerateNumber(),
                        false,
              0,
            TransactionController.MODE_TABLE,
                      TransactionController.ISOLATION_SERIALIZABLE);

        indexCC.checkConsistency();
        indexCC.close();
        indexCC = null;

        /* if index is for a constraint check that the constraint exists */

        if (indexCD.isConstraint())
        {
          constraintDesc = dd.getConstraintDescriptor(td, indexCD.getUUID());
          if (constraintDesc == null)
          {
            throw StandardException.newException(
                    SQLState.LANG_OBJECT_NOT_FOUND,
                    "CONSTRAINT for INDEX",
                    indexCD.getConglomerateName());
          }
        }

        /*
        ** Set the base row count when we get to the first index.
        ** We do this here, rather than outside the index loop, so
        ** we won't do the work of counting the rows in the base table
        ** if there are no indexes to check.
        */
        if (baseRowCount < 0)
        {
          scan = tc.openScan(heapCD.getConglomerateNumber(),
                    false,  // hold
                    0,    // not forUpdate
                      TransactionController.MODE_TABLE,
                      TransactionController.ISOLATION_SERIALIZABLE,
                                        RowUtil.EMPTY_ROW_BITSET,
                    null,  // startKeyValue
                    0,    // not used with null start posn.
                    null,  // qualifier
                    null,  // stopKeyValue
                    0);    // not used with null stop posn.

          /* Also, get the row location template for index rows */
          rl = scan.newRowLocationTemplate();
          scanRL = scan.newRowLocationTemplate();

          for (baseRowCount = 0; scan.next(); baseRowCount++)
            /* Empty statement */

          scan.close();
          scan = null;
        }

        baseColumnPositions =
            indexCD.getIndexDescriptor().baseColumnPositions();
        baseColumns = baseColumnPositions.length;

        FormatableBitSet indexColsBitSet = new FormatableBitSet();
        for (int i = 0; i < baseColumns; i++)
        {
          indexColsBitSet.grow(baseColumnPositions[i]);
          indexColsBitSet.set(baseColumnPositions[i] - 1);
        }

        /* Get one row template for the index scan, and one for the fetch */
        indexRow = ef.getValueRow(baseColumns + 1);

        /* Fill the row with nulls of the correct type */
        for (int column = 0; column < baseColumns; column++)
        {
          /* Column positions in the data dictionary are one-based */
           ColumnDescriptor cd = td.getColumnDescriptor(baseColumnPositions[column]);
          indexRow.setColumn(column + 1,
                      cd.getType().getNull());
        }

        /* Set the row location in the last column of the index row */
        indexRow.setColumn(baseColumns + 1, rl);

        /* Do a full scan of the index */
        scan = tc.openScan(indexCD.getConglomerateNumber(),
                  false,  // hold
                  0,    // not forUpdate
                    TransactionController.MODE_TABLE,
                        TransactionController.ISOLATION_SERIALIZABLE,
                  (FormatableBitSet) null,
                  null,  // startKeyValue
                  0,    // not used with null start posn.
                  null,  // qualifier
                  null,  // stopKeyValue
                  0);    // not used with null stop posn.

        DataValueDescriptor[] baseRowIndexOrder =
                    new DataValueDescriptor[baseColumns];
        DataValueDescriptor[] baseObjectArray = baseRow.getRowArray();

        for (int i = 0; i < baseColumns; i++)
        {
          baseRowIndexOrder[i] = baseObjectArray[baseColumnPositions[i] - 1];
        }
     
        /* Get the index rows and count them */
        for (indexRows = 0; scan.fetchNext(indexRow.getRowArray()); indexRows++)
        {
          /*
          ** Get the base row using the RowLocation in the index row,
          ** which is in the last column. 
          */
          RowLocation baseRL = (RowLocation) indexRow.getColumn(baseColumns + 1);

          boolean base_row_exists =
                    baseCC.fetch(
                      baseRL, baseObjectArray, indexColsBitSet);

          /* Throw exception if fetch() returns false */
          if (! base_row_exists)
          {
            String indexName = indexCD.getConglomerateName();
            throw StandardException.newException(SQLState.LANG_INCONSISTENT_ROW_LOCATION,
                  (schemaName + "." + tableName),
                  indexName,
                  baseRL.toString(),
                  indexRow.toString());
          }

          /* Compare all the column values */
          for (int column = 0; column < baseColumns; column++)
          {
            DataValueDescriptor indexColumn =
              indexRow.getColumn(column + 1);
            DataValueDescriptor baseColumn =
              baseRowIndexOrder[column];

            /*
            ** With this form of compare(), null is considered equal
            ** to null.
            */
            if (indexColumn.compare(baseColumn) != 0)
            {
              ColumnDescriptor cd =
                                td.getColumnDescriptor(
                                    baseColumnPositions[column]);

                            /*
                            System.out.println(
                                "SQLState.LANG_INDEX_COLUMN_NOT_EQUAL:" +
                                "indexCD.getConglomerateName()" + indexCD.getConglomerateName() +
                                ";td.getSchemaName() = " + td.getSchemaName() +
                                ";td.getName() = " + td.getName() +
                                ";baseRL.toString() = " + baseRL.toString() +
                                ";cd.getColumnName() = " + cd.getColumnName() +
                                ";indexColumn.toString() = " + indexColumn.toString() +
                                ";baseColumn.toString() = " + baseColumn.toString() +
                                ";indexRow.toString() = " + indexRow.toString());
                            */

              throw StandardException.newException(
                                SQLState.LANG_INDEX_COLUMN_NOT_EQUAL,
                                indexCD.getConglomerateName(),
                                td.getSchemaName(),
                                td.getName(),
                                baseRL.toString(),
                                cd.getColumnName(),
                                indexColumn.toString(),
                                baseColumn.toString(),
                                indexRow.toString());
            }
          }
        }

        /* Clean up after the index scan */
        scan.close();
        scan = null;

        /*
        ** The index is supposed to have the same number of rows as the
        ** base conglomerate.
        */
        if (indexRows != baseRowCount)
        {
          throw StandardException.newException(SQLState.LANG_INDEX_ROW_COUNT_MISMATCH,
                    indexCD.getConglomerateName(),
                    td.getSchemaName(),
                    td.getName(),
                    Long.toString(indexRows),
                    Long.toString(baseRowCount));
        }
      }
      /* check that all constraints have backing index */
      ConstraintDescriptorList constraintDescList =
        dd.getConstraintDescriptors(td);
      for (int index = 0; index < constraintDescList.size(); index++)
      {
        constraintDesc = constraintDescList.elementAt(index);
        if (constraintDesc.hasBackingIndex())
        {
          ConglomerateDescriptor conglomDesc;

          conglomDesc = td.getConglomerateDescriptor(
              constraintDesc.getConglomerateId());
          if (conglomDesc == null)
          {
            throw StandardException.newException(
                    SQLState.LANG_OBJECT_NOT_FOUND,
                    "INDEX for CONSTRAINT",
                    constraintDesc.getConstraintName());
          }
        }
      }
     
    }
    catch (StandardException se)
    {
      throw PublicAPI.wrapStandardException(se);
    }
    finally
    {
            try
            {
                /* Clean up before we leave */
                if (baseCC != null)
                {
                    baseCC.close();
                    baseCC = null;
                }
                if (indexCC != null)
                {
                    indexCC.close();
                    indexCC = null;
                }
                if (scan != null)
                {
                    scan.close();
                    scan = null;
                }
            }
            catch (StandardException se)
            {
View Full Code Here

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.