1996fanrui commented on code in PR #22985:
URL: https://github.com/apache/flink/pull/22985#discussion_r1281303552
##########
flink-core/src/main/java/org/apache/flink/configuration/JobManagerOptions.java:
##########
@@ -488,6 +488,23 @@ public enum SchedulerType {
code(SchedulerExecutionMode.REACTIVE.name()))
.build());
+ @Documentation.Section(Documentation.Sections.EXPERT_SCHEDULING)
+ public static final ConfigOption<Long> SCHEDULER_SCALING_INTERVAL_MIN =
+ key("jobmanager.adaptive-scheduler.scaling-interval.min")
+ .longType()
+ .defaultValue(30L) // favor lower scaling-interval.min for
more reactive
+ // rescaling and let the user increase the value for high
workloads
+ .withDescription(
+ "Determines the minimum time (in seconds) between
scaling operations in reactive mode.");
+
+ @Documentation.Section(Documentation.Sections.EXPERT_SCHEDULING)
+ public static final ConfigOption<Long> SCHEDULER_SCALING_INTERVAL_MAX =
+ key("jobmanager.adaptive-scheduler.scaling-interval.max")
+ .longType()
+ .noDefaultValue()
+ .withDescription(
+ "Allow the user to configure the time (in seconds)
after which a scaling operation is triggered regardless if the requirements are
met");
Review Comment:
These 2 option types are better to update from long to Duration.
##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/Executing.java:
##########
@@ -39,14 +42,22 @@
import javax.annotation.Nullable;
import java.time.Duration;
+import java.time.Instant;
import java.util.List;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
/** State which represents a running job with an {@link ExecutionGraph} and
assigned slots. */
class Executing extends StateWithExecutionGraph implements ResourceListener {
private final Context context;
+ private Instant lastRescale = Instant.EPOCH;
+ private final ScheduledExecutorService scheduledExecutor =
Executors.newScheduledThreadPool(1);
Review Comment:
Should we create a new thread pool or use a old thread pool?
If we must create a new thread pool, it's better to add a thread factory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]