Class DeltaFIFO<T>

  • All Implemented Interfaces:
    Store<Object>

    public class DeltaFIFO<T>
    extends Object
    implements Store<Object>
    The DeltaFIFO inherits from an Object queue since that we're actually reading from it as Deltas but writing it as Kubernetes object. This is taken from official client: https://github.com/kubernetes-client/java/blob/master/util/src/main/java/io/kubernetes/client/informer/cache/DeltaFIFO.java which is ported from official go client: https://github.com/kubernetes/client-go/blob/master/tools/cache/delta_fifo.go
    • Method Detail

      • add

        public void add​(Object obj)
        Add items to the delta FIFO.
        Specified by:
        add in interface Store<T>
        Parameters:
        obj - object
      • update

        public void update​(Object obj)
        Update items in delta FIFO
        Specified by:
        update in interface Store<T>
        Parameters:
        obj - object
      • delete

        public void delete​(Object obj)
        Delete items from the delta FIFO
        Specified by:
        delete in interface Store<T>
        Parameters:
        obj - object
      • replace

        public void replace​(List list,
                            String resourceVersion)
        Replace the item forcibly.
        Specified by:
        replace in interface Store<T>
        Parameters:
        list - list of objects
        resourceVersion - resource version
      • resync

        public void resync()
        Resync the delta FIFO. First, it locks the queue to block any more write operation until it finishes all the pending items in the queue.
        Specified by:
        resync in interface Store<T>
      • listKeys

        public List<String> listKeys()
        List keys list.
        Specified by:
        listKeys in interface Store<T>
        Returns:
        the list
      • get

        public Object get​(Object obj)
        Get object
        Specified by:
        get in interface Store<T>
        Parameters:
        obj - the object
        Returns:
        the object
      • list

        public List<Object> list()
        List objects
        Specified by:
        list in interface Store<T>
        Returns:
        the list
      • hasSynced

        public boolean hasSynced()
        Has synced boolean
        Returns:
        the boolean
      • isPopulated

        public void isPopulated​(boolean isPopulated)
        Description copied from interface: Store
        Updates the status of cache in case of any API error from Kubernetes server
        Specified by:
        isPopulated in interface Store<T>
        Parameters:
        isPopulated - boolean value indicating whether cache is populated or not