You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2020/02/18 08:04:04 UTC

[flink] 05/05: [hotfix][config] Adjust AkkaOptions to new type-safe pattern

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

sewen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 5b71c7f2fe36c760924848295a8090898cb10f15
Author: Stephan Ewen <se...@apache.org>
AuthorDate: Mon Feb 17 19:35:35 2020 +0100

    [hotfix][config] Adjust AkkaOptions to new type-safe pattern
---
 .../apache/flink/configuration/AkkaOptions.java    | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/flink-core/src/main/java/org/apache/flink/configuration/AkkaOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/AkkaOptions.java
index bdecb2e..e9b3002 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/AkkaOptions.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/AkkaOptions.java
@@ -46,6 +46,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<String> ASK_TIMEOUT = ConfigOptions
 		.key("akka.ask.timeout")
+		.stringType()
 		.defaultValue("10 s")
 		.withDescription("Timeout used for all futures and blocking Akka calls. If Flink fails due to timeouts then you" +
 			" should try to increase this value. Timeouts can be caused by slow machines or a congested network. The" +
@@ -55,6 +56,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<String> TCP_TIMEOUT = ConfigOptions
 		.key("akka.tcp.timeout")
+		.stringType()
 		.defaultValue("20 s")
 		.withDescription("Timeout for all outbound connections. If you should experience problems with connecting to a" +
 			" TaskManager due to a slow network, you should increase this value.");
@@ -64,6 +66,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<String> STARTUP_TIMEOUT = ConfigOptions
 		.key("akka.startup-timeout")
+		.stringType()
 		.noDefaultValue()
 		.withDescription("Timeout after which the startup of a remote component is considered being failed.");
 
@@ -72,6 +75,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<String> TRANSPORT_HEARTBEAT_INTERVAL = ConfigOptions
 		.key("akka.transport.heartbeat.interval")
+		.stringType()
 		.defaultValue("1000 s")
 		.withDescription("Heartbeat interval for Akka’s transport failure detector. Since Flink uses TCP, the detector" +
 			" is not necessary. Therefore, the detector is disabled by setting the interval to a very high value. In" +
@@ -83,6 +87,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<String> TRANSPORT_HEARTBEAT_PAUSE = ConfigOptions
 		.key("akka.transport.heartbeat.pause")
+		.stringType()
 		.defaultValue("6000 s")
 		.withDescription("Acceptable heartbeat pause for Akka’s transport failure detector. Since Flink uses TCP, the" +
 			" detector is not necessary. Therefore, the detector is disabled by setting the pause to a very high value." +
@@ -94,6 +99,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<Double> TRANSPORT_THRESHOLD = ConfigOptions
 		.key("akka.transport.threshold")
+		.doubleType()
 		.defaultValue(300.0)
 		.withDescription("Threshold for the transport failure detector. Since Flink uses TCP, the detector is not" +
 			" necessary and, thus, the threshold is set to a high value.");
@@ -103,6 +109,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<Boolean> SSL_ENABLED = ConfigOptions
 		.key("akka.ssl.enabled")
+		.booleanType()
 		.defaultValue(true)
 		.withDescription("Turns on SSL for Akka’s remote communication. This is applicable only when the global ssl flag" +
 			" security.ssl.enabled is set to true.");
@@ -112,6 +119,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<String> FRAMESIZE = ConfigOptions
 		.key("akka.framesize")
+		.stringType()
 		.defaultValue("10485760b")
 		.withDescription("Maximum size of messages which are sent between the JobManager and the TaskManagers. If Flink" +
 			" fails because messages exceed this limit, then you should increase it. The message size requires a" +
@@ -122,6 +130,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<Integer> DISPATCHER_THROUGHPUT = ConfigOptions
 		.key("akka.throughput")
+		.intType()
 		.defaultValue(15)
 		.withDescription("Number of messages that are processed in a batch before returning the thread to the pool. Low" +
 			" values denote a fair scheduling whereas high values can increase the performance at the cost of unfairness.");
@@ -131,6 +140,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<Boolean> LOG_LIFECYCLE_EVENTS = ConfigOptions
 		.key("akka.log.lifecycle.events")
+		.booleanType()
 		.defaultValue(false)
 		.withDescription("Turns on the Akka’s remote logging of events. Set this value to 'true' in case of debugging.");
 
@@ -139,6 +149,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<String> LOOKUP_TIMEOUT = ConfigOptions
 		.key("akka.lookup.timeout")
+		.stringType()
 		.defaultValue("10 s")
 		.withDescription("Timeout used for the lookup of the JobManager. The timeout value has to contain a time-unit" +
 			" specifier (ms/s/min/h/d).");
@@ -148,6 +159,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<String> CLIENT_TIMEOUT = ConfigOptions
 		.key("akka.client.timeout")
+		.stringType()
 		.defaultValue("60 s")
 		.withDescription("Timeout for all blocking calls on the client side.");
 
@@ -156,6 +168,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<Boolean> JVM_EXIT_ON_FATAL_ERROR = ConfigOptions
 		.key("akka.jvm-exit-on-fatal-error")
+		.booleanType()
 		.defaultValue(true)
 		.withDescription("Exit JVM on fatal Akka errors.");
 
@@ -164,6 +177,7 @@ public class AkkaOptions {
 	 */
 	public static final ConfigOption<Long> RETRY_GATE_CLOSED_FOR = ConfigOptions
 		.key("akka.retry-gate-closed-for")
+		.longType()
 		.defaultValue(50L)
 		.withDescription("Milliseconds a gate should be closed for after a remote connection was disconnected.");
 
@@ -173,6 +187,7 @@ public class AkkaOptions {
 
 	public static final ConfigOption<Double> FORK_JOIN_EXECUTOR_PARALLELISM_FACTOR = ConfigOptions
 		.key("akka.fork-join-executor.parallelism-factor")
+		.doubleType()
 		.defaultValue(2.0)
 		.withDescription(Description.builder()
 			.text("The parallelism factor is used to determine thread pool size using the" +
@@ -182,12 +197,14 @@ public class AkkaOptions {
 
 	public static final ConfigOption<Integer> FORK_JOIN_EXECUTOR_PARALLELISM_MIN = ConfigOptions
 		.key("akka.fork-join-executor.parallelism-min")
+		.intType()
 		.defaultValue(8)
 		.withDescription(Description.builder()
 			.text("Min number of threads to cap factor-based parallelism number to.").build());
 
 	public static final ConfigOption<Integer> FORK_JOIN_EXECUTOR_PARALLELISM_MAX = ConfigOptions
 		.key("akka.fork-join-executor.parallelism-max")
+		.intType()
 		.defaultValue(64)
 		.withDescription(Description.builder()
 			.text("Max number of threads to cap factor-based parallelism number to.").build());
@@ -198,18 +215,21 @@ public class AkkaOptions {
 
 	public static final ConfigOption<Integer> CLIENT_SOCKET_WORKER_POOL_SIZE_MIN = ConfigOptions
 		.key("akka.client-socket-worker-pool.pool-size-min")
+		.intType()
 		.defaultValue(1)
 		.withDescription(Description.builder()
 			.text("Min number of threads to cap factor-based number to.").build());
 
 	public static final ConfigOption<Integer> CLIENT_SOCKET_WORKER_POOL_SIZE_MAX = ConfigOptions
 		.key("akka.client-socket-worker-pool.pool-size-max")
+		.intType()
 		.defaultValue(2)
 		.withDescription(Description.builder()
 			.text("Max number of threads to cap factor-based number to.").build());
 
 	public static final ConfigOption<Double> CLIENT_SOCKET_WORKER_POOL_SIZE_FACTOR = ConfigOptions
 		.key("akka.client-socket-worker-pool.pool-size-factor")
+		.doubleType()
 		.defaultValue(1.0)
 		.withDescription(Description.builder()
 			.text("The pool size factor is used to determine thread pool size" +
@@ -224,18 +244,21 @@ public class AkkaOptions {
 
 	public static final ConfigOption<Integer> SERVER_SOCKET_WORKER_POOL_SIZE_MIN = ConfigOptions
 		.key("akka.server-socket-worker-pool.pool-size-min")
+		.intType()
 		.defaultValue(1)
 		.withDescription(Description.builder()
 			.text("Min number of threads to cap factor-based number to.").build());
 
 	public static final ConfigOption<Integer> SERVER_SOCKET_WORKER_POOL_SIZE_MAX = ConfigOptions
 		.key("akka.server-socket-worker-pool.pool-size-max")
+		.intType()
 		.defaultValue(2)
 		.withDescription(Description.builder()
 			.text("Max number of threads to cap factor-based number to.").build());
 
 	public static final ConfigOption<Double> SERVER_SOCKET_WORKER_POOL_SIZE_FACTOR = ConfigOptions
 		.key("akka.server-socket-worker-pool.pool-size-factor")
+		.doubleType()
 		.defaultValue(1.0)
 		.withDescription(Description.builder()
 			.text("The pool size factor is used to determine thread pool size" +