DelegatingSegment.cpp

Go to the documentation of this file.
00001 /*
00002 // $Id: //open/dev/fennel/segment/DelegatingSegment.cpp#12 $
00003 // Fennel is a library of data storage and processing components.
00004 // Copyright (C) 2005-2009 The Eigenbase Project
00005 // Copyright (C) 2005-2009 SQLstream, Inc.
00006 // Copyright (C) 2005-2009 LucidEra, Inc.
00007 // Portions Copyright (C) 1999-2009 John V. Sichi
00008 //
00009 // This program is free software; you can redistribute it and/or modify it
00010 // under the terms of the GNU General Public License as published by the Free
00011 // Software Foundation; either version 2 of the License, or (at your option)
00012 // any later version approved by The Eigenbase Project.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with this program; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 #include "fennel/common/CommonPreamble.h"
00025 #include "fennel/segment/DelegatingSegment.h"
00026 
00027 FENNEL_BEGIN_CPPFILE("$Id: //open/dev/fennel/segment/DelegatingSegment.cpp#12 $");
00028 
00029 DelegatingSegment::DelegatingSegment(
00030     SharedSegment pDelegateSegmentInit)
00031     : Segment(pDelegateSegmentInit->getCache()),
00032       pDelegateSegment(pDelegateSegmentInit)
00033 {
00034     setUsablePageSize(pDelegateSegment->getUsablePageSize());
00035 }
00036 
00037 DelegatingSegment::~DelegatingSegment()
00038 {
00039 }
00040 
00041 void DelegatingSegment::closeImpl()
00042 {
00043     Segment::closeImpl();
00044     pDelegateSegment.reset();
00045 }
00046 
00047 BlockNum DelegatingSegment::getAllocatedSizeInPages()
00048 {
00049     return pDelegateSegment->getAllocatedSizeInPages();
00050 }
00051 
00052 BlockNum DelegatingSegment::getNumPagesOccupiedHighWater()
00053 {
00054     return pDelegateSegment->getNumPagesOccupiedHighWater();
00055 }
00056 
00057 BlockNum DelegatingSegment::getNumPagesExtended()
00058 {
00059     return pDelegateSegment->getNumPagesExtended();
00060 }
00061 
00062 PageId DelegatingSegment::getPageSuccessor(PageId pageId)
00063 {
00064     return pDelegateSegment->getPageSuccessor(pageId);
00065 }
00066 
00067 void DelegatingSegment::setPageSuccessor(PageId pageId, PageId successorId)
00068 {
00069     pDelegateSegment->setPageSuccessor(pageId,successorId);
00070 }
00071 
00072 BlockId DelegatingSegment::translatePageId(PageId pageId)
00073 {
00074     return pDelegateSegment->translatePageId(pageId);
00075 }
00076 
00077 PageId DelegatingSegment::translateBlockId(BlockId blockId)
00078 {
00079     return pDelegateSegment->translateBlockId(blockId);
00080 }
00081 
00082 PageId DelegatingSegment::allocatePageId(PageOwnerId ownerId)
00083 {
00084     return pDelegateSegment->allocatePageId(ownerId);
00085 }
00086 
00087 bool DelegatingSegment::ensureAllocatedSize(BlockNum nPages)
00088 {
00089     return pDelegateSegment->ensureAllocatedSize(nPages);
00090 }
00091 
00092 void DelegatingSegment::deallocatePageRange(PageId startPageId,PageId endPageId)
00093 {
00094     pDelegateSegment->deallocatePageRange(startPageId,endPageId);
00095 }
00096 
00097 bool DelegatingSegment::isPageIdAllocated(PageId pageId)
00098 {
00099     return pDelegateSegment->isPageIdAllocated(pageId);
00100 }
00101 
00102 Segment::AllocationOrder DelegatingSegment::getAllocationOrder() const
00103 {
00104     return pDelegateSegment->getAllocationOrder();
00105 }
00106 
00107 void DelegatingSegment::notifyPageMap(CachePage &page)
00108 {
00109     pDelegateSegment->notifyPageMap(page);
00110 }
00111 
00112 void DelegatingSegment::notifyPageUnmap(CachePage &page)
00113 {
00114     pDelegateSegment->notifyPageUnmap(page);
00115 }
00116 
00117 void DelegatingSegment::notifyAfterPageRead(CachePage &page)
00118 {
00119     pDelegateSegment->notifyAfterPageRead(page);
00120 }
00121 
00122 void DelegatingSegment::notifyPageDirty(CachePage &page,bool bDataValid)
00123 {
00124     pDelegateSegment->notifyPageDirty(page,bDataValid);
00125 }
00126 
00127 void DelegatingSegment::notifyBeforePageFlush(CachePage &page)
00128 {
00129     pDelegateSegment->notifyBeforePageFlush(page);
00130 }
00131 
00132 void DelegatingSegment::notifyAfterPageFlush(CachePage &page)
00133 {
00134     pDelegateSegment->notifyAfterPageFlush(page);
00135 }
00136 
00137 bool DelegatingSegment::canFlushPage(CachePage &page)
00138 {
00139     return pDelegateSegment->canFlushPage(page);
00140 }
00141 
00142 void DelegatingSegment::delegatedCheckpoint(
00143     Segment &delegatingSegment,CheckpointType checkpointType)
00144 {
00145     pDelegateSegment->delegatedCheckpoint(delegatingSegment,checkpointType);
00146 }
00147 
00148 PageId DelegatingSegment::updatePage(PageId pageId, bool needsTranslation)
00149 {
00150     return pDelegateSegment->updatePage(pageId, needsTranslation);
00151 }
00152 
00153 FENNEL_END_CPPFILE("$Id: //open/dev/fennel/segment/DelegatingSegment.cpp#12 $");
00154 
00155 // End DelegatingSegment.cpp

Generated on Mon Jun 22 04:00:20 2009 for Fennel by  doxygen 1.5.1