|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> store >> raw >> [ data overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.impl.store.raw.data
Class AllocationCache

java.lang.Objectorg.apache.derby.impl.store.raw.data.AllocationCache
- class AllocationCache
- extends java.lang.Object
An auxiliary object to cache the allocation information for a file container. Only a FileContainer should use this object
The allocation cache contains an array of AllocExtents and 3 arrays of longs:
- ExtentPageNums[i] is the page number of the i'th extent
- lowRange[i] is the smallest page number managed by extent i
- hiRange[i] is the largest page number managed by extent i
Note thate extentPageNums and lowRange does not change once the extent has been created, but hiRange will change for the last extent as more pages are allocated.
Extents can be individually invalidated or the entire cache (all extends) can be invalidated at once.
MT - unsafe Synrhonized access to all methods must be enforced by the caller of AllocationCache
| Field Summary | |
private long[] |
extentPageNums
|
private AllocExtent[] |
extents
|
private long[] |
hiRange
|
private boolean[] |
isDirty
|
private boolean |
isValid
|
private long[] |
lowRange
|
private int |
numExtents
|
| Constructor Summary | |
protected |
AllocationCache()
|
| Method Summary | |
protected void |
dumpAllocationCache()
dump the allocation cache information |
protected long |
getAllocPageNumber(BaseContainerHandle handle,
long pageNumber,
long firstAllocPageNumber)
Get the page number for the allocation page that is managing this page number |
protected SpaceInformation |
getAllPageCounts(BaseContainerHandle handle,
long firstAllocPageNumber)
|
protected long |
getEstimatedPageCount(BaseContainerHandle handle,
long firstAllocPageNumber)
returns estimated number of allocated pages |
protected long |
getLastPageNumber(BaseContainerHandle handle,
long firstAllocPageNumber)
Get the last (allocated) page of the container |
protected long |
getLastValidPage(BaseContainerHandle handle,
long firstAllocPageNumber)
Get the last valid page of the file container. |
protected long |
getNextValidPage(BaseContainerHandle handle,
long pageNumber,
long firstAllocPageNumber)
|
protected int |
getPageStatus(BaseContainerHandle handle,
long pageNumber,
long firstAllocPageNumber)
Get the page status of a page |
protected long |
getUnfilledPageNumber(BaseContainerHandle handle,
long firstAllocPageNumber,
long pagenum)
|
private void |
growArrays(int size)
|
protected void |
invalidate()
|
protected void |
invalidate(AllocPage allocPage,
long allocPagenum)
|
protected void |
invalidateLastExtent()
|
protected void |
reset()
|
private void |
setArrays(int i,
AllocPage allocPage)
|
protected void |
trackUnfilledPage(long pagenumber,
boolean unfilled)
Set the page number to be unfilled |
private void |
validate(BaseContainerHandle handle,
long firstAllocPageNumber)
Validate the cache, find all alloc pages and fill in the arrays |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
numExtents
private int numExtents
lowRange
private long[] lowRange
hiRange
private long[] hiRange
isDirty
private boolean[] isDirty
extents
private AllocExtent[] extents
extentPageNums
private long[] extentPageNums
isValid
private boolean isValid
| Constructor Detail |
AllocationCache
protected AllocationCache()
| Method Detail |
reset
protected void reset()
getAllocPageNumber
protected long getAllocPageNumber(BaseContainerHandle handle, long pageNumber, long firstAllocPageNumber) throws org.apache.derby.iapi.error.StandardException
- Get the page number for the allocation page that is managing this page number
getLastPageNumber
protected long getLastPageNumber(BaseContainerHandle handle, long firstAllocPageNumber) throws org.apache.derby.iapi.error.StandardException
- Get the last (allocated) page of the container
trackUnfilledPage
protected void trackUnfilledPage(long pagenumber,
boolean unfilled)
- Set the page number to be unfilled
getUnfilledPageNumber
protected long getUnfilledPageNumber(BaseContainerHandle handle, long firstAllocPageNumber, long pagenum) throws org.apache.derby.iapi.error.StandardException
getEstimatedPageCount
protected long getEstimatedPageCount(BaseContainerHandle handle, long firstAllocPageNumber) throws org.apache.derby.iapi.error.StandardException
- returns estimated number of allocated pages
getAllPageCounts
protected SpaceInformation getAllPageCounts(BaseContainerHandle handle, long firstAllocPageNumber) throws org.apache.derby.iapi.error.StandardException
invalidate
protected void invalidate()
invalidate
protected void invalidate(AllocPage allocPage, long allocPagenum) throws org.apache.derby.iapi.error.StandardException
invalidateLastExtent
protected void invalidateLastExtent()
getLastValidPage
protected long getLastValidPage(BaseContainerHandle handle, long firstAllocPageNumber) throws org.apache.derby.iapi.error.StandardException
- Get the last valid page of the file container. A valid page is one that
is not deallocated or freed.
getNextValidPage
protected long getNextValidPage(BaseContainerHandle handle, long pageNumber, long firstAllocPageNumber) throws org.apache.derby.iapi.error.StandardException
getPageStatus
protected int getPageStatus(BaseContainerHandle handle, long pageNumber, long firstAllocPageNumber) throws org.apache.derby.iapi.error.StandardException
- Get the page status of a page
validate
private void validate(BaseContainerHandle handle, long firstAllocPageNumber) throws org.apache.derby.iapi.error.StandardException
- Validate the cache, find all alloc pages and fill in the arrays
setArrays
private void setArrays(int i,
AllocPage allocPage)
growArrays
private void growArrays(int size)
dumpAllocationCache
protected void dumpAllocationCache()
- dump the allocation cache information
|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> store >> raw >> [ data overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.derby.impl.store.raw.data.AllocationCache