Class Cleaner

  • All Implemented Interfaces:
    com.tangosol.net.events.EventDispatcherAwareInterceptor<com.tangosol.net.events.partition.TransferEvent>, com.tangosol.net.events.EventInterceptor<com.tangosol.net.events.partition.TransferEvent>, com.tangosol.net.MemberListener, EventListener

    public class Cleaner
    extends Object
    implements com.tangosol.net.MemberListener, com.tangosol.net.events.EventDispatcherAwareInterceptor<com.tangosol.net.events.partition.TransferEvent>
    This Cleaner is triggered by members leaving the service or partitions arriving at this member, and is used to release locks and semaphore permits held by the departed members.
    Author:
    Harvey Raja 2021.08.19, Aleks Seovic 2021.10.26
    • Field Detail

      • m_sServiceName

        protected volatile String m_sServiceName
        The service name.
      • m_partsCheck

        protected volatile com.tangosol.net.partition.PartitionSet m_partsCheck
        A PartitionSet to fire the check against.
    • Constructor Detail

      • Cleaner

        public Cleaner()
    • Method Detail

      • onEvent

        public void onEvent​(com.tangosol.net.events.partition.TransferEvent event)
        Specified by:
        onEvent in interface com.tangosol.net.events.EventInterceptor<com.tangosol.net.events.partition.TransferEvent>
      • introduceEventDispatcher

        public void introduceEventDispatcher​(String sIdentifier,
                                             com.tangosol.net.events.EventDispatcher dispatcher)
        Specified by:
        introduceEventDispatcher in interface com.tangosol.net.events.EventDispatcherAwareInterceptor<com.tangosol.net.events.partition.TransferEvent>
      • memberJoined

        public void memberJoined​(com.tangosol.net.MemberEvent evt)
        Specified by:
        memberJoined in interface com.tangosol.net.MemberListener
      • memberLeaving

        public void memberLeaving​(com.tangosol.net.MemberEvent evt)
        Specified by:
        memberLeaving in interface com.tangosol.net.MemberListener
      • memberLeft

        public void memberLeft​(com.tangosol.net.MemberEvent evt)
        Specified by:
        memberLeft in interface com.tangosol.net.MemberListener
      • enqueueUpdate

        protected void enqueueUpdate​(int iPartition,
                                     int cParts)
        Enqueue the provided partition and cache names for a 'clean up'.

        The clean up is fired on a background thread allowing bundling of subsequently enqueued partitions. The background thread is fired 1s after the first enqueue.

        Parameters:
        iPartition - the partition to enqueue
        cParts - the number of partitions in the associated service