Interface PageMemoryEx

    • Method Detail

      • readLock

        long readLock​(long absPtr,
                      long pageId,
                      boolean force,
                      boolean touch)
        Parameters:
        absPtr - Absolute pointer to read lock.
        pageId - Page ID.
        force - Force flag.
        touch - Update page timestamp.
        Returns:
        Pointer to the page read buffer.
      • writeLock

        long writeLock​(int grpId,
                       long pageId,
                       long page,
                       boolean restore)
        Parameters:
        grpId - Group ID.
        pageId - Page ID.
        page - Page pointer.
        restore - Determines if the page is locked for restore memory (crash recovery).
        Returns:
        ByteBuffer for modifying the page.
      • writeUnlock

        void writeUnlock​(int grpId,
                         long pageId,
                         long page,
                         Boolean walPlc,
                         boolean dirtyFlag,
                         boolean restore)
        Parameters:
        grpId - Group ID.
        pageId - Page ID.
        page - Page pointer.
        walPlc - True if page should be recorded to WAL, false if the page must not be recorded and null for the default behavior.
        dirtyFlag - Determines whether the page was modified since the last checkpoint.
        restore - Determines if the page is locked for restore.
      • partitionMetaPageId

        long partitionMetaPageId​(int grpId,
                                 int partId)
        Gets partition metadata page for specified grpId and partId.
        Parameters:
        grpId - Group ID.
        partId - Partition ID.
        Returns:
        Meta page for grpId and partId.
      • safeToUpdate

        boolean safeToUpdate()
        Heuristic method which allows a thread to check if it safe to start memory struture modifications in regard with checkpointing. May return false-negative result during or after partition eviction.
        Returns:
        False if there are too many dirty pages and a thread should wait for a checkpoint to begin.
      • beginCheckpoint

        GridMultiCollectionWrapper<FullPageId> beginCheckpoint​(IgniteInternalFuture allowToReplace)
                                                        throws IgniteException
        Gets a collection of dirty page IDs since the last checkpoint. If a dirty page is being written after the checkpointing operation begun, the modifications will be written to a temporary buffer which will be flushed to the main memory after the checkpointing finished. This method must be called when no concurrent operations on pages are performed.
        Parameters:
        allowToReplace - The sign which allows to replace pages from a checkpoint by page replacer.
        Returns:
        Collection of dirty page IDs.
        Throws:
        IgniteException - If checkpoint has been already started and was not finished.
      • finishCheckpoint

        void finishCheckpoint()
        Finishes checkpoint operation.
      • invalidate

        int invalidate​(int grpId,
                       int partId)
        Marks partition as invalid / outdated.
        Parameters:
        grpId - Group ID.
        partId - Partition ID.
        Returns:
        New partition generation (growing 1-based partition file version).
      • onCacheGroupDestroyed

        void onCacheGroupDestroyed​(int grpId)
        Clears internal metadata of destroyed cache group.
        Parameters:
        grpId - Cache group ID.
      • clearAsync

        IgniteInternalFuture<Void> clearAsync​(LoadedPagesMap.KeyPredicate pred,
                                              boolean cleanDirty)
        Asynchronously clears pages satisfying the given predicate.
        Parameters:
        pred - Predicate for cache group id, pageId.
        cleanDirty - Flag indicating that dirty pages collection should be cleaned.
        Returns:
        Future that will be completed when all pages are cleared.
      • pullPageFromCpBuffer

        FullPageId pullPageFromCpBuffer()
        Pull page from checkpoint buffer.
      • isCpBufferOverflowThresholdExceeded

        boolean isCpBufferOverflowThresholdExceeded()
        Checks if the Checkpoint Buffer is currently close to exhaustion.
        Returns:
        true if measures like throttling to protect Checkpoint Buffer should be applied, and false otherwise.
      • totalPages

        long totalPages()
        Total pages can be placed to memory.