Interface PageManager
- All Superinterfaces:
BlockSource
- All Known Implementing Classes:
PageManagerForByteBuffer, PageManagerForFileChannel, PageManagerOverDataStreamSource, PageManagerWrapper
A PageSource (TODO change to that naming) is a special kind of BlockSource where all blocks have the same size
and there is a 1:1 correspondance between a pages and non-overlapping regions in the underlying buffer.
Consecutive page ids do not necessarily have to refer to consecutive regions.
- Author:
- raven
-
Method Summary
Modifier and TypeMethodDescriptioncontentAtOrAfter(long pos, boolean inclusive) contentAtOrBefore(long pos, boolean inclusive) longThe maximum position in the underlying bufferintThe pageSize.default longgetSizeOfBlock(long pos) Return the size of the block; all but the last block are guaranteed to have the same sizedefault booleanhasBlockAfter(long pos) default booleanhasBlockBefore(long pos) requestBufferForPage(long page) default longsize()Retrieve the number of available pages
-
Method Details
-
requestBufferForPage
-
getPageSize
int getPageSize()The pageSize. Must never change during the life time of a page manager.- Returns:
-
getEndPos
long getEndPos()The maximum position in the underlying buffer- Returns:
-
size
default long size()Retrieve the number of available pages- Specified by:
sizein interfaceBlockSource- Returns:
-
contentAtOrBefore
- Specified by:
contentAtOrBeforein interfaceBlockSource- Throws:
IOException
-
contentAtOrAfter
- Specified by:
contentAtOrAfterin interfaceBlockSource- Throws:
IOException
-
hasBlockAfter
- Specified by:
hasBlockAfterin interfaceBlockSource- Throws:
IOException
-
hasBlockBefore
- Specified by:
hasBlockBeforein interfaceBlockSource- Throws:
IOException
-
getSizeOfBlock
Return the size of the block; all but the last block are guaranteed to have the same size- Specified by:
getSizeOfBlockin interfaceBlockSource- Throws:
IOException
-