This is an automated email from the ASF dual-hosted git repository.

pvillard31 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-api.git


The following commit(s) were added to refs/heads/main by this push:
     new 982b917  NIFI-16364 Add API support for automatic Processor scheduling 
(#109)
982b917 is described below

commit 982b91744f30027acc965cfcbe2310b4221af249
Author: Mark Payne <[email protected]>
AuthorDate: Tue Sep 22 05:39:58 2026 -0400

    NIFI-16364 Add API support for automatic Processor scheduling (#109)
---
 .../annotation/behavior/AllowsAutoScheduling.java  | 44 ++++++++++++++++++++++
 .../apache/nifi/scheduling/SchedulingStrategy.java |  8 +++-
 2 files changed, 51 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/nifi/annotation/behavior/AllowsAutoScheduling.java 
b/src/main/java/org/apache/nifi/annotation/behavior/AllowsAutoScheduling.java
new file mode 100644
index 0000000..fca4679
--- /dev/null
+++ 
b/src/main/java/org/apache/nifi/annotation/behavior/AllowsAutoScheduling.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.annotation.behavior;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Declares whether a Processor supports automatic scheduling.
+ *
+ * <p>Processors support automatic scheduling when this annotation is absent.
+ * An inherited declaration can be overridden on a subclass.</p>
+ */
+@Documented
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+public @interface AllowsAutoScheduling {
+
+    /**
+     * Indicates whether automatic scheduling is supported.
+     *
+     * @return whether automatic scheduling is supported
+     */
+    boolean value() default true;
+}
diff --git a/src/main/java/org/apache/nifi/scheduling/SchedulingStrategy.java 
b/src/main/java/org/apache/nifi/scheduling/SchedulingStrategy.java
index 40375cc..11a1a1e 100644
--- a/src/main/java/org/apache/nifi/scheduling/SchedulingStrategy.java
+++ b/src/main/java/org/apache/nifi/scheduling/SchedulingStrategy.java
@@ -32,7 +32,13 @@ public enum SchedulingStrategy {
      * Indicates that the component will be scheduled to run according to a
      * Cron-style expression
      */
-    CRON_DRIVEN(1, "* * * * * ?");
+    CRON_DRIVEN(1, "* * * * * ?"),
+
+    /**
+     * Indicates that the framework will select the scheduling interval,
+     * concurrent tasks, and run duration based on observed work.
+     */
+    AUTO(1, "0 sec");
 
     private final int defaultConcurrentTasks;
     private final String defaultSchedulingPeriod;

Reply via email to