xintongsong commented on a change in pull request #13063:
URL: https://github.com/apache/flink/pull/13063#discussion_r471960164
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceID.java
##########
@@ -32,9 +33,17 @@
private final String resourceId;
+ private final String metadata;
+
public ResourceID(String resourceId) {
+ this(resourceId, "");
+ }
+
+ public ResourceID(String resourceId, String metadata) {
Preconditions.checkNotNull(resourceId, "ResourceID must not be
null");
+ Preconditions.checkNotNull(metadata, "ResourceID must not be
null");
Review comment:
Unclear error messages.
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceID.java
##########
@@ -46,6 +55,10 @@ public final String getResourceIdString() {
return resourceId;
}
+ public final String getLogStringWithMetadata() {
+ return StringUtils.isNullOrWhitespaceOnly(metadata) ?
resourceId : String.format("[%s, %s]", resourceId, metadata);
Review comment:
Minor: not sure about the format `[%s, $s]`. `[]` are usually used for
arrays. I would suggest something like `%s(%s)`.
For the Flink Yarn deployment, the outputs would look like:
```
[container_xxxxxx_000001, foo.bar.hostname]
container_xxxxxx_000001(foo.bar.hostname)
```
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceID.java
##########
@@ -46,6 +55,10 @@ public final String getResourceIdString() {
return resourceId;
}
+ public final String getLogStringWithMetadata() {
Review comment:
I would suggest `toStringWithMetadata` or `getStringWithMetadata`.
It would be better that the method name describes what the methods does but
not assume how it is used.
##########
File path:
flink-core/src/main/java/org/apache/flink/configuration/TaskManagerOptionsInternal.java
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.flink.configuration;
+
+import org.apache.flink.annotation.Internal;
+
+import static org.apache.flink.configuration.ConfigOptions.key;
+
+/**
+ * TaskManager options that are not meant to be used by the user.
+ */
+@Internal
+public class TaskManagerOptionsInternal {
+
+ public static final ConfigOption<String>
TASK_MANAGER_RESOURCE_ID_METADATA =
+ key("internal.taskmanager.resource-id.metadata")
Review comment:
minor: usually we prepend a `$` to the internal config keys, to further
protect it. See `YarnConfigOptionsInternal` as an example.
----------------------------------------------------------------
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]