Class DelayedDirtyPageStoreWrite
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.pagemem.DelayedDirtyPageStoreWrite
-
- All Implemented Interfaces:
PageStoreWriter
public class DelayedDirtyPageStoreWrite extends Object implements PageStoreWriter
Not thread safe and stateful class for page replacement of one page with write() delay. This allows to write page content without holding segment lock. Page data is copied into temp buffer duringwritePage(FullPageId, ByteBuffer, int)and then sent to real implementation byfinishReplacement().
-
-
Constructor Summary
Constructors Constructor Description DelayedDirtyPageStoreWrite(PageStoreWriter flushDirtyPage, ThreadLocal<ByteBuffer> byteBufThreadLoc, int pageSize, DelayedPageReplacementTracker tracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinishReplacement()Runs actual write if required.voidwritePage(FullPageId fullPageId, ByteBuffer byteBuf, int tag)Callback for write page.
-
-
-
Constructor Detail
-
DelayedDirtyPageStoreWrite
public DelayedDirtyPageStoreWrite(PageStoreWriter flushDirtyPage, ThreadLocal<ByteBuffer> byteBufThreadLoc, int pageSize, DelayedPageReplacementTracker tracker)
- Parameters:
flushDirtyPage- real writer to save page to store.byteBufThreadLoc- thread local buffers to use for pages copying.pageSize- page size.tracker- tracker to lock/unlock page reads.
-
-
Method Detail
-
writePage
public void writePage(FullPageId fullPageId, ByteBuffer byteBuf, int tag)
Callback for write page.PageMemoryExwill copy page content to buffer before call.- Specified by:
writePagein interfacePageStoreWriter- Parameters:
fullPageId- Page ID to get byte buffer for. The page ID must be present in the collection returned by thePageMemoryEx.beginCheckpoint(IgniteInternalFuture)method call.byteBuf- Temporary buffer to write changes into.tag-Partition generationif data was read,nullotherwise (data already saved to storage).
-
finishReplacement
public void finishReplacement() throws IgniteCheckedExceptionRuns actual write if required. Method is 'no op' if there was no page selected for replacement.- Throws:
IgniteCheckedException- if write failed.
-
-