| Modifier and Type | Field and Description |
|---|---|
static int |
HEADER_SIZE
Allocated field offset.
|
| Constructor and Description |
|---|
FilePageStore(byte type,
File file,
FileIOFactory factory,
MemoryConfiguration cfg) |
| Modifier and Type | Method and Description |
|---|---|
long |
allocatePage()
Allocates next page index.
|
void |
beginRecover() |
void |
ensure() |
boolean |
exists()
Checks if page exists.
|
void |
finishRecover() |
static ByteBuffer |
header(byte type,
int pageSize) |
long |
pageOffset(long pageId)
Gets page offset within the store file.
|
int |
pages()
Gets number of allocated pages.
|
void |
read(long pageId,
ByteBuffer pageBuf,
boolean keepCrc)
Reads a page.
|
void |
readHeader(ByteBuffer buf)
Reads a header.
|
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) |
void |
write(long pageId,
ByteBuffer pageBuf,
int tag)
Writes a page.
|
public static final int HEADER_SIZE
public FilePageStore(byte type,
File file,
FileIOFactory factory,
MemoryConfiguration cfg)
file - File.public boolean exists()
public static ByteBuffer header(byte type, int pageSize)
type - Type.pageSize - Page size.public void stop(boolean cleanFile)
throws IgniteCheckedException
cleanFile - True to delete file.IgniteCheckedException - If failed.public void truncate(int tag)
throws IgniteCheckedException
IgniteCheckedExceptionpublic void beginRecover()
public void finishRecover()
public void read(long pageId,
ByteBuffer pageBuf,
boolean keepCrc)
throws IgniteCheckedException
read in interface PageStorepageId - 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).public void readHeader(ByteBuffer buf) throws IgniteCheckedException
readHeader in interface PageStorebuf - Buffer to write to.IgniteCheckedException - If failed.public void write(long pageId,
ByteBuffer pageBuf,
int tag)
throws IgniteCheckedException
write in interface PageStorepageId - 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 nothingIgniteCheckedException - If page writing failed (IO error occurred).public long pageOffset(long pageId)
pageOffset in interface PageStorepageId - Page ID.public void sync()
throws IgniteCheckedException
sync in interface PageStoreIgniteCheckedException - If sync failed (IO error occurred).public void ensure()
throws IgniteCheckedException
ensure in interface PageStoreIgniteCheckedException - If sync failed (IO error occurred).public long allocatePage()
throws IgniteCheckedException
allocatePage in interface PageStoreIgniteCheckedException - If failed to allocate.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.1.0 Release Date : July 20 2017