public interface PageStore
| Modifier and Type | Method and Description |
|---|---|
long |
allocatePage()
Allocates next page index.
|
void |
beginRecover()
Starts recover process.
|
void |
ensure() |
boolean |
exists()
Checks if page exists.
|
void |
finishRecover()
Ends recover process.
|
int |
getBlockSize() |
int |
getPageSize() |
long |
getSparseSize() |
long |
pageOffset(long pageId)
Gets page offset within the store file.
|
int |
pages()
Gets number of allocated pages.
|
void |
punchHole(long pageId,
int usefulBytes)
Should free all the extra storage space after the given number of useful bytes in the given page.
|
void |
read(long pageId,
ByteBuffer pageBuf,
boolean keepCrc)
Reads a page.
|
void |
readHeader(ByteBuffer buf)
Reads a header.
|
long |
size() |
void |
stop(boolean cleanFile) |
void |
sync()
Sync method used to ensure that the given pages are guaranteed to be written to the store.
|
void |
truncate(int tag)
Truncates and deletes partition file.
|
int |
version() |
void |
write(long pageId,
ByteBuffer pageBuf,
int tag,
boolean calculateCrc)
Writes a page.
|
boolean exists()
True if page exists.long allocatePage()
throws IgniteCheckedException
IgniteCheckedException - If failed to allocate.int pages()
void read(long pageId,
ByteBuffer pageBuf,
boolean keepCrc)
throws IgniteCheckedException
pageId - Page ID.pageBuf - Page buffer to read into.keepCrc - by default reading zeroes CRC which was on file, but you can keep it in pageBuf if set keepCrcIgniteCheckedException - If reading failed (IO error occurred).void readHeader(ByteBuffer buf) throws IgniteCheckedException
buf - Buffer to write to.IgniteCheckedException - If failed.void write(long pageId,
ByteBuffer pageBuf,
int tag,
boolean calculateCrc)
throws IgniteCheckedException
pageId - Page ID.pageBuf - Page buffer to write.tag - Partition file version, 1-based incrementing counter. For outdated pages tag has lower value,
and write does nothing.calculateCrc - if False crc calculation will be forcibly skipped.IgniteCheckedException - If page writing failed (IO error occurred).long pageOffset(long pageId)
pageId - Page ID.void sync() throws IgniteCheckedException
IgniteCheckedException - If sync failed (IO error occurred).void ensure()
throws IgniteCheckedException
IgniteCheckedException - If sync failed (IO error occurred).int version()
void stop(boolean cleanFile) throws StorageException
cleanFile - True to delete file.StorageException - If failed.void beginRecover()
void finishRecover()
throws StorageException
StorageException - If failed.void truncate(int tag)
throws StorageException
tag - New partition tag.StorageException - If failed.int getPageSize()
int getBlockSize()
long size()
pages() * getPageSize()
due to delayed writes or due to other implementation specific details.long getSparseSize()
size().punchHole(long, int)void punchHole(long pageId,
int usefulBytes)
pageId - Page id.usefulBytes - Number of meaningful bytes from the beginning of the page.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.1 Release Date : May 21 2020