You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/en/docs/documentation/working-with-es-caches.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,8 @@ allowing you to cache external resources and trigger reconciliation when those r
19
19
The underlying informer implementation comes from the Fabric8 client, called [DefaultSharedIndexInformer](https://github.com/fabric8io/kubernetes-client/blob/main/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/impl/DefaultSharedIndexInformer.java).
in Java Operator SDK wraps the Fabric8 client informers.
22
-
This wrapper adds additional capabilities specifically required for controllers
23
-
(note that informers have broader applications beyond just implementing controllers).
22
+
While this wrapper adds additional capabilities specifically required for controllers, this is the event
23
+
source that most likely will be used to deal with Kubernetes resources.
24
24
25
25
These additional capabilities include:
26
26
- Maintaining an index that maps secondary resources in the informer cache to their related primary resources
@@ -31,8 +31,8 @@ These additional capabilities include:
31
31
### Associating Secondary Resources to Primary Resource
32
32
33
33
Event sources need to trigger the appropriate reconciler, providing the correct primary resource, whenever one of their
34
-
handled secondary resources changes. It is thus core to an event source's role to identify which primary resource (
35
-
usually, your custom resource) is potentially impacted by that change.
34
+
handled secondary resources changes. It is thus core to an event source's role to identify which primary resource
35
+
(usually, your custom resource) is potentially impacted by that change.
36
36
The framework uses [`SecondaryToPrimaryMapper`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/SecondaryToPrimaryMapper.java)
37
37
for this purpose. For `InformerEventSources`, which target Kubernetes resources, this mapping is typically done using
38
38
either the owner reference or an annotation on the secondary resource. For external resources, other mechanisms need to
@@ -53,8 +53,8 @@ secondary resources using the `Set<R> getSecondaryResources(Class<R> expectedTyp
53
53
provided as part of the `reconcile` method.
54
54
55
55
For `InformerEventSource`, this will leverage the associated `PrimaryToSecondaryIndex`. Resources are then retrieved
56
-
from the informer's cache. Note that since all those steps work
57
-
on top of indexes, those operations are very fast, usually O(1).
56
+
from the informer's cache. Note that since all those steps work on top of indexes, those operations are very fast,
57
+
usually O(1).
58
58
59
59
While we've focused mostly on `InformerEventSource`, this concept can be extended to all `EventSources`, since
0 commit comments