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 class
DeltaFIFO.DeletedFinalStateUnknown<T>
DeletedFinalStateUnknown is placed into a DeltaFIFO in the case where an object was deleted but the watch deletion event was missed.static class
DeltaFIFO.DeltaType
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Object obj)
Add items to the delta FIFO.void
delete(Object obj)
Delete items from the delta FIFOObject
get(Object obj)
Get objectDeque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>>
getByKey(String key)
Gets by keyboolean
hasSynced()
Has synced booleanvoid
isPopulated(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 Deltasvoid
replace(List list, String resourceVersion)
Replace the item forcibly.void
resync()
Resync the delta FIFO.void
update(Object obj)
Update items in delta FIFO
-
-
-
Method Detail
-
add
public void add(Object obj)
Add items to the delta FIFO.
-
update
public void update(Object obj)
Update items in delta FIFO
-
delete
public void delete(Object obj)
Delete items from the delta FIFO
-
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.
-
getByKey
public Deque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>> getByKey(String key)
Gets by key
-
pop
public Deque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>> pop(Consumer<Deque<AbstractMap.SimpleEntry<DeltaFIFO.DeltaType,Object>>> func) throws InterruptedException
Pop 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:Store
Updates the status of cache in case of any API error from Kubernetes server- Specified by:
isPopulated
in interfaceStore<T>
- Parameters:
isPopulated
- boolean value indicating whether cache is populated or not
-
-