Examples of ExecutionFactory


Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

    return constantActionFactory;
  }

  public  final  ExecutionFactory  getExecutionFactory()
  {
    ExecutionFactory  ef = getLanguageConnectionContext().getLanguageConnectionFactory().getExecutionFactory();

    return ef;
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

                    !lcc.getStatementContext().getStatementWasInvalidated())
        {  
                    endExecutionTime = getCurrentTimeMillis();

                    // get the ResultSetStatisticsFactory, which gathers RuntimeStatistics
                    ExecutionFactory ef = lcc.getLanguageConnectionFactory().getExecutionFactory();
                    ResultSetStatisticsFactory rssf;
                    rssf = ef.getResultSetStatisticsFactory();
 
                    // get the RuntimeStatisticsImpl object which is the wrapper for all
                    // gathered statistics about all the different resultsets
                    RunTimeStatistics rsImpl = rssf.getRunTimeStatistics(activation, this, subqueryTrackingArray);
 
                    // save the RTW (wrapper)object in the lcc
                    lcc.setRunTimeStatisticsObject(rsImpl);
                   
                    // now explain gathered statistics, using an appropriate visitor
                    XPLAINVisitor visitor = ef.getXPLAINFactory().getXPLAINVisitor();
                    visitor.doXPLAIN(rsImpl,activation);
          }

      int staLength = (subqueryTrackingArray == null) ? 0 :
                subqueryTrackingArray.length;
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

      int numCols = accessedCols.getNumBitsSet();
      baseColumnMap = new int[numCols];

      if (compactRow == null)
      {
        ExecutionFactory ex = getLanguageConnectionContext().getLanguageConnectionFactory().getExecutionFactory();

        if (isKeyed)
        {
          compactRow = ex.getIndexableRow(numCols);
        }
        else
        {
          compactRow = ex.getValueRow(numCols);
        }
      }

      int position = 0;
      for (int i = accessedCols.anySetBit();
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

            dd = lcc.getDataDictionary();

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

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

            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 */
 
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

    super(a, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);
    source = s;
    originalSource = s;

        ExecPreparedStatement ps = a.getPreparedStatement();
        ExecutionFactory ef = a.getExecutionFactory();

        rowTemplate = ef.getIndexableRow(
                ((ExecRowBuilder) ps.getSavedObject(ra)).build(ef));

    aggInfoList = (AggregatorInfoList) ps.getSavedObject(aggregateItem);
    aggregates = getSortAggregators(aggInfoList, false,
        a.getLanguageConnectionContext(), s);
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

      int numCols = accessedCols.getNumBitsSet();
      baseColumnMap = new int[numCols];

      if (compactRow == null)
      {
        ExecutionFactory ex = getLanguageConnectionContext().getLanguageConnectionFactory().getExecutionFactory();

        if (isKeyed)
        {
          compactRow = ex.getIndexableRow(numCols);
        }
        else
        {
          compactRow = ex.getValueRow(numCols);
        }
      }

      int position = 0;
      for (int i = accessedCols.anySetBit();
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

    // Only incur the cost of allocating and maintaining
    // updated column information if the columns can be updated.
    if (concurrencyOfThisResultSet == java.sql.ResultSet.CONCUR_UPDATABLE)
    {
            final int columnCount = resultDescription.getColumnCount();
            final ExecutionFactory factory = conn.getLanguageConnection().
            getLanguageConnectionFactory().getExecutionFactory();
           
      try{
        //initialize arrays related to updateRow implementation
        columnGotUpdated = new boolean[columnCount];
        updateRow = factory.getValueRow(columnCount);
        for (int i = 1; i <= columnCount; i++) {
          updateRow.setColumn(i, resultDescription.getColumnDescriptor(i).
                    getType().getNull());
        }
        initializeUpdateRowModifiers();
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

    return constantActionFactory;
  }

  public  final  ExecutionFactory  getExecutionFactory()
  {
    ExecutionFactory  ef = getLanguageConnectionContext().getLanguageConnectionFactory().getExecutionFactory();

    return ef;
  }
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

    // push the context that defines our class factory
    pushClassFactoryContext(cm, lcf.getClassFactory());

    // we also need to push an execution context.
    ExecutionFactory ef = lcf.getExecutionFactory();

    ef.newExecutionContext(cm);
    //
    //Initialize our language connection context. Note: This is
    //a bit of a hack. Unfortunately, we can't initialize this
    //when we push it. We first must push a few more contexts.
    lctx.initialize();   
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecutionFactory

    super(a, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);
    source = s;
    originalSource = s;

        ExecPreparedStatement ps = a.getPreparedStatement();
        ExecutionFactory ef = a.getExecutionFactory();

        rowTemplate = ef.getIndexableRow(
                ((ExecRowBuilder) ps.getSavedObject(ra)).build(ef));

    aggInfoList = (AggregatorInfoList) ps.getSavedObject(aggregateItem);
    aggregates = getSortAggregators(aggInfoList, false,
        a.getLanguageConnectionContext(), s);
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.