Package org.apache.derby.impl.store.raw.data

Examples of org.apache.derby.impl.store.raw.data.BasePage


      if (nextNumber == ContainerHandle.INVALID_PAGE_NUMBER)
        return null;

      // optimistically go for the next page
      BasePage p = getUserPage(handle, nextNumber,
                false /* no overflow page*/, wait);
      if (p != null)
        return p;

      pageNumber = nextNumber;
View Full Code Here


     throws StandardException
  {
    if (pageNumber == ContainerHandle.INVALID_PAGE_NUMBER)
      return null;

    BasePage p = getUserPage(handle, pageNumber, overflowOK, wait);
    if (p != null)
    {
            // make sure the page is not too full
            if (!p.allowInsert())
            {
                p.unlatch();
                p = null;

                // it is too full, make sure we are tracking it so we won't
                // see it again.
                allocCache.trackUnfilledPage(pageNumber, false);
View Full Code Here

   */
  protected BasePage getPageForInsert(BaseContainerHandle handle,
                    int flag)
     throws StandardException
  {
    BasePage p = null;
    boolean getLastInserted = (flag & ContainerHandle.GET_PAGE_UNFILLED) == 0;

    if (getLastInserted)
    {
      // There is nothing protecting lastInsertePage from being changed
View Full Code Here

    throws StandardException {

    if (foundPage == null)
      return null;

    BasePage ret = super.latchPage(handle, foundPage, wait);
    if (ret == null) {
      // page is still cached
      pageCache.release((Cacheable) foundPage);
    }
    return ret;
View Full Code Here

    StoredRecordHeader recordHeader = getHeaderAtSlot(slot);

    if (!recordHeader.hasOverflow())
      return super.fetchNumFieldsAtSlot(slot);

    BasePage overflowPage = getOverflowPage(recordHeader.getOverflowPage());
    int count = overflowPage.fetchNumFieldsAtSlot(getOverflowSlot(overflowPage, recordHeader));
    overflowPage.unlatch();
    return count;
  }
View Full Code Here

    FormatableBitSet                 validColumns,
    StoredRecordHeader      recordHeader)
    throws StandardException
  {

    BasePage overflowPage = getOverflowPage(recordHeader.getOverflowPage());

    try {

      int overflowSlot = getOverflowSlot(overflowPage, recordHeader);

      overflowPage.doUpdateAtSlot(t, overflowSlot, recordHeader.getOverflowId(), row, validColumns);
      overflowPage.unlatch();
      overflowPage = null;

      return;

    } finally {
      if (overflowPage != null) {
        overflowPage.unlatch();
        overflowPage = null;
      }
    }
  }
View Full Code Here

                    // 0 this will automatically handle any overflows in
          // this new portion

          // BasePage op = getNewOverflowPage();

                    BasePage op =
                        curPage.getOverflowPageForInsert(
                            slot,
                            newRow,
                            newColumnList,
                            nextColumn);

          // We have all the information from this page so unlatch it
          if (curPage != this)
                    {
            curPage.unlatch();
            curPage = null;
          }

          byte mode = Page.INSERT_OVERFLOW;
          if (nextPage != 0)
            mode |= Page.INSERT_FOR_SPLIT;

          RecordHandle nextPortionHandle =
            nextPage == 0 ? null :
            owner.makeRecordHandle(nextPage, id);

          // RESOLVED (sku):  even though we would like to roll back
                    // these inserts with PURGE rather than with delete,
                    // we have to delete because if we purge the last row
          // from an overflow page, the purge will queue a post
                    // commit to remove the page.
          // While this is OK with long columns, we cannot do this
                    // for long rows because long row overflow pages can be
                    // shared by more than one long rows, and thus it is unsafe
          // to remove the page without first latching the head page.
                    // However, the insert log record do not have the head
                    // row's page number so the rollback cannot put that
          // information into the post commit work.
          RecordHandle portionHandle =
            op.insertAllowOverflow(
                            0, newRow, newColumnList, nextColumn, mode, 100,
                            nextPortionHandle);

          // Update the previous record header to point to new portion
          if (curPage == this)
            updateOverflowDetails(this, handle, portionHandle);
          else
            updateOverflowDetails(handle, portionHandle);
          op.unlatch();
        }
                else
                {

          // See earlier comments on checking row reserved space.
View Full Code Here

     throws StandardException
  {
    // findpage will have the page latched.
    // CompensationOperation.doMe must call this.releaseResource the page
    // when it is done
    BasePage undoPage = findpage(xact);

    // Needs to pre-dirty this page so that if a checkpoint is taken any
    // time after the CLR is sent to the log stream, it will wait for the
    // actual undo to happen on the page.  We need this to preserve the
    // integrity of the redoLWM.
    undoPage.preDirty();

    return new PhysicalUndoOperation(undoPage, this);
  }
View Full Code Here

     throws StandardException, IOException
  {
    // if logical undo is not necessary, use normal physical undo
    if (undo == null)
    {
      BasePage undoPage = findpage(xact);

      // Needs to pre-dirty this page so that if a checkpoint is taken
      // any time after the CLR is sent to the log stream, it will wait
      // for the actual undo to happen on the page.  We need this to
      // preserve the integrity of the redoLWM.
      undoPage.preDirty();

      return new LogicalUndoOperation(undoPage, recordId, this);
    }
    else
    {
      if (SanityManager.DEBUG)
      {
        // Sanity check to make sure logical undo is not called inside
        // internal transaction
        RawTransaction rtran = (RawTransaction)xact;
        rtran.checkLogicalOperationOk();
      }

      BasePage logicalUndoPage = findLogicalPage(xact, undo, in);

      // Needs to pre-dirty this page so that if a checkpoint is taken
      // any time after the CLR is sent to the log stream, it will wait
      // for the actual undo to happen on the page.  We need this to
      // preserve the integrity of the redoLWM.
      logicalUndoPage.preDirty();

      // find logical page is going to call undo.findUndo to find the
      // right page to apply the CLR to.  If the record has changed,
      // logicalUndo should have resetRecordHandle to reset the page
      // number and the recordId to the new record location.  We need to
View Full Code Here

     throws StandardException, IOException
  {
    // if logical undo is not necessary, use normal physical undo
    if (undo == null)
    {
      BasePage undoPage = findpage(xact);

      // Needs to pre-dirty this page so that if a checkpoint is taken
      // any time after the CLR is sent to the log stream, it will wait
      // for the actual undo to happen on the page.  We need this to
      // preserve the integrity of the redoLWM.
      undoPage.preDirty();

      return new LogicalUndoOperation(undoPage, recordId, this);
    }
    else
    {
      if (SanityManager.DEBUG)
      {
        // Sanity check to make sure logical undo is not called inside
        // internal transaction
        RawTransaction rtran = (RawTransaction)xact;
        rtran.checkLogicalOperationOk();
      }

      BasePage logicalUndoPage = findLogicalPage(xact, undo, in);

      // Needs to pre-dirty this page so that if a checkpoint is taken
      // any time after the CLR is sent to the log stream, it will wait
      // for the actual undo to happen on the page.  We need this to
      // preserve the integrity of the redoLWM.
      logicalUndoPage.preDirty();

      // find logical page is going to call undo.findUndo to find the
      // right page to apply the CLR to.  If the record has changed,
      // logicalUndo should have resetRecordHandle to reset the page
      // number and the recordId to the new record location.  We need to
View Full Code Here

TOP

Related Classes of org.apache.derby.impl.store.raw.data.BasePage

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.