Class DeltaFIFO<T>
java.lang.Object
io.fabric8.kubernetes.client.informers.cache.DeltaFIFO<T>
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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeltaFIFO.DeletedFinalStateUnknown<T>DeletedFinalStateUnknown is placed into a DeltaFIFO in the case where an object was deleted but the watch deletion event was missed.static classDeltaFIFO.DeltaType -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidadd(Object obj)Add items to the delta FIFO.voiddelete(Object obj)Delete items from the delta FIFOObjectget(Object obj)Get objectDeque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>>getByKey(String key)Gets by keybooleanhasSynced()Has synced booleanvoidisPopulated(boolean isPopulated)Updates the status of cache in case of any API error from Kubernetes serverList<Object>list()List objectsList<String>listKeys()List keys list.Deque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>>pop(Consumer<Deque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>>> func)Pop Deltasvoidreplace(List list, String resourceVersion)Replace the item forcibly.voidresync()Resync the delta FIFO.voidupdate(Object obj)Update items in delta FIFO
-
Constructor Details
-
Method Details
-
add
Add items to the delta FIFO. -
update
Update items in delta FIFO -
delete
Delete items from the delta FIFO -
replace
Replace the item forcibly. -
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. -
listKeys
List keys list. -
get
Get object -
getByKey
Gets by key -
list
List objects -
pop
public Deque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>> pop(Consumer<Deque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>>> func) throws InterruptedExceptionPop Deltas- Parameters:
func- the func- Returns:
- the deltas
- Throws:
InterruptedException- interruption exception
-
hasSynced
public boolean hasSynced()Has synced boolean- Returns:
- the boolean
-
isPopulated
public void isPopulated(boolean isPopulated)Description copied from interface:StoreUpdates the status of cache in case of any API error from Kubernetes server- Specified by:
isPopulatedin interfaceStore<T>- Parameters:
isPopulated- boolean value indicating whether cache is populated or not
-