Skip to content

Commit 1f5a08b

Browse files
authored
docs: javadoc for informer mapper and indexed initialization (#1441)
1 parent cb2393b commit 1f5a08b

File tree

1 file changed

+5
-0
lines changed
  • operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer

1 file changed

+5
-0
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,18 @@ public InformerEventSource(
8585
public InformerEventSource(InformerConfiguration<R> configuration, KubernetesClient client) {
8686
super(client.resources(configuration.getResourceClass()), configuration);
8787
this.configuration = configuration;
88+
89+
90+
// If there is a primary to secondary mapper there is no need for primary to secondary index.
8891
primaryToSecondaryMapper = configuration.getPrimaryToSecondaryMapper();
8992
if (primaryToSecondaryMapper == null) {
9093
primaryToSecondaryIndex =
94+
// The index uses the secondary to primary mapper (always present) to build the index
9195
new DefaultPrimaryToSecondaryIndex<>(configuration.getSecondaryToPrimaryMapper());
9296
} else {
9397
primaryToSecondaryIndex = NOOPPrimaryToSecondaryIndex.getInstance();
9498
}
99+
95100
onAddFilter = configuration.onAddFilter().orElse(null);
96101
onUpdateFilter = configuration.onUpdateFilter().orElse(null);
97102
onDeleteFilter = configuration.onDeleteFilter().orElse(null);

0 commit comments

Comments
 (0)