Examples of FormatableBitSet


Examples of org.apache.derby.iapi.services.io.FormatableBitSet


        acb.pushGetResultSetFactoryExpression(mb);

        int rclSize = resultColumns.size();
        FormatableBitSet referencedCols = new FormatableBitSet(rclSize);

        /*
         * Build a FormatableBitSet for columns to copy from source.
         */

        for (int index = rclSize-1; index >= 0; index--) {
            ResultColumn rc = (ResultColumn) resultColumns.elementAt(index);
            ValueNode expr = rc.getExpression();

            if (rc.isGenerated() &&
                    (expr instanceof ColumnReference) &&
                    ((ColumnReference)expr).
                        getGeneratedToReplaceWindowFunctionCall()) {

                // meaningless to copy these, they arise in this rs.
            } else {
                referencedCols.set(index);
            }
        }

        int erdNumber = acb.addItem(referencedCols);

View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

     *
     * @param cdl list of columns whose positions we want to record in the bit map
   */
  public FormatableBitSet makeColumnMap( ColumnDescriptorList cdl )
  {
    FormatableBitSet    result = new FormatableBitSet( columnDescriptorList.size() + 1 );
        int                         count = cdl.size();

        for ( int i = 0; i < count; i++ )
        {
            ColumnDescriptor    cd = cdl.elementAt( i );

            result.set( cd.getPosition() );
        }

        return result;
  }
View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

          lockMode,
          null, null, null, 0, null, null,
          resultDescription,
          getFKInfo(),
          getTriggerInfo(),
          (readColsBitSet == null) ? (FormatableBitSet)null : new FormatableBitSet(readColsBitSet),
          getReadColMap(targetTableDescriptor.getNumberOfColumns(),readColsBitSet),
          resultColumnList.getStreamStorableColIds(targetTableDescriptor.getNumberOfColumns()),
           (readColsBitSet == null) ?
            targetTableDescriptor.getNumberOfColumns() :
            readColsBitSet.getNumBitsSet(),     
View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

    needsDeferredProcessing[0] = requiresDeferredProcessing();

    Vector    conglomVector = new Vector();
    relevantTriggers = new GenericDescriptorList();

    FormatableBitSet  columnMap = DeleteNode.getDeleteReadMap(baseTable, conglomVector, relevantTriggers, needsDeferredProcessing );

    markAffectedIndexes( conglomVector );

    adjustDeferredFlag( needsDeferredProcessing[0] );
View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

    boolean[]          needsDeferredProcessing
  )
    throws StandardException
  {
    int    columnCount = baseTable.getMaxColumnID();
    FormatableBitSet  columnMap = new FormatableBitSet(columnCount + 1);

    /*
    ** Get a list of the indexes that need to be
    ** updated.  ColumnMap contains all indexed
    ** columns where 1 or more columns in the index
    ** are going to be modified.
    **
    ** Notice that we don't need to add constraint
    ** columns.  This is because we add all key constraints
    ** (e.g. foreign keys) as a side effect of adding their
    ** indexes above.  And we don't need to deal with
    ** check constraints on a delete.
    **
    ** Adding indexes also takes care of the replication
    ** requirement of having the primary key.
    */
    DMLModStatementNode.getXAffectedIndexes(baseTable,  null, columnMap, conglomVector );

    /*
     ** If we have any triggers, then get all the columns
    ** because we don't know what the user will ultimately
    ** reference.
     */
    baseTable.getAllRelevantTriggers( StatementType.DELETE, (int[])null, relevantTriggers );
    if ( relevantTriggers.size() > 0 ) { needsDeferredProcessing[0] = true; }

    if (relevantTriggers.size() > 0)
    {
      for (int i = 1; i <= columnCount; i++)
      {
        columnMap.set(i);
      }
    }

    return  columnMap;
  }
View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

        collation       = new int[numIndexes][];
    needToDropSort  = new boolean[numIndexes];
    sortIds         = new long[numIndexes];
    rowSources      = new RowLocationRetRowSource[numIndexes];
    // indexedCols is 1-based
    indexedCols     = new FormatableBitSet(numColumns + 1);


    /* For each index, build a single index row, collation templage,
         * and a sorter.
         */
 
View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

    ExecRow        baseRows = null;
    ColumnOrdering[][]  ordering = new ColumnOrdering[numIndexes][];
    int          numColumns = td.getNumberOfColumns();

    // Create the BitSet for mapping the partial row to the full row
    FormatableBitSet bitSet = new FormatableBitSet(numColumns + 1);
    // Need to check each index for referenced columns
    int numReferencedColumns = 0;
    for (int index = 0; index < numIndexes; index++)
    {
      int[] baseColumnPositions = constants.irgs[index].baseColumnPositions();
      for (int bcp = 0; bcp < baseColumnPositions.length; bcp++)
      {
        if (! bitSet.get(baseColumnPositions[bcp]))
        {
          bitSet.set(baseColumnPositions[bcp] );
          numReferencedColumns++;
        }
      }
    }

    // We can finally create the partial base row
    baseRows =
            activation.getExecutionFactory().getValueRow(numReferencedColumns);

    // Fill in each base row with nulls of the correct data type
    int colNumber = 0;
    for (int index = 0; index < numColumns; index++)
    {
      if (bitSet.get(index + 1))
      {
        colNumber++;
        // NOTE: 1-based column numbers
        baseRows.setColumn(
            colNumber,
View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

    int bulkFetchSize = (forCreateTable) ? 1 : 16
    int numColumns = td.getNumberOfColumns();
    int approximateRowSize = 0;

    // Create the FormatableBitSet for mapping the partial to full base row
    FormatableBitSet bitSet = new FormatableBitSet(numColumns+1);
    for (int index = 0; index < baseColumnPositions.length; index++)
    {
      bitSet.set(baseColumnPositions[index]);
    }
    FormatableBitSet zeroBasedBitSet = RowUtil.shift(bitSet, 1);

    // Start by opening a full scan on the base table.
    scan = tc.openGroupFetchScan(
                            td.getHeapConglomerateId(),
              false,  // hold
              0// open base table read only
                            TransactionController.MODE_TABLE,
                            TransactionController.ISOLATION_SERIALIZABLE,
              zeroBasedBitSet,    // all fields as objects
              (DataValueDescriptor[]) null,  // startKeyValue
              0,    // not used when giving null start posn.
              null,  // qualifier
              (DataValueDescriptor[]) null,  // stopKeyValue
              0);    // not used when giving null stop posn.

    // Create an array to put base row template
    baseRows = new ExecRow[bulkFetchSize];
    indexRows = new ExecIndexRow[bulkFetchSize];
    compactBaseRows = new ExecRow[bulkFetchSize];

    try
    {
      // Create the array of base row template
      for (int i = 0; i < bulkFetchSize; i++)
      {
        // create a base row template
        baseRows[i] = activation.getExecutionFactory().getValueRow(maxBaseColumnPosition);

        // create an index row template
        indexRows[i] = indexRowGenerator.getIndexRowTemplate();

        // create a compact base row template
        compactBaseRows[i] = activation.getExecutionFactory().getValueRow(
                          baseColumnPositions.length);
      }

      indexTemplateRow = indexRows[0];

      // Fill the partial row with nulls of the correct type
      ColumnDescriptorList cdl = td.getColumnDescriptorList();
      int           cdlSize = cdl.size();
      for (int index = 0, numSet = 0; index < cdlSize; index++)
      {
        if (! zeroBasedBitSet.get(index))
        {
          continue;
        }
        numSet++;
        ColumnDescriptor cd = (ColumnDescriptor) cdl.elementAt(index);
View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

      ** We need to do a fetch doing a partial row
      ** read.  We need to shift our 1-based bit
      ** set to a zero based bit set like the store
      ** expects.
      */
      FormatableBitSet readBitSet = RowUtil.shift(baseRowReadList, 1);

      rs.open();
      while ((deferredRLRow = rs.getNextRow()) != null)
      {
        rlColumn = deferredRLRow.getColumn(rlColumnNumber);
View Full Code Here

Examples of org.apache.derby.iapi.services.io.FormatableBitSet

    ExecIndexRow        indexRow1;
    ExecIndexRow      indexTemplateRow;
    ExecRow         outRow;
    ScanController      scanController = null;
    boolean          foundRow;
    FormatableBitSet          colToCheck = new FormatableBitSet(indexCol);
    CatalogRowFactory    rf = ti.getCatalogRowFactory()

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(indexId >= 0, "code needs to be enhanced"+
        " to support a table scan to find the index id");
    }

    colToCheck.set(indexCol - 1);

    ScanQualifier[][] qualifier = exFactory.getScanQualifier(1);
    qualifier[0][0].setQualifier
        (indexCol - 1,
         schemaIdOrderable,
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.