Package org.apache.derby.iapi.sql.dictionary

Examples of org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor


  {
    /* Don't bother checking if we're already deferred */
    if (! deferred )
    {
      /* Get the conglomerate descriptor for the target table */
      ConglomerateDescriptor updateCD =
                    targetTable.
                      getTrulyTheBestAccessPath().
                        getConglomerateDescriptor();

      /* If it an index? */
      if (updateCD != null && updateCD.isIndex())
      {
        int [] baseColumns =
            updateCD.getIndexDescriptor().baseColumnPositions();

        /* Are any of the index columns updated? */
        if (resultSet.
            getResultColumns().
                    updateOverlaps(baseColumns))
View Full Code Here


   */
  private int getAbsoluteColumnPosition(Optimizable optTable)
  {
    ColumnReference  cr = (ColumnReference) operand;
    int columnPosition;
    ConglomerateDescriptor bestCD;

    /* Column positions are one-based, store is zero-based */
    columnPosition = cr.getSource().getColumnPosition();

    bestCD =
      optTable.getTrulyTheBestAccessPath().getConglomerateDescriptor();

    /*
    ** If it's an index, find the base column position in the index
    ** and translate it to an index column position.
    */
    if (bestCD.isIndex())
    {
      columnPosition = bestCD.getIndexDescriptor().
        getKeyColumnPosition(new Integer(columnPosition)).intValue();

      if (SanityManager.DEBUG)
      {
        SanityManager.ASSERT(columnPosition > 0,
View Full Code Here

                      OptimizablePredicateList predList,
                      CostEstimate outerCost)
        throws StandardException
  {
    /* CHOOSE BEST CONGLOMERATE HERE */
    ConglomerateDescriptor  conglomerateDescriptor = null;
    ConglomerateDescriptor  bestConglomerateDescriptor = null;
    AccessPath bestAp = optimizable.getBestAccessPath();
    int lockMode = optimizable.getCurrentAccessPath().getLockMode();


    /*
 
View Full Code Here

   */
  public Hashtable hashAllConglomerateDescriptorsByNumber(TransactionController tc)
    throws StandardException
  {
    Hashtable ht = new Hashtable();
    ConglomerateDescriptor    cd = null;
    ScanController        scanController;
    ExecRow           outRow;
    // ExecIndexRow        keyRow = null;
    TabInfoImpl            ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];
    SYSCONGLOMERATESRowFactory  rf = (SYSCONGLOMERATESRowFactory) ti.getCatalogRowFactory();

    outRow = rf.makeEmptyRow();
    scanController = tc.openScan(
        ti.getHeapConglomerate()// conglomerate to open
        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, //keyRow.getRowArray(),   // start position - first row
        ScanController.GE,      // startSearchOperation
        (ScanQualifier [][]) null,
        (DataValueDescriptor[]) null, //keyRow.getRowArray(),   // 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()))
    {
      cd = (ConglomerateDescriptor) rf.buildDescriptor(
                        outRow,
                        (TupleDescriptor) null,
                        this );
      Long hashKey = new Long(cd.getConglomerateNumber());
      ht.put(hashKey, cd);
    }

        scanController.close();

View Full Code Here

  {
    SchemaDescriptor    sd = getSystemSchemaDescriptor( );
    DataDescriptorGenerator ddg = getDataDescriptorGenerator();
    long          indexConglomerateNumber;

    ConglomerateDescriptor  conglomerateDescriptor = bootstrapOneIndex
      ( sd, tc, ddg, ti, indexNumber, heapConglomerateNumber );

    indexConglomerateNumber = conglomerateDescriptor.getConglomerateNumber();

    addDescriptor(conglomerateDescriptor, sd,
            SYSCONGLOMERATES_CATALOG_NUM, false, tc);
           
    return indexConglomerateNumber;
View Full Code Here

    int              numColumns;
    long            conglomId;
    RowLocation          rl;
    CatalogRowFactory      rf = ti.getCatalogRowFactory();
    IndexRowGenerator      irg;
    ConglomerateDescriptor  conglomerateDescriptor;

    initSystemIndexVariables(ddg, ti, indexNumber);

    irg = ti.getIndexRowGenerator(indexNumber);
View Full Code Here

    addDescriptor(td, sd, SYSTABLES_CATALOG_NUM,
            false, tc);
    toid = td.getUUID();
 
    /* Add the conglomerate for the heap */
    ConglomerateDescriptor cgd = ddg.newConglomerateDescriptor(conglomId,
                                  heapName,
                                  false,
                                  null,
                                  false,
                                  heapUUID,
View Full Code Here

      if (td == null)
      {
        return;
      }

      ConglomerateDescriptor cd = null;
      ConglomerateDescriptor[] cds = td.getConglomerateDescriptors();

      /* Init the heap conglomerate here */
      for (int index = 0; index < cds.length; index++)
      {
        cd = cds[index];

        if (! cd.isIndex())
        {
          ti.setHeapConglomerate(cd.getConglomerateNumber());
          break;
        }
      }
     
      if (SanityManager.DEBUG)
      {
        if (cd == null)
        {
          SanityManager.THROWASSERT("No heap conglomerate found for "
            + ti.getTableName());
        }
      }

      /* Initialize the index conglomerates */
      numIndexes = ti.getCatalogRowFactory().getNumIndexes();
      if (numIndexes == 0)
      {
        return;
      }

      /* For each index, we get its id from the CDL */
      ConglomerateDescriptor icd = null;
      int  indexCount = 0;

      for (int index = 0; index < cds.length; index++)
      {
        icd = cds[index];

        if (icd.isIndex())
        {
          ti.setIndexConglomerate(icd);
          indexCount++;
        }
        continue;
View Full Code Here

    td = getTableDescriptor();

    conglomerateNumber = td.getHeapConglomerateId();

    /* Get the base conglomerate descriptor */
    ConglomerateDescriptor cd = td.getConglomerateDescriptor(conglomerateNumber);

    /* Statement is dependent on the TableDescriptor and ConglomerateDescriptor */
    cc.createDependency(td);
    cc.createDependency(cd);
  }
 
View Full Code Here

   * @return The absolute 0-based column position of the ColumnReference
   */
  private int getAbsoluteColumnPosition(Optimizable optTable)
  {
    ColumnReference  cr;
    ConglomerateDescriptor bestCD;
    int columnPosition;

    if (keyColumnOnLeft(optTable))
    {
      cr = (ColumnReference) leftOperand;
    }
    else
    {
      cr = (ColumnReference) rightOperand;
    }

    bestCD = optTable.getTrulyTheBestAccessPath().
                        getConglomerateDescriptor();

    /*
    ** Column positions are one-based, store is zero-based.
    */
    columnPosition = cr.getSource().getColumnPosition();

    /*
    ** If it's an index, find the base column position in the index
    ** and translate it to an index column position.
    */
    if (bestCD != null && bestCD.isIndex())
    {
      columnPosition = bestCD.getIndexDescriptor().
        getKeyColumnPosition(columnPosition);

      if (SanityManager.DEBUG)
      {
        SanityManager.ASSERT(columnPosition > 0,
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor

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.