From 95c607891f5284359d29ff49ee3a1554b2186ce1 Mon Sep 17 00:00:00 2001 From: csviri Date: Tue, 4 Apr 2023 12:49:54 +0200 Subject: [PATCH] fix: javadoc problems preventing snapshot release --- .../java/io/javaoperatorsdk/operator/Operator.java | 4 ++++ .../operator/api/config/ConfigurationService.java | 6 ++++++ .../api/config/ConfigurationServiceOverrider.java | 2 ++ .../config/ControllerConfigurationOverrider.java | 2 ++ .../config/ResolvedControllerConfiguration.java | 2 ++ .../api/config/informer/InformerConfiguration.java | 2 ++ .../operator/api/monitoring/Metrics.java | 14 ++++++++++++-- .../api/reconciler/ControllerConfiguration.java | 10 +++++++++- .../operator/api/reconciler/Reconciler.java | 1 + .../dependent/EventSourceReferencer.java | 2 ++ .../managed/ManagedDependentResourceContext.java | 1 + .../operator/processing/Controller.java | 1 + ...AbstractEventSourceHolderDependentResource.java | 7 ++++++- .../DependentResourceWithExplicitState.java | 8 +++++++- .../GenericKubernetesResourceMatcher.java | 1 + .../dependent/workflow/WorkflowResult.java | 1 + .../processing/event/EventSourceManager.java | 4 ++++ .../processing/event/rate/RateLimiter.java | 1 + .../event/source/PrimaryToSecondaryMapper.java | 8 ++++++-- .../operator/processing/retry/GenericRetry.java | 3 +++ 20 files changed, 73 insertions(+), 7 deletions(-) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java index 0cb82c5b30..b40d8d6dac 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java @@ -43,6 +43,7 @@ public Operator(KubernetesClient kubernetesClient) { } /** + * @param configurationService implementation * @deprecated Use {@link #Operator(Consumer)} instead */ @Deprecated(forRemoval = true) @@ -173,6 +174,7 @@ public void stop() throws OperatorException { * * @param reconciler the reconciler to register * @param

the {@code CustomResource} type associated with the reconciler + * @return registered controller * @throws OperatorException if a problem occurred during the registration process */ public

RegisteredController

register(Reconciler

reconciler) @@ -192,6 +194,7 @@ public

RegisteredController

register(Reconciler

re * @param reconciler part of the reconciler to register * @param configuration the configuration with which we want to register the reconciler * @param

the {@code HasMetadata} type associated with the reconciler + * @return registered controller * @throws OperatorException if a problem occurred during the registration process */ public

RegisteredController

register(Reconciler

reconciler, @@ -230,6 +233,7 @@ public

RegisteredController

register(Reconciler

re * * @param reconciler part of the reconciler to register * @param configOverrider consumer to use to change config values + * @return registered controller * @param

the {@code HasMetadata} type associated with the reconciler */ public

RegisteredController

register(Reconciler

reconciler, diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java index d55984fae1..809a6ee359 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java @@ -199,6 +199,8 @@ default Optional getLeaderElectionConfiguration() { * if false, the startup will ignore recoverable errors, caused for example by RBAC issues, and * will try to reconnect periodically in the background. *

+ * + * @return actual value described above */ default boolean stopOnInformerErrorDuringStartup() { return true; @@ -208,6 +210,8 @@ default boolean stopOnInformerErrorDuringStartup() { * Timeout for cache sync. In other words source start timeout. Note that is * "stopOnInformerErrorDuringStartup" is true the operator will stop on timeout. Default is 2 * minutes. + * + * @return Duration of sync timeout */ default Duration cacheSyncTimeout() { return Duration.ofMinutes(2); @@ -216,6 +220,8 @@ default Duration cacheSyncTimeout() { /** * Handler for an informer stop. Informer stops if there is a non-recoverable error. Like received * a resource that cannot be deserialized. + * + * @return an optional InformerStopHandler */ default Optional getInformerStoppedHandler() { return Optional.of((informer, ex) -> { diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java index 3cc8dd6078..39898acb20 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java @@ -238,6 +238,8 @@ public ResourceClassResolver getResourceClassResolver() { /** * @deprecated Use {@link ConfigurationServiceProvider#overrideCurrent(Consumer)} instead + * @param original that will be overriding + * @return current overrider */ @Deprecated(since = "2.2.0") public static ConfigurationServiceOverrider override(ConfigurationService original) { diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverrider.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverrider.java index 7f9bf45b58..241c7d3271 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverrider.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverrider.java @@ -106,6 +106,8 @@ public ControllerConfigurationOverrider watchingAllNamespaces() { } /** + * @param retry configuration + * @return current instance of overrider * @deprecated Use {@link #withRetry(Retry)} instead */ @Deprecated(forRemoval = true) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ResolvedControllerConfiguration.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ResolvedControllerConfiguration.java index 844724fa48..827d8bb81a 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ResolvedControllerConfiguration.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ResolvedControllerConfiguration.java @@ -156,6 +156,8 @@ public ResourceEventFilter

getEventFilter() { /** * @deprecated Use {@link OnAddFilter}, {@link OnUpdateFilter} and {@link GenericFilter} instead + * + * @param eventFilter */ @Deprecated(forRemoval = true) protected void setEventFilter(ResourceEventFilter

eventFilter) { diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java index 8adda74c0c..f883799cc9 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/informer/InformerConfiguration.java @@ -78,6 +78,8 @@ public

PrimaryToSecondaryMapper

getPrimaryToSecondary * {@link io.javaoperatorsdk.operator.RegisteredController}). If true, changing the target * namespaces of a controller would result to change target namespaces for the * InformerEventSource. + * + * @return if namespace changes should be followed */ boolean followControllerNamespaceChanges(); diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/monitoring/Metrics.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/monitoring/Metrics.java index 1ce27d29df..42fee488d7 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/monitoring/Metrics.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/monitoring/Metrics.java @@ -23,6 +23,8 @@ public interface Metrics { /** * Do initialization if necessary; + * + * @param controller callback */ default void controllerRegistered(Controller controller) {} @@ -36,6 +38,9 @@ default void controllerRegistered(Controller controller) default void receivedEvent(Event event, Map metadata) {} /** + * @param metadata additional metadata + * @param resourceID of primary resource + * @param retryInfo for current execution * @deprecated Use {@link #reconcileCustomResource(HasMetadata, RetryInfo, Map)} instead */ @Deprecated(forRemoval = true) @@ -56,6 +61,9 @@ default void reconcileCustomResource(HasMetadata resource, RetryInfo retryInfo, } /** + * @param exception actual exception + * @param metadata additional metadata + * @param resourceID of primary resource * @deprecated Use {@link #failedReconciliation(HasMetadata, Exception, Map)} instead */ @Deprecated(forRemoval = true) @@ -84,7 +92,7 @@ default void reconciliationExecutionFinished(HasMetadata resource, Map metadata) {} /** - * + * @param resourceID of primary resource * @deprecated Use (and implement) {@link #cleanupDoneFor(ResourceID, Map)} instead */ @Deprecated @@ -102,7 +110,7 @@ default void cleanupDoneFor(ResourceID resourceID) { default void cleanupDoneFor(ResourceID resourceID, Map metadata) {} /** - * + * @param resourceID of primary resource * @deprecated Use (and implement) {@link #finishedReconciliation(ResourceID, Map)} instead */ @Deprecated @@ -111,6 +119,8 @@ default void finishedReconciliation(ResourceID resourceID) { } /** + * @param resourceID of primary resource + * @param metadata additional metadata * @deprecated Use {@link #finishedReconciliation(HasMetadata, Map)} instead */ @Deprecated(forRemoval = true) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java index a4a4a78797..e2c0de896b 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java @@ -75,14 +75,22 @@ /** * Filter of onAdd events of resources. + * + * @return on-add filter **/ Class onAddFilter() default OnAddFilter.class; - /** Filter of onUpdate events of resources. */ + /** + * Filter of onUpdate events of resources. + * + * @return on-update filter + */ Class onUpdateFilter() default OnUpdateFilter.class; /** * Filter applied to all operations (add, update, delete). Used to ignore some resources. + * + * @return generic filter **/ Class genericFilter() default GenericFilter.class; diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java index 771b169fd1..55df9d1cea 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java @@ -8,6 +8,7 @@ public interface Reconciler { * The implementation of this operation is required to be idempotent. Always use the UpdateControl * object to make updates on custom resource if possible. * + * @throws Exception from the custom implementation * @param resource the resource that has been created or updated * @param context the context with which the operation is executed * @return UpdateControl to manage updates on the custom resource (usually the status) after diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/EventSourceReferencer.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/EventSourceReferencer.java index 13ac93e2bf..b2f8c95692 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/EventSourceReferencer.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/EventSourceReferencer.java @@ -10,6 +10,8 @@ default void useEventSourceWithName(String name) {} /** * Throws {@link EventSourceNotFoundException} an exception if the target event source to use is * not found. + * + * @param eventSourceRetriever for event sources */ void resolveEventSource(EventSourceRetriever

eventSourceRetriever) throws EventSourceNotFoundException; diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/managed/ManagedDependentResourceContext.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/managed/ManagedDependentResourceContext.java index 42741c3a97..9c5b3dddb1 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/managed/ManagedDependentResourceContext.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/managed/ManagedDependentResourceContext.java @@ -30,6 +30,7 @@ public interface ManagedDependentResourceContext { * the semantics of this operation is defined as removing the mapping associated with the * specified key. * + * @param object type * @param key the key identifying which contextual object to add or remove from the context * @param value the value to add to the context or {@code null} to remove an existing entry * associated with the specified key diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/Controller.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/Controller.java index e59d2a789b..d004ab1209 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/Controller.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/Controller.java @@ -309,6 +309,7 @@ public void start() throws OperatorException { * {@link io.javaoperatorsdk.operator.api.config.ControllerConfigurationOverrider#override(ControllerConfiguration)}, * passing it the controller's original configuration. * + * @param startEventProcessor if event processing should be started automatically * @throws OperatorException if a problem occurred during the registration process */ public synchronized void start(boolean startEventProcessor) throws OperatorException { diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/AbstractEventSourceHolderDependentResource.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/AbstractEventSourceHolderDependentResource.java index ad1eeb4d43..972b61cd94 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/AbstractEventSourceHolderDependentResource.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/AbstractEventSourceHolderDependentResource.java @@ -61,7 +61,12 @@ public void resolveEventSource(EventSourceRetriever

eventSourceRetriever) { } } - /** To make this backwards compatible even for respect of overriding */ + /** + * To make this backwards compatible even for respect of overriding + * + * @param context for event sources + * @return event source instance + */ @SuppressWarnings("unchecked") public T initEventSource(EventSourceContext

context) { return (T) eventSource(context).orElseThrow(); diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/DependentResourceWithExplicitState.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/DependentResourceWithExplicitState.java index 2a1b0a64c7..6829442b2e 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/DependentResourceWithExplicitState.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/DependentResourceWithExplicitState.java @@ -31,7 +31,13 @@ default Optional eventSourceName() { */ Class stateResourceClass(); - /** State resource which contains the target state. Usually an ID to address the resource */ + /** + * State resource which contains the target state. Usually an ID to address the resource + * + * @param primary resource + * @param resource secondary resource + * @return that stores state + */ S stateResource(P primary, R resource); } diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesResourceMatcher.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesResourceMatcher.java index 352e4ee419..6a16d21b44 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesResourceMatcher.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesResourceMatcher.java @@ -124,6 +124,7 @@ public static Result match(R desired, R actualResourc * @param the type of resource we want to determine whether they match or not * @param

the type of primary resources associated with the secondary resources we want to * match + * @param strongEquality if the resource should match exactly */ public static Result match( KubernetesDependentResource dependentResource, R actualResource, P primary, diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowResult.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowResult.java index f12a45579d..ba9e0f5755 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowResult.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowResult.java @@ -22,6 +22,7 @@ public Map getErroredDependents() { /** * @deprecated Use {@link #erroredDependentsExist()} instead + * @return if any dependents are in error state */ @Deprecated(forRemoval = true) public boolean erroredDependentsExists() { diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSourceManager.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSourceManager.java index 8a7cdc3be2..41ce4c1826 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSourceManager.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSourceManager.java @@ -222,6 +222,10 @@ public List> getResourceEventSourcesFor(Class d /** * @deprecated Use {@link #getResourceEventSourceFor(Class)} instead + * + * @param target resource type + * @param dependentType target resource class + * @return list of related event sources */ @Deprecated public List> getEventSourcesFor(Class dependentType) { diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/rate/RateLimiter.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/rate/RateLimiter.java index b972c5587a..7708e6dfe3 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/rate/RateLimiter.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/rate/RateLimiter.java @@ -10,6 +10,7 @@ interface RateLimitState { } /** + * @param rateLimitState state implementation * @return empty if permission acquired or minimal duration until a permission could be acquired * again */ diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/PrimaryToSecondaryMapper.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/PrimaryToSecondaryMapper.java index 5e37d0e740..cc03afde4e 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/PrimaryToSecondaryMapper.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/PrimaryToSecondaryMapper.java @@ -6,6 +6,7 @@ import io.javaoperatorsdk.operator.processing.event.ResourceID; /** + *

* Identifies the set of secondary resources associated with a given primary resource. This is * typically needed when multiple secondary resources can be associated with one or several multiple * primary resources *without* a standard way (e.g. owner reference or annotations) to materialize @@ -18,16 +19,19 @@ * that this primary resource can properly be reconciled when changes impact the associated * secondary resources, even though these don't contain any information allowing to make such an * inference. - *

+ *

+ *

* This helps particularly in cases where several secondary resources, listed in some way in the * primary resource, need to or can be created before the primary resource exists. In that * situation, attempting to retrieve the associated secondary resources by calling * {@link io.javaoperatorsdk.operator.api.reconciler.Context#getSecondaryResource(Class)} would fail * without providing a mapper to tell JOSDK how to retrieve the secondary resources. - *

+ *

+ *

* You can see an example of this in action in the Reconciler * for the PrimaryToSecondaryIT integration tests that handles many-to-many relationship. + *

* * @param

primary resource type */ diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java index 3c67b87966..9d5a83dc51 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java @@ -21,6 +21,9 @@ public static GenericRetry noRetry() { /** * @deprecated Use the {@link GradualRetry} annotation instead + * + * @param configuration retry config + * @return Retry instance */ @Deprecated(forRemoval = true) public static Retry fromConfiguration(RetryConfiguration configuration) {