Interface PagingStore

    • Method Detail

      • getNumberOfPages

        long getNumberOfPages()
      • getCurrentWritingPage

        long getCurrentWritingPage()
        Returns the page id of the current page in which the system is writing files.
      • getFolder

        File getFolder()
      • getPageLimitMessages

        Long getPageLimitMessages()
      • getPageLimitBytes

        Long getPageLimitBytes()
      • pageFull

        void pageFull​(PageSubscription subscription)
        Callback to be used by a counter when the Page is full for that counter
      • isPageFull

        boolean isPageFull()
      • checkPageLimit

        void checkPageLimit​(long numberOfMessages)
      • getFirstPage

        long getFirstPage()
      • getPageSizeBytes

        int getPageSizeBytes()
      • getAddressSize

        long getAddressSize()
      • getMaxSize

        long getMaxSize()
      • getMaxPageReadBytes

        int getMaxPageReadBytes()
      • getMaxPageReadMessages

        int getMaxPageReadMessages()
      • isPaging

        boolean isPaging()
        This method will look if the current state of paging is not paging, without using a lock. For cases where you need absolutely atomic results, check it directly on the internal variables while requiring a readLock. It's ok to look for this with an estimate on starting a task or not, but you will need to recheck on actual paging operations.
      • sync

        void sync()
           throws Exception
        Schedules sync to the file storage.
        Throws:
        Exception
      • ioSync

        void ioSync()
             throws Exception
        Performs a real sync on the current IO file.
        Throws:
        Exception
      • usePage

        Page usePage​(long page)
      • usePage

        Page usePage​(long page,
                     boolean create)
        Use this method when you want to use the cache of used pages. If you are just using offline (e.g. print-data), use the newPageObject method.
      • checkPageFileExists

        boolean checkPageFileExists​(long page)
                             throws Exception
        Throws:
        Exception
      • depage

        Page depage()
             throws Exception
        Remove the first page from the Writing Queue. The file will still exist until Page.delete is called, So, case the system is reloaded the same Page will be loaded back if delete is not called.
        Throws:
        Exception - Note: This should still be part of the interface, even though ActiveMQ Artemis only uses through the
      • removePage

        Page removePage​(int pageId)
      • getCurrentPage

        Page getCurrentPage()
      • counterSnapshot

        void counterSnapshot()
        it will save snapshots on the counters
      • startPaging

        boolean startPaging()
                     throws Exception
        Returns:
        true if paging was started, or false if paging was already started before this call
        Throws:
        Exception
      • addSize

        void addSize​(int size,
                     boolean sizeOnly)
        Parameters:
        size -
        sizeOnly - if false we won't increment the number of messages. (add references for example)
      • addSize

        default void addSize​(int size)
      • checkMemory

        boolean checkMemory​(Runnable runnable)
      • checkMemory

        boolean checkMemory​(boolean runOnFailure,
                            Runnable runnable,
                            Runnable runWhenBlocking)
      • isFull

        boolean isFull()
      • isRejectingMessages

        boolean isRejectingMessages()
      • checkReleasedMemory

        boolean checkReleasedMemory()
        It will return true if the destination is leaving blocking.
      • lock

        boolean lock​(long timeout)
        Write lock the PagingStore.
        Parameters:
        timeout - milliseconds to wait for the lock. If value is -1 then wait indefinitely.
        Returns:
        true if the lock was obtained, false otherwise
      • unlock

        void unlock()
        Releases locks acquired with lock(long).
      • flushExecutors

        void flushExecutors()
        This is used mostly by tests. We will wait any pending runnable to finish its execution
      • execute

        void execute​(Runnable runnable)
      • getCurrentIds

        Collection<Integer> getCurrentIds()
                                   throws Exception
        Files to synchronize with a remote backup.
        Returns:
        a collection of page IDs which must be synchronized with a replicating backup
        Throws:
        Exception
      • disableCleanup

        void disableCleanup()
        This method will disable cleanup of pages. No page will be deleted after this call.
      • enableCleanup

        void enableCleanup()
        This method will re-enable cleanup of pages. Notice that it will also start cleanup threads.
      • getAddressLimitPercent

        int getAddressLimitPercent()
      • block

        void block()
      • unblock

        void unblock()