use of io.kubernetes.client.common.KubernetesObject in project java by kubernetes-client.
the class DeltaFIFO method queueActionLocked.
/**
* queueActionLocked appends to the delta list for the object. Caller must hold the lock.
*/
private void queueActionLocked(DeltaType actionType, KubernetesObject obj) {
String id = this.keyOf(obj);
Deque<MutablePair<DeltaType, KubernetesObject>> deltas = items.get(id);
if (deltas == null) {
deltas = new LinkedList<>();
deltas.add(new MutablePair(actionType, obj));
} else {
deltas.add(new MutablePair<DeltaType, KubernetesObject>(actionType, obj));
}
Deque<MutablePair<DeltaType, KubernetesObject>> combinedDeltaList = combineDeltas(deltas);
boolean exist = items.containsKey(id);
if (combinedDeltaList != null && combinedDeltaList.size() > 0) {
if (!exist) {
this.queue.add(id);
}
this.items.put(id, combinedDeltaList);
notEmpty.signalAll();
} else {
this.items.remove(id);
}
}
Aggregations