Class PageReadWriteManagerImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.pagemem.PageReadWriteManagerImpl
-
- All Implemented Interfaces:
PageReadWriteManager
- Direct Known Subclasses:
DefragmentationPageReadWriteManager
public class PageReadWriteManagerImpl extends Object implements PageReadWriteManager
-
-
Field Summary
Fields Modifier and Type Field Description protected PageStoreCollectionpageStores
-
Constructor Summary
Constructors Constructor Description PageReadWriteManagerImpl(GridKernalContext ctx, PageStoreCollection pageStores, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longallocatePage(int grpId, int partId, byte flags)Allocates a page for the given page space.voidread(int grpId, long pageId, ByteBuffer pageBuf, boolean keepCrc)Reads a page for the given cache ID.StringtoString()PageStorewrite(int grpId, long pageId, ByteBuffer pageBuf, int tag, boolean calculateCrc)Writes the page for the given cache ID.
-
-
-
Field Detail
-
pageStores
@GridToStringExclude protected final PageStoreCollection pageStores
-
-
Constructor Detail
-
PageReadWriteManagerImpl
public PageReadWriteManagerImpl(GridKernalContext ctx, PageStoreCollection pageStores, String name)
- Parameters:
ctx- Kernal context.pageStores- Page stores.
-
-
Method Detail
-
read
public void read(int grpId, long pageId, ByteBuffer pageBuf, boolean keepCrc) throws IgniteCheckedExceptionReads a page for the given cache ID. Cache ID may be0if the page is a meta page.- Specified by:
readin interfacePageReadWriteManager- Parameters:
grpId- Cache group ID.pageId- PageID to read.pageBuf- Page buffer to write to.keepCrc- Keep CRC flag.- Throws:
IgniteCheckedException- If failed to read the page.
-
write
public PageStore write(int grpId, long pageId, ByteBuffer pageBuf, int tag, boolean calculateCrc) throws IgniteCheckedException
Writes the page for the given cache ID. Cache ID may be0if the page is a meta page.- Specified by:
writein interfacePageReadWriteManager- Parameters:
grpId- Cache group ID.pageId- Page ID.pageBuf- Page buffer to write.- Throws:
IgniteCheckedException- If failed to write page.
-
allocatePage
public long allocatePage(int grpId, int partId, byte flags) throws IgniteCheckedExceptionAllocates a page for the given page space.- Specified by:
allocatePagein interfacePageReadWriteManager- Parameters:
grpId- Cache group ID.partId- Partition ID. Used only ifflagsis equal toPageIdAllocator.FLAG_DATA.flags- Page allocation flags.- Returns:
- Allocated page ID.
- Throws:
IgniteCheckedException- If IO exception occurred while allocating a page ID.
-
-