Class WriteBehindQueueManager

  • All Implemented Interfaces:
    WriteBehind

    public class WriteBehindQueueManager
    extends java.lang.Object
    implements WriteBehind
    Author:
    Alex Snaps
    • Method Detail

      • write

        public void write​(Element element)
        Add a write operation for a given element.
        Specified by:
        write in interface WriteBehind
        Parameters:
        element - the element for which a write operation will be added to the write behind queue
      • delete

        public void delete​(CacheEntry entry)
        Add a delete operation for the given cache entry
        Specified by:
        delete in interface WriteBehind
        Parameters:
        entry - the cache entry for which a delete operation will be added to the write behind queue
      • setOperationsFilter

        public void setOperationsFilter​(OperationsFilter filter)
        Set the operations filter that should be used.
        Specified by:
        setOperationsFilter in interface WriteBehind
        Parameters:
        filter - the filter that will be used as of now
      • stop

        public void stop()
                  throws CacheException
        Stop the coordinator and all the internal data structures.

        This stops as quickly as possible without losing any previously added items. However, no guarantees are made towards the processing of these items. It's highly likely that items are still inside the internal data structures and not processed.

        Specified by:
        stop in interface WriteBehind
        Throws:
        CacheException
        See Also:
        WriteBehind.start(net.sf.ehcache.writer.CacheWriter)
      • getQueueSize

        public long getQueueSize()
        Gets the best estimate for items in the queue still awaiting processing. Not including elements currently processed
        Specified by:
        getQueueSize in interface WriteBehind
        Returns:
        the amount of elements still awaiting processing.