public class MappedPageSource extends Object implements PageSource
| Constructor and Description |
|---|
MappedPageSource(File file) |
MappedPageSource(File file,
boolean truncate) |
MappedPageSource(File file,
boolean truncate,
long size) |
MappedPageSource(File file,
long size) |
| Modifier and Type | Method and Description |
|---|---|
MappedPage |
allocate(int size,
boolean thief,
boolean victim,
OffHeapStorageArea owner)
Attempt to allocate a page of the given size.
|
Long |
allocateRegion(long size) |
MappedPage |
claimPage(long address,
long size) |
long |
claimRegion(long address,
long size) |
void |
close() |
void |
flush() |
void |
free(Page page) |
void |
freeRegion(long address) |
long |
getAddress(Page underlying) |
File |
getFile() |
FileChannel |
getReadableChannel() |
FileChannel |
getWritableChannel() |
public MappedPageSource(File file) throws IOException
IOExceptionpublic MappedPageSource(File file, long size) throws IOException
IOExceptionpublic MappedPageSource(File file, boolean truncate) throws IOException
IOExceptionpublic MappedPageSource(File file, boolean truncate, long size) throws IOException
IOExceptionpublic Long allocateRegion(long size)
public void freeRegion(long address)
public long claimRegion(long address,
long size)
public FileChannel getReadableChannel()
public FileChannel getWritableChannel()
public File getFile()
public MappedPage allocate(int size, boolean thief, boolean victim, OffHeapStorageArea owner)
PageSource
Allocations identified as thieves will if necessary 'steal' space from
previous allocations identified as 'victims' in order to fulfill the
allocation request. owner is the area from which the
returned page can subsequently be stolen or recovered. This is most likely
to be the calling instance.
allocate in interface PageSourcesize - size of page to allocatethief - true if the allocation can steal space from victimsvictim - true if the allocated page should be eligible for stealingowner - owner from which subsequent steal should occurnull in the case of failurepublic void free(Page page)
free in interface PageSourcepublic MappedPage claimPage(long address, long size) throws IOException
IOExceptionpublic long getAddress(Page underlying)
public void flush()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2015–2024. All rights reserved.