Skip to content

[WIP] Informer pools#3325

Open
csviri wants to merge 3 commits intonextfrom
informer-pool
Open

[WIP] Informer pools#3325
csviri wants to merge 3 commits intonextfrom
informer-pool

Conversation

@csviri
Copy link
Copy Markdown
Collaborator

@csviri csviri commented Apr 29, 2026

Will put here early impl so we can discuss on the community meeting. Also will expand design description in the issue.

csviri added 3 commits April 28, 2026 18:13
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 29, 2026
@csviri csviri changed the base branch from main to next April 29, 2026 13:26
@csviri csviri linked an issue Apr 29, 2026 that may be closed by this pull request
@csviri csviri marked this pull request as ready for review April 29, 2026 13:28
Copilot AI review requested due to automatic review settings April 29, 2026 13:28
@openshift-ci openshift-ci Bot requested review from metacosm and xstefank April 29, 2026 13:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces initial scaffolding for “event source pooling” (starting with informers) under processing.event.source.pool, likely to enable sharing/reuse of informers across components/controllers.

Changes:

  • Added EventSourcePool interface and AbstractEventSourcePool base type.
  • Added InformerClassifier record to key pooled informers by selector/namespace/resource type.
  • Added initial (currently incomplete) InformerPool implementation and a minor whitespace cleanup in InformerManager.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/pool/InformerPool.java Adds a new pool for SharedIndexInformer<?> instances (currently stubbed/incomplete).
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/pool/InformerClassifier.java Adds a classifier record intended as the cache key for pooled informers.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/pool/EventSourcePool.java Introduces a generic pool interface for event sources.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/pool/AbstractEventSourcePool.java Adds a base class placeholder for pool implementations.
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerManager.java Removes an extraneous whitespace line in createEventSource.

Comment on lines +3 to +10
import io.fabric8.kubernetes.api.model.HasMetadata;
import io.javaoperatorsdk.operator.api.config.informer.FieldSelector;

public record InformerClassifier(
String labelSelector,
String namespaceIdentifier,
Class<? extends HasMetadata> resourceClass,
FieldSelector fieldSelector) {}
Comment on lines +24 to +33
var actual = informers.get(classifier);
if (actual == null) {
actual = null; // create Informer
}
incrementCounter(actual);
return null;
}

private synchronized void incrementCounter(SharedIndexInformer<?> actual) {
counters.compute(actual, (k, v) -> new AtomicInteger(v == null ? 0 : v.incrementAndGet()));
}

private synchronized void incrementCounter(SharedIndexInformer<?> actual) {
counters.compute(actual, (k, v) -> new AtomicInteger(v == null ? 0 : v.incrementAndGet()));
Comment on lines +24 to +35
var actual = informers.get(classifier);
if (actual == null) {
actual = null; // create Informer
}
incrementCounter(actual);
return null;
}

private synchronized void incrementCounter(SharedIndexInformer<?> actual) {
counters.compute(actual, (k, v) -> new AtomicInteger(v == null ? 0 : v.incrementAndGet()));
}

Comment on lines +33 to +37
counters.compute(actual, (k, v) -> new AtomicInteger(v == null ? 0 : v.incrementAndGet()));
}

@Override
public void removeEventSource(SharedIndexInformer<?> informerEventSource) {}
Comment on lines +23 to +37
public SharedIndexInformer<?> getEventSource(InformerClassifier classifier) {
var actual = informers.get(classifier);
if (actual == null) {
actual = null; // create Informer
}
incrementCounter(actual);
return null;
}

private synchronized void incrementCounter(SharedIndexInformer<?> actual) {
counters.compute(actual, (k, v) -> new AtomicInteger(v == null ? 0 : v.incrementAndGet()));
}

@Override
public void removeEventSource(SharedIndexInformer<?> informerEventSource) {}
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 30, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 30, 2026

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Informer Pools

2 participants