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

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


            int            indexId,
            int            indexCol,
            DataValueDescriptor    schemaIdOrderable )
    throws StandardException
  {
    ConglomerateController  heapCC = null;
    ExecIndexRow        indexRow1;
    ExecIndexRow      indexTemplateRow;
    ExecRow         outRow;
    ScanController      scanController = null;
    boolean          foundRow;
    FormatableBitSet          colToCheck = new FormatableBitSet(indexCol);
    CatalogRowFactory    rf = ti.getCatalogRowFactory()

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(indexId >= 0, "code needs to be enhanced"+
        " to support a table scan to find the index id");
    }

    colToCheck.set(indexCol - 1);

    ScanQualifier[][] qualifier = exFactory.getScanQualifier(1);
    qualifier[0][0].setQualifier
        (indexCol - 1,
         schemaIdOrderable,
         Orderable.ORDER_OP_EQUALS,
         false,
         false,
         false);

    outRow = rf.makeEmptyRow();

    try
    {
      heapCC =
              tc.openConglomerate(
                  ti.getHeapConglomerate(), false, 0,
                    TransactionController.MODE_RECORD,
                    TransactionController.ISOLATION_REPEATABLE_READ);
 
      scanController = tc.openScan(
          ti.getIndexConglomerate(indexId)// conglomerate to open
          false,                 // don't hold open across commit
          0,                                  // for read
                  TransactionController.MODE_RECORD,  // row locking
                    TransactionController.ISOLATION_REPEATABLE_READ,
          colToCheck,             // don't get any rows
          null,                 // start position - first row
          ScanController.GE,            // startSearchOperation
          qualifier,               // scanQualifier,
          null,                 // stop position - through last row
          ScanController.GT);           // stopSearchOperation
 
      foundRow = (scanController.next());
    }
    finally
    {
      if (scanController != null
      {
        scanController.close();
      }
      if (heapCC != null)
      {
        heapCC.close();
      }
    }
   
    return foundRow;
  }
View Full Code Here


           * we start retrieving results.  The assumption is to
           * delete current row right after we retrieve it.
           */
          futureRowResultSet.deleteCurrentRow();
          RowLocation rl = (RowLocation) ridRow.getColumn(1);
          ConglomerateController baseCC = activation.getHeapConglomerateController();
          if (sparseRow == null)
            getSparseRowAndMap();
                   baseCC.fetch(
                           rl, sparseRow.getRowArray(), sparseRowMap);
          RowLocation rl2 = (RowLocation) rl.getClone();
          currentRow.setColumn(currentRow.nColumns(), rl2);
          candidate.setColumn(candidate.nColumns(), rl2);    // have to be consistent!

View Full Code Here

      super.close();

      if (indexCols != null)
      {
        ConglomerateController borrowedBaseCC = activation.getHeapConglomerateController();
        if (borrowedBaseCC != null)
        {
          borrowedBaseCC.close();
          activation.clearHeapConglomerateController();
        }
      }
      if (futureRowResultSet != null)
        futureRowResultSet.close();
View Full Code Here

    }

    conglomerateNumber = new long[cds.length];
    indexRow = new ExecIndexRow[cds.length];
    objectUUID = new UUID[cds.length];
    ConglomerateController heapCC =
      tc.openConglomerate(td.getHeapConglomerateId(), false, 0,
          TransactionController.MODE_RECORD,
          TransactionController.ISOLATION_REPEATABLE_READ);

    try
    {
      for (int i = 0; i < cds.length; i++)
      {
        if (!cds[i].isIndex())
        {
          conglomerateNumber[i] = -1;
          continue;
        }

        conglomerateNumber[i] = cds[i].getConglomerateNumber();

        objectUUID[i] = cds[i].getUUID();

        indexRow[i] =
          cds[i].getIndexDescriptor().getNullIndexRow(
            td.getColumnDescriptorList(),
            heapCC.newRowLocationTemplate());
      }
    }
    finally
    {
      heapCC.close();
    }

    dd.startWriting(lcc);

    dm.invalidateFor(td, DependencyManager.UPDATE_STATISTICS, lcc);
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

      /* Special code generation for RID since expression is CurrentRowLocationNode.
       * Really need yet another node type that does its own code generation.
       */
      if (rc.getExpression() instanceof CurrentRowLocationNode)
      {
        ConglomerateController cc = null;
        int savedItem;
        RowLocation rl;
       
        cc = getLanguageConnectionContext().
            getTransactionCompile().openConglomerate(
              conglomerateId,
                            false,
              0,
              TransactionController.MODE_RECORD,
              TransactionController.ISOLATION_READ_COMMITTED);
        try
        {
          rl = cc.newRowLocationTemplate();
        }
        finally
        {
          if (cc != null)
          {
            cc.close();
          }
        }

        savedItem = acb.addItem(rl);
               
View Full Code Here

   */
  final void lockTableForDDL(TransactionController tc,
             long heapConglomerateNumber, boolean exclusiveMode)
    throws StandardException
  {
    ConglomerateController cc;

    cc = tc.openConglomerate(
          heapConglomerateNumber,
                    false,
          (exclusiveMode) ?
            (TransactionController.OPENMODE_FORUPDATE |
              TransactionController.OPENMODE_FOR_LOCK_ONLY) :
            TransactionController.OPENMODE_FOR_LOCK_ONLY,
              TransactionController.MODE_TABLE,
                    TransactionController.ISOLATION_SERIALIZABLE);
    cc.close();
  }
View Full Code Here

            int            indexId,
            int            indexCol,
            DataValueDescriptor    schemaIdOrderable )
    throws StandardException
  {
    ConglomerateController  heapCC = null;
    ExecIndexRow        indexRow1;
    ExecIndexRow      indexTemplateRow;
    ExecRow         outRow;
    ScanController      scanController = null;
    boolean          foundRow;
    FormatableBitSet          colToCheck = new FormatableBitSet(indexCol);
    CatalogRowFactory    rf = ti.getCatalogRowFactory()

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(indexId >= 0, "code needs to be enhanced"+
        " to support a table scan to find the index id");
    }

    colToCheck.set(indexCol - 1);

    ScanQualifier[][] qualifier = exFactory.getScanQualifier(1);
    qualifier[0][0].setQualifier
        (indexCol - 1,
         schemaIdOrderable,
         Orderable.ORDER_OP_EQUALS,
         false,
         false,
         false);

    outRow = rf.makeEmptyRow();

    try
    {
      heapCC =
              tc.openConglomerate(
                  ti.getHeapConglomerate(), false, 0,
                    TransactionController.MODE_RECORD,
                    TransactionController.ISOLATION_REPEATABLE_READ);
 
      scanController = tc.openScan(
          ti.getIndexConglomerate(indexId)// conglomerate to open
          false,                 // don't hold open across commit
          0,                                  // for read
                  TransactionController.MODE_RECORD,  // row locking
                    TransactionController.ISOLATION_REPEATABLE_READ,
          colToCheck,             // don't get any rows
          null,                 // start position - first row
          ScanController.GE,            // startSearchOperation
          qualifier,               // scanQualifier,
          null,                 // stop position - through last row
          ScanController.GT);           // stopSearchOperation
 
      foundRow = (scanController.next());
    }
    finally
    {
      if (scanController != null
      {
        scanController.close();
      }
      if (heapCC != null)
      {
        heapCC.close();
      }
    }
   
    return foundRow;
  }
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

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.