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

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


                 TransactionController.IS_KEPT));

    long cid = td.getHeapConglomerateId();

    //remove the old conglomerate descriptor from the table descriptor
    ConglomerateDescriptor cgd = td.getConglomerateDescriptor(cid);
    td.getConglomerateDescriptorList().dropConglomerateDescriptorByUUID(cgd.getUUID());
    //add the new conglomerate descriptor to the table descriptor
    cgd = getDataDictionary().getDataDescriptorGenerator().newConglomerateDescriptor(conglomId, null, false, null, false, null, td.getUUID(),
    td.getSchemaDescriptor().getUUID());
    ConglomerateDescriptorList conglomList = td.getConglomerateDescriptorList();
    conglomList.add(cgd);
View Full Code Here


        continue;
      }

      TableDescriptor  pktd = refcd.getTableDescriptor();
      UUID pkuuid = refcd.getIndexId();
      ConglomerateDescriptor pkIndexConglom = pktd.getConglomerateDescriptor(pkuuid);

      TableDescriptor refTd = cd.getTableDescriptor();
      fkVector.add(new FKInfo(
                  fkNames,              // foreign key names
                  refTd.getName(),        // table being modified
                  statementType,            // INSERT|UPDATE|DELETE
                  type,                // FOREIGN_KEY|REFERENCED_KEY
                  pkuuid,                // referenced backing index uuid
                  pkIndexConglom.getConglomerateNumber(), // referened backing index conglom
                  uuids,                // fk backing index uuids
                  conglomNumbers,            // fk backing index congloms
                  isSelfReferencingFK,        // is self ref array of bool
                  remapReferencedColumns(cd, rowMap)// column referened by key
                  dd.getRowLocationTemplate(getLanguageConnectionContext(), refTd),
View Full Code Here

    long[] distinctConglomNums = new long[cds.length - 1];
    int distinctCount = 0;

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

      if (!cd.isIndex()) { continue; }

      /*
      ** If this index doesn't contain any updated
      ** columns, then we can skip it.
      */
      if ((updatedColumns != null) &&
        (!updatedColumns.updateOverlaps(
          cd.getIndexDescriptor().baseColumnPositions())))
      { continue; }

      if ( conglomVector != null )
      {
        int i;
        for (i = 0; i < distinctCount; i++)
        {
          if (distinctConglomNums[i] == cd.getConglomerateNumber())
            break;
        }
        if (i == distinctCount)    // first appearence
        {
          distinctConglomNums[distinctCount++] = cd.getConglomerateNumber();
          conglomVector.add( cd );
        }
      }

      IndexRowGenerator ixd = cd.getIndexDescriptor();
      int[] cols = ixd.baseColumnPositions();

      if (colBitSet != null)
      {
        for (int i = 0; i < cols.length; i++)
View Full Code Here

  (
    Vector  affectedConglomerates
    )
    throws StandardException
  {
    ConglomerateDescriptor  cd;
    int            indexCount = affectedConglomerates.size();
    CompilerContext      cc = getCompilerContext();

    indicesToMaintain = new IndexRowGenerator[ indexCount ];
    indexConglomerateNumbers = new long[ indexCount ];
    indexNames = new String[indexCount];

    for ( int ictr = 0; ictr < indexCount; ictr++ )
    {
      cd = (ConglomerateDescriptor) affectedConglomerates.get( ictr );

      indicesToMaintain[ ictr ] = cd.getIndexDescriptor();
      indexConglomerateNumbers[ ictr ] = cd.getConglomerateNumber();
      indexNames[ictr] =
        ((cd.isConstraint()) ? null : cd.getConglomerateName());

      cc.createDependency(cd);
    }

  }
View Full Code Here

    ConglomerateDescriptor[] cds = tableDescriptor.getConglomerateDescriptors();

    /* Cycle through the ConglomerateDescriptors */
    for (int index = 0; index < cds.length; index++)
    {
      ConglomerateDescriptor cd = cds[index];

      if (! cd.isIndex())
      {
        continue;
      }
      IndexDescriptor id = cd.getIndexDescriptor();

      if (! id.isUnique())
      {
        continue;
      }
View Full Code Here

    ConglomerateDescriptor[] cds = tableDescriptor.getConglomerateDescriptors();

    /* Cycle through the ConglomerateDescriptors */
    for (int index = 0; index < cds.length; index++)
    {
      ConglomerateDescriptor cd = cds[index];

      if (! cd.isIndex())
      {
        continue;
      }
      IndexDescriptor id = cd.getIndexDescriptor();

      if (! id.isUnique())
      {
        continue;
      }
View Full Code Here

      {
        return false;
      }
    }
    // Verify access path is an index
    ConglomerateDescriptor cd = getTrulyTheBestAccessPath().getConglomerateDescriptor();
    if (! cd.isIndex())
    {
      return false;
    }

    // Now consider whether or not the CRs can be permuted
View Full Code Here

                 TransactionController.IS_KEPT));

        long cid = td.getHeapConglomerateId();

        //remove the old conglomerate descriptor from the table descriptor
        ConglomerateDescriptor cgd = td.getConglomerateDescriptor(cid);
        td.getConglomerateDescriptorList().dropConglomerateDescriptorByUUID(
            cgd.getUUID());

        //add the new conglomerate descriptor to the table descriptor
        cgd = getDataDictionary().getDataDescriptorGenerator().newConglomerateDescriptor(conglomId, null, false, null, false, null, td.getUUID(),
        td.getSchemaDescriptor().getUUID());
        ConglomerateDescriptorList conglomList =
View Full Code Here

    //Check if we are in alter table to update the statistics. If yes, then
    //check if we are here to update the statistics of a specific index. If
    //yes, then verify that the indexname provided is a valid one.
    if (updateStatistics && !updateStatisticsAll)
    {
      ConglomerateDescriptor  cd = null;
      if (schemaDescriptor.getUUID() != null)
        cd = dd.getConglomerateDescriptor(indexNameForUpdateStatistics, schemaDescriptor, false);

      if (cd == null)
      {
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

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.