Package org.apache.derby.iapi.store.raw

Examples of org.apache.derby.iapi.store.raw.RecordHandle


      throw StandardException.newException(
                    SQLState.DATA_UPDATE_DELETED_RECORD);
        }


    RecordHandle handle = getRecordHandleAtSlot(slot);

    RawTransaction t = owner.getTransaction();

    doUpdateAtSlot(t, slot, handle.getId(), row, validColumns);
   
    return handle;
  }
View Full Code Here


      throw StandardException.newException(
                    SQLState.DATA_UPDATE_DELETED_RECORD);
        }

    RawTransaction t = owner.getTransaction();
    RecordHandle handle = getRecordHandleAtSlot(slot);

    owner.getActionSet().actionUpdateField(t, this, slot,
        handle.getId(), fieldId, newValue, undo);

    return handle;
  }
View Full Code Here

    // logical operations not allowed in internal transactions.
    if (undo != null) {
      t.checkLogicalOperationOk();
    }

    RecordHandle handle = getRecordHandleAtSlot(slot);

    owner.getActionSet().actionDelete(t, this, slot, handle.getId(), delete, undo);
   
    // delete/undelete the record in the stored version
    // and in the in memory version performed by the PageActions item

    return handle;
View Full Code Here

    for (int i = 0; i < numpurges; i++)
    {
      recordIds[i] = getHeaderAtSlot(slot + i).getId();

      // get row lock on head row piece
      RecordHandle handle = getRecordHandleAtSlot(slot);
      owner.getLockingPolicy().lockRecordForWrite(t, handle, false, true);

      // Before we purge these rows, we need to make sure they don't have
      // overflow rows and columns.  Only clean up long rows and long
      // columns if this is not a temporary container, otherwise, just
      // loose the space.

      if (owner.isTemporaryContainer() ||  entireRecordOnPage(slot+i))
        continue;

      // row[slot+i] has overflow rows and/or long columns, reclaim
      // them in a loop.
      RecordHandle headRowHandle =
        getHeaderAtSlot(slot+i).getHandle(pageId, slot+i);
      purgeRowPieces(t, slot+i, headRowHandle, needDataLogged);
    }

    owner.getActionSet().actionPurge(t, this, slot, numpurges, recordIds, needDataLogged);
View Full Code Here

    RawTransaction t = owner.getTransaction();

    // lock the records to be purged and calculate total space needed
    for (int i = 0; i < num_rows; i++)
    {
      RecordHandle handle = getRecordHandleAtSlot(src_slot+i);
      owner.getLockingPolicy().lockRecordForWrite(t, handle, false, true);

      recordIds[i] = getHeaderAtSlot(src_slot + i).getId();
    }
View Full Code Here

      if (i == 0)
        recordIds[i] = newRecordId();
      else
        recordIds[i] = newRecordId(recordIds[i-1]);

      RecordHandle handle = new RecordId(pageId, recordIds[i], i);
      owner.getLockingPolicy().lockRecordForWrite(t, handle, false, true);
    }

    // RESOLVE: need try block here to invalidate self and crash the system
    owner.getActionSet().actionCopyRows(t, this, srcPage,
View Full Code Here

  protected boolean checkRowOrder(OpenBTree btree, ControlRow parent)
        throws StandardException
  {
        if (SanityManager.DEBUG)
        {
            RecordHandle            lesser_handle   = null;
            RecordHandle            greater_handle  = null;
            DataValueDescriptor[]   lesser          = getRowTemplate(btree);
            DataValueDescriptor[]   greater         = getRowTemplate(btree);
            boolean                 is_consistent   = true;
          
           
View Full Code Here

                right_sib.page.recordCount() > 1)
            {
                DataValueDescriptor[] left_lastrow   = getRowTemplate(btree);
                DataValueDescriptor[] right_firstrow = getRowTemplate(btree);

                RecordHandle    left_lastrow_handle   =
                    left_sib.page.fetchFromSlot(
                        (RecordHandle) null, left_sib.page.recordCount() - 1,
                        left_lastrow,
                        (FetchDescriptor) null, true);

                RecordHandle    right_firstrow_handle  =
                    right_sib.page.fetchFromSlot(
                        (RecordHandle) null, 1, right_firstrow,
                        (FetchDescriptor) null, true);

                int r =
View Full Code Here

                         "long column page has > 1 record");
                }

                // Hold on to the pointer to next page on the chain before
                // we remove the long column page.
                RecordHandle nextColumnPiece =
                    pageOnColumnChain.getNextColumnPiece(overflowSlotId);

                if (pageOnColumnChain.recordCount() == 1)
                {
                    removePageHappened = true;
                    owner.removePage(pageOnColumnChain);
                }
                else
                {
                    if (SanityManager.DEBUG)
                        SanityManager.THROWASSERT(
                          "page on column chain has more then one record" +
                          pageOnColumnChain.toString());

                    pageOnColumnChain.unlatch();
                    pageOnColumnChain = null;
                }

                // Chase the column chain pointer.
                if (nextColumnPiece != null)
                {
                    overflowPageId      = nextColumnPiece.getPageNumber();
                    overflowRecordId    = nextColumnPiece.getId();
                }
                else
                {
                    // terminate the loop
                    overflowPageId      = ContainerHandle.INVALID_PAGE_NUMBER;
View Full Code Here

            return;

        // Now get to the column in question and make sure it is no longer
        // pointing to the column chain.

        RecordHandle headRowHandle = work.getHeadRowHandle();

        if (SanityManager.DEBUG)
        {
            // System.out.println("Executing in removeOrphanedColumnChain.");
            // System.out.println("work =  " + work);
            // System.out.println("head = " + headOfChain);
            // System.out.println("this = " + this);

            SanityManager.ASSERT(isLatched());
            SanityManager.ASSERT(
                headRowHandle.getPageNumber() == getPageNumber(),
                "got wrong head page");
        }  

        // First get the row.
        int slot =
            findRecordById(
                headRowHandle.getId(), headRowHandle.getSlotNumberHint());

        // If slot < 0, it means the whole record is gone, the column chain is
        // definitely orphaned.

        if (slot >= 0)
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.store.raw.RecordHandle

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.