Package org.apache.derby.iapi.services.io

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


     * renamed. Dependency Manager uses this to find out the
     * dependents on the column.
     */
    columnDescriptor = td.getColumnDescriptor(oldObjectName);
    columnPosition = columnDescriptor.getPosition();
    FormatableBitSet toRename = new FormatableBitSet(td.getColumnDescriptorList().size() + 1);
    toRename.set(columnPosition);
    td.setReferencedColumnMap(toRename);
   
    dm.invalidateFor(td, DependencyManager.RENAME, lcc);

    //look for foreign key dependency on the column.
View Full Code Here


                      NumberDataValue newValue,
                      boolean wait)
         throws StandardException
  {

    FormatableBitSet columnToUpdate = new
        FormatableBitSet(SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT);
      int columnNum = SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE;
    TabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];
      ConglomerateController heapCC = null;
    SYSCOLUMNSRowFactory  rf = (SYSCOLUMNSRowFactory) ti.getCatalogRowFactory();
    ExecRow row = rf.makeEmptyRow();

      FormatableBitSet  columnToRead = new
        FormatableBitSet(SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT);
   
    // FormatableBitSet is 0 based.
      columnToRead.set(columnNum - 1); // current value.
    columnToRead.set(columnNum);     // start value.
    columnToRead.set(columnNum + 1); // increment value.

        try
        {
      /* if wait is true then we need to do a wait while trying to
         open/fetch from the conglomerate. note we use wait both to
View Full Code Here

  private int getScanArguments(ActivationClassBuilder acb,
                      MethodBuilder mb)
    throws StandardException
  {
    int        rclSize = resultColumns.size();
    FormatableBitSet      referencedCols = new FormatableBitSet(rclSize);
    int        erdNumber = -1;
    int        numSet = 0;

    // Get our final cost estimate.
    costEstimate = getFinalCostEstimate();

    for (int index = 0; index < rclSize; index++)
    {
      ResultColumn rc = (ResultColumn) resultColumns.elementAt(index);
      if (rc.isReferenced())
      {
        referencedCols.set(index);
        numSet++;
      }
    }

    // Only add referencedCols if not all columns are accessed
View Full Code Here

    if (!allColumns && targetVTI == null)
    {
      getCompilerContext().pushCurrentPrivType( Authorizer.NULL_PRIV);
      try
      {
        readColsBitSet = new FormatableBitSet();
        FromBaseTable fbt = getResultColumnList(resultSet.getResultColumns());
        afterColumns = resultSet.getResultColumns().copyListAndObjects();

        readColsBitSet = getReadMap(dataDictionary,
                    targetTableDescriptor,
View Full Code Here

        lockMode,
        false,
        changedColumnIds, null, null,
        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

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

    FormatableBitSet  columnMap = UpdateNode.getUpdateReadMap(baseTable,
      updateColumnList, conglomVector, relevantCdl, relevantTriggers, needsDeferredProcessing );

    markAffectedIndexes( conglomVector );

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

    {
      SanityManager.ASSERT(updateColumnList != null, "updateColumnList is null");
    }

    int    columnCount = baseTable.getMaxColumnID();
    FormatableBitSet  columnMap = new FormatableBitSet(columnCount + 1);

    /*
    ** Add all the changed columns.  We don't strictly
    ** need the before image of the changed column in all cases,
    ** but it makes life much easier since things are set
    ** up around the assumption that we have the before
    ** and after image of the column.
    */
    int[]  changedColumnIds = updateColumnList.sortMe();

    for (int ix = 0; ix < changedColumnIds.length; ix++)
    {
      columnMap.set(changedColumnIds[ix]);
    }

    /*
    ** 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.
    */
    DMLModStatementNode.getXAffectedIndexes(baseTable, updateColumnList, columnMap, conglomVector );
    /*
    ** Add all columns needed for constraints.  We don't
    ** need to bother with foreign key/primary key constraints
    ** because they are added as a side effect of adding
    ** their indexes above.
    */
    baseTable.getAllRelevantConstraints
      ( StatementType.UPDATE, false, changedColumnIds, needsDeferredProcessing, relevantConstraints );

    int rclSize = relevantConstraints.size();
    for (int index = 0; index < rclSize; index++)
    {
      ConstraintDescriptor cd = relevantConstraints.elementAt(index);
      if (cd.getConstraintType() != DataDictionary.CHECK_CONSTRAINT)
      {
        continue;
      }

      int[] refColumns = ((CheckConstraintDescriptor)cd).getReferencedColumns();
      for (int i = 0; i < refColumns.length; i++)
      {
        columnMap.set(refColumns[i]);
      }
    }

    /*
     ** If we have any triggers, then get all the columns
    ** because we don't know what the user will ultimately
    ** reference.
     */

    baseTable.getAllRelevantTriggers( StatementType.UPDATE, changedColumnIds, 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

    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

    {
      colPermsDescriptor = (ColPermsDescriptor) iterator.next();
      removePermEntryInCache(colPermsDescriptor);
      uuidKey = rf.buildIndexKeyRow(rf.COLPERMSID_INDEX_NUM, colPermsDescriptor);
      curRow=ti.getRow(tc, uuidKey, rf.COLPERMSID_INDEX_NUM);
          FormatableBitSet columns = (FormatableBitSet) curRow.getColumn(
            SYSCOLPERMSRowFactory.COLUMNS_COL_NUM).getObject();
      // See whether this is ADD COLUMN or DROP COLUMN. If ADD, then
      // add a new bit to the bit set. If DROP, then remove the bit
      // for the dropped column.
      if (columnDescriptor == null)
      {
        int currentLength = columns.getLength();
        columns.grow(currentLength+1);
      }
      else
      {
        FormatableBitSet modifiedColumns=new FormatableBitSet(columns);
        modifiedColumns.shrink(columns.getLength()-1);
        // All the bits from 0 ... colPosition-2 are OK. The bits from
        // colPosition to the end need to be shifted 1 to the left.
        // The bit for colPosition-1 simply disappears from COLUMNS.
        // ColumnPosition values count from 1, while bits in the
        // FormatableBitSet count from 0.
        for (int i = columnDescriptor.getPosition()-1;
            i < modifiedColumns.getLength();
            i++)
        {
          if (columns.isSet(i+1))
            modifiedColumns.set(i);
          else
            modifiedColumns.clear(i);
        }
        columns = modifiedColumns;
      }
          curRow.setColumn(SYSCOLPERMSRowFactory.COLUMNS_COL_NUM,
            dvf.getDataValue((Object) columns));
View Full Code Here

    TabInfoImpl ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);
    faultInTabInfo(ti);

    TransactionController tc = getTransactionExecute();

    FormatableBitSet columnToReadSet = new FormatableBitSet(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT);
    FormatableBitSet columnToUpdateSet = new FormatableBitSet(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT);
    columnToUpdateSet.set(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_VALID -1);
    columnToUpdateSet.set(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE -1);

    DataValueDescriptor[] replaceRow =
            new DataValueDescriptor[SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT];

    /* Set up a couple of row templates for fetching CHARS */
 
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.services.io.FormatableBitSet

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.