Interface Page
- All Superinterfaces:
AutoCloseable, Block, org.aksw.commons.io.util.channel.ChannelFactory<Seekable>, Segment
- All Known Implementing Classes:
PageBase
A page is a fixed size sequence of bytes obtained from a page manager backed by a ByteBuffer.
Only the last page may have a smaller size than the others.
A page does not provide its own release mechanism.
Instead, the page manager returns a
Reference<Page>.
A page is only released iff all its references are released, hence any release action
is associated with the reference. Usually the release action is performed immediately
by the thread that releases the last reference.- Author:
- raven
-
Method Summary
Modifier and TypeMethodDescriptionlongOffset in a parent container; should be 0 if there is nonedefault booleanhasNext()Check if there is a subsequent block.default booleanhasPrev()default longlength()Retrieve the length of the segment For segments that are based on encoded data this method may trigger a full read.Return a byte buffer for the page with freshly initialized positioning i.e.default SeekableThe block source of this block - if any.Methods inherited from interface AutoCloseable
close
-
Method Details
-
getOffset
-
getPageManager
PageManager getPageManager() -
newBuffer
ByteBuffer newBuffer()Return a byte buffer for the page with freshly initialized positioning i.e. the returned byte buffer should be created using originalBuffer.duplicate()- Returns:
-
prevBlock
- Specified by:
prevBlockin interfaceBlock- Throws:
IOException
-
nextBlock
Description copied from interface:BlockThe block source of this block - if any.- Specified by:
nextBlockin interfaceBlock- Returns:
- the block source or null if there is none
- Throws:
IOException
-
hasNext
Check if there is a subsequent block.- Specified by:
hasNextin interfaceBlock- Returns:
- Throws:
IOException
-
hasPrev
- Specified by:
hasPrevin interfaceBlock- Throws:
IOException
-
length
Description copied from interface:SegmentRetrieve the length of the segment For segments that are based on encoded data this method may trigger a full read. Therefore, this method should be used with care.- Specified by:
lengthin interfaceSegment- Returns:
- Throws:
IOException
-
newChannel
-