44import java .util .Optional ;
55import java .util .Set ;
66import java .util .concurrent .ExecutorService ;
7+ import java .util .concurrent .Executors ;
78import java .util .function .Consumer ;
89
910import org .slf4j .Logger ;
2425import io .javaoperatorsdk .operator .processing .dependent .kubernetes .KubernetesDependent ;
2526import io .javaoperatorsdk .operator .processing .dependent .workflow .ManagedWorkflowFactory ;
2627
27- import static io .javaoperatorsdk .operator .api .config .ExecutorServiceManager .newThreadPoolExecutor ;
28-
2928/** An interface from which to retrieve configuration information. */
3029public interface ConfigurationService {
3130
@@ -127,14 +126,18 @@ default boolean checkCRDAndValidateLocalModel() {
127126 return false ;
128127 }
129128
130- int DEFAULT_RECONCILIATION_THREADS_NUMBER = 200 ;
129+ int DEFAULT_RECONCILIATION_THREADS_NUMBER = 50 ;
130+ /**
131+ * @deprecated Not used anymore in the default implementation
132+ */
133+ @ Deprecated (forRemoval = true )
131134 int MIN_DEFAULT_RECONCILIATION_THREADS_NUMBER = 10 ;
132135
133136 /**
134- * The maximum number of threads the operator can spin out to dispatch reconciliation requests to
135- * reconcilers
137+ * The number of threads the operator can spin out to dispatch reconciliation requests to
138+ * reconcilers with the default executors
136139 *
137- * @return the maximum number of concurrent reconciliation threads
140+ * @return the number of concurrent reconciliation threads
138141 */
139142 default int concurrentReconciliationThreads () {
140143 return DEFAULT_RECONCILIATION_THREADS_NUMBER ;
@@ -143,17 +146,24 @@ default int concurrentReconciliationThreads() {
143146 /**
144147 * The minimum number of threads the operator starts in the thread pool for reconciliations.
145148 *
149+ * @deprecated not used anymore by default executor implementation
146150 * @return the minimum number of concurrent reconciliation threads
147151 */
152+ @ Deprecated (forRemoval = true )
148153 default int minConcurrentReconciliationThreads () {
149154 return MIN_DEFAULT_RECONCILIATION_THREADS_NUMBER ;
150155 }
151156
152157 int DEFAULT_WORKFLOW_EXECUTOR_THREAD_NUMBER = DEFAULT_RECONCILIATION_THREADS_NUMBER ;
158+ /**
159+ * @deprecated Not used anymore in the default implementation
160+ */
161+ @ Deprecated (forRemoval = true )
153162 int MIN_DEFAULT_WORKFLOW_EXECUTOR_THREAD_NUMBER = MIN_DEFAULT_RECONCILIATION_THREADS_NUMBER ;
154163
155164 /**
156- * Retrieves the maximum number of threads the operator can spin out to be used in the workflows.
165+ * Number of threads the operator can spin out to be used in the workflows with the default
166+ * executor.
157167 *
158168 * @return the maximum number of concurrent workflow threads
159169 */
@@ -164,8 +174,10 @@ default int concurrentWorkflowExecutorThreads() {
164174 /**
165175 * The minimum number of threads the operator starts in the thread pool for workflows.
166176 *
177+ * @deprecated not used anymore by default executor implementation
167178 * @return the minimum number of concurrent workflow threads
168179 */
180+ @ Deprecated (forRemoval = true )
169181 default int minConcurrentWorkflowExecutorThreads () {
170182 return MIN_DEFAULT_WORKFLOW_EXECUTOR_THREAD_NUMBER ;
171183 }
@@ -191,13 +203,11 @@ default Metrics getMetrics() {
191203 }
192204
193205 default ExecutorService getExecutorService () {
194- return newThreadPoolExecutor (minConcurrentReconciliationThreads (),
195- concurrentReconciliationThreads ());
206+ return Executors .newFixedThreadPool (concurrentReconciliationThreads ());
196207 }
197208
198209 default ExecutorService getWorkflowExecutorService () {
199- return newThreadPoolExecutor (minConcurrentWorkflowExecutorThreads (),
200- concurrentWorkflowExecutorThreads ());
210+ return Executors .newFixedThreadPool (concurrentWorkflowExecutorThreads ());
201211 }
202212
203213 default boolean closeClientOnStop () {
0 commit comments