Package org.apache.derby.iapi.store.access

Examples of org.apache.derby.iapi.store.access.ConglomerateController


        if (!conglomerateControllers.isEmpty())
        {
            // loop from end to beginning, removing scans which are not held.
            for (int i = conglomerateControllers.size() - 1; i >= 0; i--)
            {
                ConglomerateController cc =
                    (ConglomerateController)
                        conglomerateControllers.get(i);

                if (cc.closeForEndTransaction(closeHeldControllers))
                {
                    // TODO - now counting on cc's removing themselves by
                    // calling the closeMe() method.
                    /* conglomerateControllers.removeElementAt(i); */
                }
View Full Code Here


                    "Bad lock level to openConglomerate:" + lock_level);
            }
        }

    // Get a conglomerate controller.
    ConglomerateController cc =
            conglom.open(
                this, rawtran, hold, open_mode,
                determine_lock_level(lock_level),
                determine_locking_policy(lock_level, isolation_level),
                static_info,
View Full Code Here

      throw StandardException.newException(
                SQLState.AM_NO_SUCH_CONGLOMERATE_DROP, new Long(conglomId));
        }

        // Get exclusive lock on the table being altered.
    ConglomerateController cc =
            conglom.open(
                this, rawtran, false, OPENMODE_FORUPDATE,
                MODE_TABLE,
                accessmanager.table_level_policy[
                    TransactionController.ISOLATION_SERIALIZABLE],
                (StaticCompiledOpenConglomInfo) null,
                (DynamicCompiledOpenConglomInfo) null);

    conglom.addColumn(this, column_id, template_column, collation_id);

        // remove the old entry in the Conglomerate directory, and add the
        // new one.
    if (is_temporary)
    {
            // remove old entry in the Conglomerate directory, and add new one
      if (tempCongloms != null)
        tempCongloms.remove(new Long(conglomId));
      tempCongloms.put(new Long(conglomId), conglom);
    }
    else
        {
            alterTableCallMade = true;

            // have access manager update the conglom to this new one.
      accessmanager.conglomCacheUpdateEntry(conglomId, conglom);
        }

        cc.close();

        return;
    }
View Full Code Here

            }

            for (Iterator it = conglomerateControllers.iterator();
                 it.hasNext(); )
            {
                ConglomerateController cc =
                    (ConglomerateController) it.next();
                str += "open conglomerate controller: " + cc + "\n";
            }

            if (sortControllers != null)
View Full Code Here

    // Get the ConglomerateDescriptor for the index
    ConglomerateDescriptor cd =
            td.getConglomerateDescriptor(indexConglomerateNumbers[index]);

    // Build the properties list for the new conglomerate
    ConglomerateController indexCC =
            tc.openConglomerate(
                indexConglomerateNumbers[index],
                false,
                TransactionController.OPENMODE_FORUPDATE,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_SERIALIZABLE);

    // Get the properties on the old index
    indexCC.getInternalTablePropertySet(properties);

    /* Create the properties that language supplies when creating the
     * the index.  (The store doesn't preserve these.)
     */
    int indexRowLength = indexRows[index].nColumns();
    properties.put("baseConglomerateId", Long.toString(newHeapConglom));
    if (cd.getIndexDescriptor().isUnique())
    {
      properties.put(
                "nUniqueColumns", Integer.toString(indexRowLength - 1));
    }
    else
    {
      properties.put(
                "nUniqueColumns", Integer.toString(indexRowLength));
    }
    if(cd.getIndexDescriptor().isUniqueWithDuplicateNulls())
    {
      properties.put(
                    "uniqueWithDuplicateNulls", Boolean.toString(true));
    }

    properties.put(
            "rowLocationColumn", Integer.toString(indexRowLength - 1));
    properties.put(
            "nKeyFields", Integer.toString(indexRowLength));

    indexCC.close();

    // We can finally drain the sorter and rebuild the index
    // Populate the index.
   
    RowLocationRetRowSource cCount           = null;
View Full Code Here

   */
  public void  dropTableDescriptor(TableDescriptor td, SchemaDescriptor schema,
                  TransactionController tc)
    throws StandardException
  {
    ConglomerateController  heapCC;
    ExecIndexRow      keyRow1 = null;
    DataValueDescriptor    schemaIDOrderable;
    DataValueDescriptor    tableNameOrderable;
    TabInfoImpl          ti = coreInfo[SYSTABLES_CORE_NUM];

View Full Code Here

   */
  public void updateLockGranularity(TableDescriptor td, SchemaDescriptor schema,
                    char lockGranularity, TransactionController tc)
    throws StandardException
  {
    ConglomerateController  heapCC;
    ExecIndexRow      keyRow1 = null;
    ExecRow            row;
    DataValueDescriptor    schemaIDOrderable;
    DataValueDescriptor    tableNameOrderable;
    TabInfoImpl          ti = coreInfo[SYSTABLES_CORE_NUM];
View Full Code Here

   * @exception StandardException    Thrown on error
   */
  public void  dropFileInfoDescriptor(FileInfoDescriptor fid)
            throws StandardException
  {
    ConglomerateController  heapCC;
    ExecIndexRow      keyRow1 = null;
    DataValueDescriptor    idOrderable;
    TabInfoImpl          ti = getNonCoreTI(SYSFILES_CATALOG_NUM);
    TransactionController   tc = getTransactionExecute();
   
View Full Code Here

            ConstraintDescriptorList dList,
            boolean forUpdate)
      throws StandardException
  {
    SYSCONSTRAINTSRowFactory rf = (SYSCONSTRAINTSRowFactory) ti.getCatalogRowFactory();
    ConglomerateController  heapCC;
    ConstraintDescriptor  cd = null;
    ExecIndexRow        indexRow1;
    ExecIndexRow      indexTemplateRow;
    ExecRow         outRow;
    RowLocation        baseRowLocation;
    ScanController      scanController;
    TransactionController  tc;

    // Get the current transaction controller
    tc = getTransactionCompile();

    outRow = rf.makeEmptyRow();

    heapCC =
            tc.openConglomerate(
                ti.getHeapConglomerate(), false, 0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ);


    /* Scan the index and go to the data pages for qualifying rows to
     * build the column descriptor.
     */
    scanController = tc.openScan(
        ti.getIndexConglomerate(indexId)// conglomerate to open
        false, // don't hold open across commit
        (forUpdate) ? TransactionController.OPENMODE_FORUPDATE : 0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ,
        (FormatableBitSet) null,         // all fields as objects
        keyRow.getRowArray(),   // start position - exact key match.
        ScanController.GE,      // startSearchOperation
        null,                   //scanQualifier,
        keyRow.getRowArray(),   // stop position - exact key match.
        ScanController.GT);     // stopSearchOperation

    while (scanController.next())
    {
      SubConstraintDescriptor subCD = null;

      // create an index row template
      indexRow1 = getIndexRowFromHeapRow(
                  ti.getIndexRowGenerator(indexId),
                  heapCC.newRowLocationTemplate(),
                  outRow);

      scanController.fetch(indexRow1.getRowArray());

      baseRowLocation = (RowLocationindexRow1.getColumn(
                        indexRow1.nColumns());

      boolean base_row_exists =
                heapCC.fetch(
                    baseRowLocation, outRow.getRowArray(), (FormatableBitSet) null);

            if (SanityManager.DEBUG)
            {
                // it can not be possible for heap row to disappear while
                // holding scan cursor on index at ISOLATION_REPEATABLE_READ.
                SanityManager.ASSERT(base_row_exists, "base row doesn't exist");
            }

      switch (rf.getConstraintType(outRow))
      {
        case DataDictionary.PRIMARYKEY_CONSTRAINT:
        case DataDictionary.FOREIGNKEY_CONSTRAINT:
        case DataDictionary.UNIQUE_CONSTRAINT:
          subCD = getSubKeyConstraint(
                rf.getConstraintId(outRow), rf.getConstraintType(outRow));
          break;

        case DataDictionary.CHECK_CONSTRAINT:
          subCD = getSubCheckConstraint(
                rf.getConstraintId(outRow));
          break;

        default:
          if (SanityManager.DEBUG)
          {
            SanityManager.THROWASSERT("unexpected value "+
                "from rf.getConstraintType(outRow)" +
                rf.getConstraintType(outRow));
          }
      }

      if (SanityManager.DEBUG)
      {
        SanityManager.ASSERT(subCD != null,
                   "subCD is expected to be non-null");
      }

      /* Cache the TD in the SCD so that
       * the row factory doesn't need to go
       * out to disk to get it.
       */
      subCD.setTableDescriptor(td);

      cd = (ConstraintDescriptor) rf.buildDescriptor(
                        outRow,
                        subCD,
                        this);

      /* If dList is null, then caller only wants a single descriptor - we're done
       * else just add the current descriptor to the list.
       */
      if (dList == null)
      {
        break;
      }
      else
      {
        dList.add(cd);
      }
    }
        scanController.close();
    heapCC.close();
    return cd;
  }
View Full Code Here

            TupleDescriptor parentTupleDescriptor,
            List list)
      throws StandardException
  {
    SYSCONSTRAINTSRowFactory rf = (SYSCONSTRAINTSRowFactory) ti.getCatalogRowFactory();
    ConglomerateController  heapCC;
    ExecRow         outRow;
    ExecRow         templateRow;
    ScanController      scanController;
    TransactionController  tc;
    ConstraintDescriptor  cd = null;
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.store.access.ConglomerateController

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.