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

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


      return Serviceable.DONE;
    }

    // We are reclaiming row space or long column.  First get an xlock on the
    // head row piece.
    RecordHandle headRecord = work.getHeadRowHandle();

    if (!container_rlock.lockRecordForWrite(
                tran, headRecord, false /* not insert */, false /* nowait */))
    {
      // cannot get the row lock, retry
      tran.abort();
      if (work.incrAttempts() < 3)
        return Serviceable.REQUEUE;
      else
        return Serviceable.DONE;
    }

    // The exclusive lock on the head row has been gotten.

    if (work.reclaimWhat() == ReclaimSpace.ROW_RESERVE)
    {
      // This row may benefit from compaction.
      containerHdl.compactRecord(headRecord);

            // This work is being done - post commit, there is no user
            // transaction that depends on the commit being sync'd.  It is safe
            // to commitNoSync() This do as one of 2 things will happen:
            //
            //     1) if any data page associated with this transaction is
            //        moved from cache to disk, then the transaction log
            //        must be sync'd to the log record for that change and
            //        all log records including the commit of this xact must
            //        be sync'd before returning.
            //
            //     2) if the data page is never written then the log record
            //        for the commit may never be written, and the xact will
            //        never make to disk.  This is ok as no subsequent action
            //        depends on this operation being committed.
            //
      tran.commitNoSync(Transaction.RELEASE_LOCKS);

      return Serviceable.DONE;
    }
    else
    {
      if (SanityManager.DEBUG)
        SanityManager.ASSERT(work.reclaimWhat() == ReclaimSpace.COLUMN_CHAIN);

      // Reclaiming a long column chain due to update.  The long column
      // chain being reclaimed is the before image of the update
      // operation. 
      //
      long headPageId = ((PageKey)headRecord.getPageId()).getPageNumber();
      StoredPage headRowPage =
        (StoredPage)containerHdl.getPageNoWait(headPageId);

      if (headRowPage == null)
      {
View Full Code Here


          // page is not held.  We only need a zero duration lock on
          // the new page because the allocPage is latched and this
          // is the only thread which can be looking at this
          // pageNumber.

          RecordHandle deallocLock = BasePage.MakeRecordHandle(pkey,
                 RecordHandle.DEALLOCATE_PROTECTION_HANDLE);

          if (!getDeallocLock(allocHandle, deallocLock,
                    false /* nowait */,
                    true /* zeroDuration */))
 
View Full Code Here

                        SQLState.HEAP_IS_CLOSED,
                        open_conglom.getConglomerate().getId()));
            }
        }

    RecordHandle rh = doInsert(row);
        if (SanityManager.DEBUG)
        {
            SanityManager.ASSERT(
                templateRowLocation instanceof HeapRowLocation);
        }
View Full Code Here

    int             lock_operation,
    boolean         wait,
    int             lock_duration)
        throws StandardException
    {
        RecordHandle rh =
            ((HeapRowLocation) loc).getRecordHandle(
                open_conglom.getContainer());

        return(lockRow(rh, lock_operation, wait, lock_duration));
    }
View Full Code Here

    boolean         forUpdate,
    boolean         row_qualified)
        throws StandardException
    {

        RecordHandle rh =
            ((HeapRowLocation) loc).getRecordHandle(
                open_conglom.getContainer());

        open_conglom.getContainer().getLockingPolicy().
            unlockRecordAfterRead(
View Full Code Here

    int             lock_duration)
        throws StandardException
    {
        boolean ret_val;

        RecordHandle rh =
            open_conglom.getContainer().makeRecordHandle(page_num, record_id);

        return(lockRow(rh, lock_operation, wait, lock_duration));
    }
View Full Code Here

                            // exclusive lock on the row.  If it is marked
                            // deleted and we can get this lock, then it
                            // must be a committed delete and we can purge
                            // it.

                            RecordHandle rh =
                                page.fetchFromSlot(
                                    (RecordHandle) null,
                                    slot_no,
                                    RowUtil.EMPTY_ROW,
                                    RowUtil.EMPTY_ROW_FETCH_DESCRIPTOR,
View Full Code Here

            // the heap entry.
            control_row[0]       = new Heap();

            page = container.getPage(ContainerHandle.FIRST_PAGE_NUMBER);

            RecordHandle rh =
                page.fetchFromSlot(
                   (RecordHandle) null, 0, control_row,
                   (FetchDescriptor) null,
                   true);

            if (SanityManager.DEBUG)
            {
                SanityManager.ASSERT(rh != null);

                // for now the control row is always the first id assigned on
                // page 1.
                SanityManager.ASSERT(rh.getId() == 6);
            }
        }
        finally
        {
            if (page != null)
View Full Code Here

        throws StandardException
  {

        int                     ret_row_count     = 0;
        DataValueDescriptor[]   fetch_row         = null;
        RecordHandle            rh;

        if (max_rowcnt == -1)
            max_rowcnt = Long.MAX_VALUE;

View Full Code Here

                    // exclusive lock on the row.  If it is marked
                    // deleted and we can get this lock, then it
                    // must be a committed delete and we can purge
                    // it.

                    RecordHandle rh =
                        page.fetchFromSlot(
                            (RecordHandle) null,
                            slot_no,
                            RowUtil.EMPTY_ROW,
                            RowUtil.EMPTY_ROW_FETCH_DESCRIPTOR,
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.