Examples of FormatableBitSet


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);
        ExecRow deferredTempRow2;

        rs.open();
        while ((deferredTempRow2 = rs.getNextRow()) != null)
        {
View Full Code Here

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

        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);

View Full Code Here

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

    super.writeExternal(out);
    out.writeLong(baseConglomerateId);
    out.writeInt(rowLocationColumn);

        //write the columns ascend/descend information as bits
        FormatableBitSet ascDescBits =
            new FormatableBitSet(ascDescInfo.length);

        for (int i = 0; i < ascDescInfo.length; i++)
        { 
            if (ascDescInfo[i])
                ascDescBits.set(i);
        }
        ascDescBits.writeExternal(out);
  }
View Full Code Here

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

   
    baseConglomerateId = in.readLong();
    rowLocationColumn  = in.readInt();

        // read the column sort order info
        FormatableBitSet ascDescBits = new FormatableBitSet();
        ascDescBits.readExternal(in);
        ascDescInfo = new boolean[ascDescBits.getLength()];
        for(int i =0 ; i < ascDescBits.getLength(); i++)
            ascDescInfo[i] = ascDescBits.isSet(i);

        // In memory maintain a collation id per column in the template.
        collation_ids = new int[format_ids.length];

        // initialize all the entries to COLLATION_TYPE_UCS_BASIC,
View Full Code Here

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

    super.writeExternal(out);
    out.writeLong(baseConglomerateId);
    out.writeInt(rowLocationColumn);

        //write the columns ascend/descend information as bits
        FormatableBitSet ascDescBits =
            new FormatableBitSet(ascDescInfo.length);

        for (int i = 0; i < ascDescInfo.length; i++)
        { 
            if (ascDescInfo[i])
                ascDescBits.set(i);
        }
        ascDescBits.writeExternal(out);
  }
View Full Code Here

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

   
    baseConglomerateId = in.readLong();
    rowLocationColumn  = in.readInt();

        // read the column sort order info
        FormatableBitSet ascDescBits = new FormatableBitSet();
        ascDescBits.readExternal(in);
        ascDescInfo = new boolean[ascDescBits.getLength()];
        for(int i =0 ; i < ascDescBits.getLength(); i++)
            ascDescInfo[i] = ascDescBits.isSet(i);

        // In memory maintain a collation id per column in the template.
        collation_ids = new int[format_ids.length];

        // initialize all the entries to COLLATION_TYPE_UCS_BASIC,
View Full Code Here

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

            if (init_scanColumnList != null)
            {
                // verify that all columns specified in qualifiers, start
                // and stop positions are specified in the scanColumnList. 
               
                FormatableBitSet required_cols;

                if (qualifier != null)
                    required_cols = RowUtil.getQualifierBitSet(qualifier);
                else
                    required_cols = new FormatableBitSet(0);

                // add in start columns
                if (this.init_startKeyValue != null)
                {
          required_cols.grow(this.init_startKeyValue.length);
                    for (int i = 0; i < this.init_startKeyValue.length; i++)
                        required_cols.set(i);
                }

                if (this.init_stopKeyValue != null)
                {
          required_cols.grow(this.init_stopKeyValue.length);
                    for (int i = 0; i < this.init_stopKeyValue.length; i++)
                        required_cols.set(i);
                }

                FormatableBitSet required_cols_and_scan_list =
                    (FormatableBitSet) required_cols.clone();

                required_cols_and_scan_list.and(init_scanColumnList);

        // FormatableBitSet equals requires the two FormatableBitSets to be of same
        // length.
        required_cols.grow(init_scanColumnList.size());

                if (!required_cols_and_scan_list.equals(required_cols))
                {
                    SanityManager.THROWASSERT(
                        "Some column specified in a Btree " +
                        " qualifier/start/stop list is " +
                        "not represented in the scanColumnList." +
View Full Code Here

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

  public FormatableBitSet bindResultColumnsByName(TableDescriptor targetTableDescriptor,
                                                    DMLStatementNode statement)
          throws StandardException
  {
    int      size = size();
    FormatableBitSet columnBitSet = new FormatableBitSet( targetTableDescriptor.getNumberOfColumns());

    for (int index = 0; index < size; index++)
    {
      ResultColumn rc = (ResultColumn) elementAt(index);

      rc.bindResultColumnByName(
            targetTableDescriptor,
            index + 1
          );
            int colIdx = rc.getColumnPosition() - 1;
            if( SanityManager.DEBUG)
                SanityManager.ASSERT( colIdx >= 0 && colIdx < targetTableDescriptor.getNumberOfColumns(),
                                      "Invalid column position found for " + rc.getName());
      /* Verify that this column's name is unique within the list if requested */
            if( statement != null && columnBitSet.isSet( colIdx))
            {
                String colName = rc.getName();

        if (statement instanceof UpdateNode)
        {
          throw StandardException.newException(SQLState.LANG_DUPLICATE_COLUMN_NAME_UPDATE, colName);
        }
        else
        {
          throw StandardException.newException(SQLState.LANG_DUPLICATE_COLUMN_NAME_INSERT, colName);
        }
      }
            columnBitSet.set( colIdx);
    }
    return columnBitSet;
  }
View Full Code Here

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

   *
   * @return the FormatableBitSet
   */
  public FormatableBitSet getColumnReferenceMap()
  {
    FormatableBitSet colMap = new FormatableBitSet(size());
    int size = size();
    for (int index = 0; index < size; index++)
    {
      ResultColumn rc = (ResultColumn) elementAt(index);
      if (rc.isReferenced())
      {
        colMap.set(index);
     
    }
    return colMap;
  }
View Full Code Here

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

  {
    int  index;
    int colsAdded = 0;
    int size = size();

    FormatableBitSet newReferencedCols = new FormatableBitSet(size);

    /*
    ** For an updatable cursor, we need
    ** all columns.
    */
    if (positionedUpdate)
    {
      if (always)
      {
        /* Set all bits in the bit map */
        for (index = 0; index < size; index++)
        {
          newReferencedCols.set(index);
        }

        return newReferencedCols;
      }
      else
      {
        return null;
      }
    }
 
    for (index = 0; index < size; index++)
    {
      ResultColumn oldCol = (ResultColumn) elementAt(index);
      if (oldCol.isReferenced())
      {
        /* Skip RCs whose expression is not a BCN
         * when requested to do so.
         */
        if (onlyBCNs && ! (oldCol.getExpression() instanceof BaseColumnNode))
        {
          continue;
        }
        newReferencedCols.set(index);
        colsAdded++;
      }
    }

    /* Return the FormatableBitSet if not all RCs are referenced or if
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.