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

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


  {
    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

          ConglomerateDescriptor[] conglom_descriptors =
                td.getConglomerateDescriptors();

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

                tc.compressConglomerate(cd.getConglomerateNumber());
            }
          }
        }

        return;
View Full Code Here


        int index_idx = 0;
        for (int cd_idx = 0; cd_idx < conglom_descriptors.length; cd_idx++)
        {
            ConglomerateDescriptor index_cd = conglom_descriptors[cd_idx];

            if (!index_cd.isIndex())
            {
                // skip the heap descriptor entry
                continue;
            }

            // ScanControllers are used to delete old index row
            index_scan[index_idx] =
                tc.openScan(
                    index_cd.getConglomerateNumber(),
                    true,  // hold
                    TransactionController.OPENMODE_FORUPDATE,
                    TransactionController.MODE_TABLE,
                    TransactionController.ISOLATION_SERIALIZABLE,
                    null,   // full row is retrieved,
                            // so that full row can be used for start/stop keys
                    null,  // startKeyValue - will be reset with reopenScan()
                    0,    //
                    null,  // qualifier
                    null,  // stopKeyValue  - will be reset with reopenScan()
                    0);    //

            // ConglomerateControllers are used to insert new index row
            index_cc[index_idx] =
                tc.openConglomerate(
                    index_cd.getConglomerateNumber(),
                    true,  // hold
                    TransactionController.OPENMODE_FORUPDATE,
                    TransactionController.MODE_TABLE,
                    TransactionController.ISOLATION_SERIALIZABLE);

            // build column map to allow index row to be built from base row
            int[] baseColumnPositions   =
                index_cd.getIndexDescriptor().baseColumnPositions();
            int[] zero_based_map        =
                new int[baseColumnPositions.length];

            for (int i = 0; i < baseColumnPositions.length; i++)
            {
View Full Code Here

            ConglomerateDescriptor[] conglom_descriptors =
                td.getConglomerateDescriptors();

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

                tc.purgeConglomerate(cd.getConglomerateNumber());
            }
          }
        }

        return;
View Full Code Here

                {
                    if (columns.elementAt(count).getPosition() != columnPostion)
                        break;

                    //get backing index
                    ConglomerateDescriptor desc =
                        td.getConglomerateDescriptor(cd.getConglomerateId());

                    //check if the backing index was created when the column
                    //not null ie is backed by unique index
                    if (!desc.getIndexDescriptor().isUnique())
                        break;

                    // replace backing index with a unique when not null index.
                    recreateUniqueConstraintBackingIndexAsUniqueWhenNotNull(
                        desc, td, activation, lcc);
View Full Code Here

     * RESOLVE - this will change in 1.4 because we will get
     * back the same conglomerate number
     */
    // Get the ConglomerateDescriptor for the heap
    long oldHeapConglom       = td.getHeapConglomerateId();
    ConglomerateDescriptor cd =
            td.getConglomerateDescriptor(oldHeapConglom);

    // Update sys.sysconglomerates with new conglomerate #
    dd.updateConglomerateDescriptor(cd, newHeapConglom, tc);

View Full Code Here

    }

    // Update the DataDictionary
    // Get the ConglomerateDescriptor for the heap
    long oldHeapConglom = td.getHeapConglomerateId();
    ConglomerateDescriptor cd = td.getConglomerateDescriptor(oldHeapConglom);

    // Update sys.sysconglomerates with new conglomerate #
    dd.updateConglomerateDescriptor(cd, newHeapConglom, tc);
    // Drop the old conglomerate
    tc.dropConglomerate(oldHeapConglom);
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.