class AllocationCache
extends java.lang.Object
The allocation cache contains an array of AllocExtents and 3 arrays of longs:
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
Modifier and Type | Field and Description |
---|---|
private long[] |
extentPageNums |
private AllocExtent[] |
extents |
private long[] |
hiRange |
private boolean[] |
isDirty |
private boolean |
isValid |
private long[] |
lowRange |
private int |
numExtents |
Modifier | Constructor and Description |
---|---|
protected |
AllocationCache() |
Modifier and Type | Method and Description |
---|---|
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
|
private int numExtents
private long[] lowRange
private long[] hiRange
private boolean[] isDirty
private AllocExtent[] extents
private long[] extentPageNums
private boolean isValid
protected void reset()
protected long getAllocPageNumber(BaseContainerHandle handle, long pageNumber, long firstAllocPageNumber) throws StandardException
StandardException
protected long getLastPageNumber(BaseContainerHandle handle, long firstAllocPageNumber) throws StandardException
StandardException
protected void trackUnfilledPage(long pagenumber, boolean unfilled)
protected long getUnfilledPageNumber(BaseContainerHandle handle, long firstAllocPageNumber, long pagenum) throws StandardException
StandardException
protected long getEstimatedPageCount(BaseContainerHandle handle, long firstAllocPageNumber) throws StandardException
StandardException
protected SpaceInformation getAllPageCounts(BaseContainerHandle handle, long firstAllocPageNumber) throws StandardException
StandardException
protected void invalidate()
protected void invalidate(AllocPage allocPage, long allocPagenum) throws StandardException
StandardException
protected void invalidateLastExtent()
protected long getLastValidPage(BaseContainerHandle handle, long firstAllocPageNumber) throws StandardException
StandardException
protected long getNextValidPage(BaseContainerHandle handle, long pageNumber, long firstAllocPageNumber) throws StandardException
StandardException
protected int getPageStatus(BaseContainerHandle handle, long pageNumber, long firstAllocPageNumber) throws StandardException
StandardException
private void validate(BaseContainerHandle handle, long firstAllocPageNumber) throws StandardException
StandardException
private void setArrays(int i, AllocPage allocPage)
private void growArrays(int size)
protected void dumpAllocationCache()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.