public class PageManagerForFileChannel extends Object implements PageManager
| Modifier and Type | Field and Description |
|---|---|
protected FileChannel |
channel |
protected long |
channelSize
We rely on the channel's size being constant.
|
protected com.google.common.cache.Cache<Long,Reference<Page>> |
pageCache
The cache is crucial to the implementation.
|
protected int |
pageSize |
| Constructor and Description |
|---|
PageManagerForFileChannel(FileChannel channel,
long channelSize,
int pageSize) |
| Modifier and Type | Method and Description |
|---|---|
static PageManagerForFileChannel |
create(FileChannel channel) |
static PageManagerForFileChannel |
create(FileChannel channel,
int pageSize) |
long |
getEndPos() |
int |
getPageSize()
The pageSize.
|
Reference<Page> |
getRefForPage(long page) |
Reference<Page> |
requestBufferForPage(long page) |
protected com.google.common.cache.Cache<Long,Reference<Page>> pageCache
protected FileChannel channel
protected long channelSize
protected int pageSize
public PageManagerForFileChannel(FileChannel channel, long channelSize, int pageSize)
public static PageManagerForFileChannel create(FileChannel channel) throws IOException
IOExceptionpublic static PageManagerForFileChannel create(FileChannel channel, int pageSize) throws IOException
IOExceptionpublic int getPageSize()
PageManagergetPageSize in interface PageManagerpublic Reference<Page> requestBufferForPage(long page)
requestBufferForPage in interface PageManagerpublic long getEndPos()
getEndPos in interface PageManagerpublic Reference<Page> getRefForPage(long page) throws IOException
IOExceptionCopyright © 2020. All rights reserved.