tillrohrmann commented on a change in pull request #12054:
URL: https://github.com/apache/flink/pull/12054#discussion_r442344479



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunner.java
##########
@@ -413,9 +413,10 @@ static BackPressureSampleService 
createBackPressureSampleService(
         * @param configuration The configuration for the TaskManager.
         * @param haServices to use for the task manager hostname retrieval
         */
-       public static RpcService createRpcService(
-                       final Configuration configuration,
-                       final HighAvailabilityServices haServices) throws 
Exception {
+       @VisibleForTesting
+       static RpcService createRpcService(
+               final Configuration configuration,
+               final HighAvailabilityServices haServices) throws Exception {

Review comment:
       Why is this change necessary?

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunner.java
##########
@@ -91,7 +93,8 @@
 
        private static final int STARTUP_FAILURE_RETURN_CODE = 1;
 
-       public static final int RUNTIME_FAILURE_RETURN_CODE = 2;
+       @VisibleForTesting

Review comment:
       Why is this necessary?

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunner.java
##########
@@ -306,10 +308,8 @@ public static void runTaskManager(Configuration 
configuration, ResourceID resour
                taskManagerRunner.start();
        }
 
-       public static void runTaskManagerSecurely(String[] args, ResourceID 
resourceID) {
+       public static void runTaskManagerSecurely(Configuration configuration, 
ResourceID resourceID) {
                try {
-                       final Configuration configuration = 
loadConfiguration(args);

Review comment:
       I would put the `ResourceID` generation here instead of moving the 
configuration loading out of this method.

##########
File path: 
flink-core/src/main/java/org/apache/flink/configuration/TaskManagerOptions.java
##########
@@ -257,6 +257,18 @@
                                        text("\"ip\" - uses host's ip address 
as binding address"))
                                .build());
 
+       /**
+        * The prefix of the TaskManager's ResourceID. If configured, the 
ResourceID will be generated with the prefix and a
+        * 6-character random string. Otherwise, a random string will be used. 
Only valid in standalone mode.
+        */
+       @Documentation.Section(Documentation.Sections.ALL_TASK_MANAGER)
+       public static final ConfigOption<String> 
TASK_MANAGER_RESOURCE_ID_PREFIX =
+               key("taskmanager.resource-id.prefix")
+                       .stringType()
+                       .noDefaultValue()
+                       .withDescription("The prefix of the TaskManager's 
ResourceID. If configured, the ResourceID will be generated with the prefix "
+                               + "and a 6-character random string. Otherwise, 
a random string will be used. Only valid in standalone mode.");

Review comment:
       Why is this only valid in standalone mode? Shouldn't we have a general 
mean how to configure the resource id for `TaskExecutors` in general? I believe 
it should work across the different integrations (Yarn, Mesos, K8s, standalone) 
all the same. The only difference would be to what value the different 
implementations set it.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to