Interface QueueingSegmentListener<K,​V,​E extends Event<K,​V>>

    • Field Detail

      • NOTIFIED

        static final Object NOTIFIED
      • REMOVED

        static final Object REMOVED
    • Method Detail

      • markKeyAsProcessing

        Object markKeyAsProcessing​(K key)
        This should be invoked on a key before actually processing the data. This way the handler knows to keep any newer events have come after the iteration.
        key - The key being processed
        The previous value that was found to be updated, NOTIFIED if the key was previously marked as processing or REMOVED if the key was removed and this value shouldn't be processed
      • findCreatedEntries

        Set<CacheEntry<K,​V>> findCreatedEntries()
        This method is to be called just before marking the transfer as complete and after all keys have been manually processed. This will return all the entries that were raised in an event but not manually marked. This is indicative of a CREATE event occurring but not seeing the value.
      • notifiedKey

        void notifiedKey​(K key)
        This should invoked after the key has been successfully processed to tell the handler that the key is done.
        key - The key that was processed
      • handleEvent

        boolean handleEvent​(EventWrapper<K,​V,​E> wrapper,
                            ListenerInvocation<Event<K,​V>> invocation)
        This should be called by any listener when an event is generated to possibly queue it. If it is not queued, then the caller should take appropriate action such as manually firing the invocation.
        wrapper - The event that was just raised
        invocation - The invocation the event would be fired on
        Whether or not it was queued. If it wasn't queued the invocation should be fired manually
      • transferComplete

        void transferComplete()
        This is needed to tell the handler when the complete iteration is done. Depending on the implementation this could also fire all queued events that are remaining.