You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by tillrohrmann <gi...@git.apache.org> on 2017/11/28 11:49:20 UTC
[GitHub] flink pull request #5093: [FLINK-8150] [flip6] Expose TaskExecutor's Resourc...
GitHub user tillrohrmann opened a pull request:
https://github.com/apache/flink/pull/5093
[FLINK-8150] [flip6] Expose TaskExecutor's ResourceID as TaskExecutor id
## What is the purpose of the change
Before, the TaskExecutor's InstanceID was exposed as TaskExecutor id. This was wrong
since the InstanceID is bound the registration of a TaskExecutor whereas the
ResourceID is bound to the lifetime of the TaskExecutor. Thus, it is better to identify
the TaskExecutor by its ResourceID which does not change.
This commit changes the behaviour accordingly on the ResourceManager and the
TaskManagerDetailsHandler.
## Brief change log
## Verifying this change
- Added `ResourceManagerTest#testRequestTaskManagerInfo` to ensure that we can obtain the `TaskManagerInfo` for registered `TaskExecutors`.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tillrohrmann/flink fixTaskManagerId
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5093.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5093
----
commit 415e3da9b6bc8dd6071ca98966779f73b682b658
Author: Till Rohrmann <tr...@apache.org>
Date: 2017-11-28T11:43:39Z
[FLINK-8150] [flip6] Expose TaskExecutor's ResourceID as TaskExecutor id
Before, the TaskExecutor's InstanceID was exposed as TaskExecutor id. This was wrong
since the InstanceID is bound the registration of a TaskExecutor whereas the
ResourceID is bound to the lifetime of the TaskExecutor. Thus, it is better to identify
the TaskExecutor by its ResourceID which does not change.
This commit changes the behaviour accordingly on the ResourceManager and the
TaskManagerDetailsHandler.
----
---
[GitHub] flink pull request #5093: [FLINK-8150] [flip6] Expose TaskExecutor's Resourc...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/5093#discussion_r153524087
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/taskmanager/TaskManagerInfo.java ---
@@ -53,8 +53,8 @@
public static final String FIELD_NAME_HARDWARE = "hardware";
@JsonProperty(FIELD_NAME_INSTANCE_ID)
--- End diff --
Good point. Fixed with your commit.
---
[GitHub] flink pull request #5093: [FLINK-8150] [flip6] Expose TaskExecutor's Resourc...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/5093#discussion_r153524341
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/json/ResourceIDSerializer.java ---
@@ -29,16 +30,16 @@
/**
* Json serializer for {@link InstanceID}.
*/
-public class InstanceIDSerializer extends StdSerializer<InstanceID> {
+public class ResourceIDSerializer extends StdSerializer<ResourceID> {
private static final long serialVersionUID = 5798852092159615938L;
- protected InstanceIDSerializer() {
- super(InstanceID.class);
+ protected ResourceIDSerializer() {
+ super(ResourceID.class);
}
@Override
- public void serialize(InstanceID value, JsonGenerator gen, SerializerProvider provider) throws IOException {
+ public void serialize(ResourceID value, JsonGenerator gen, SerializerProvider provider) throws IOException {
gen.writeString(value.toString());
--- End diff --
Good point. Fixed with your commit.
---
[GitHub] flink pull request #5093: [FLINK-8150] [flip6] Expose TaskExecutor's Resourc...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/flink/pull/5093
---
[GitHub] flink pull request #5093: [FLINK-8150] [flip6] Expose TaskExecutor's Resourc...
Posted by GJL <gi...@git.apache.org>.
Github user GJL commented on a diff in the pull request:
https://github.com/apache/flink/pull/5093#discussion_r153482920
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/taskmanager/TaskManagerDetailsInfo.java ---
@@ -43,7 +43,7 @@
@JsonCreator
public TaskManagerDetailsInfo(
- @JsonDeserialize(using = InstanceIDDeserializer.class) @JsonProperty(FIELD_NAME_INSTANCE_ID) InstanceID instanceId,
+ @JsonDeserialize(using = ResourceIDDeserializer.class) @JsonProperty(FIELD_NAME_INSTANCE_ID) ResourceID resourceId,
--- End diff --
This should be named `FIELD_NAME_RESOURCE_ID`.
---
[GitHub] flink pull request #5093: [FLINK-8150] [flip6] Expose TaskExecutor's Resourc...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/5093#discussion_r153524037
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/taskmanager/TaskManagerDetailsInfo.java ---
@@ -43,7 +43,7 @@
@JsonCreator
public TaskManagerDetailsInfo(
- @JsonDeserialize(using = InstanceIDDeserializer.class) @JsonProperty(FIELD_NAME_INSTANCE_ID) InstanceID instanceId,
+ @JsonDeserialize(using = ResourceIDDeserializer.class) @JsonProperty(FIELD_NAME_INSTANCE_ID) ResourceID resourceId,
--- End diff --
Good point. Fixed with your commit.
---
[GitHub] flink pull request #5093: [FLINK-8150] [flip6] Expose TaskExecutor's Resourc...
Posted by GJL <gi...@git.apache.org>.
Github user GJL commented on a diff in the pull request:
https://github.com/apache/flink/pull/5093#discussion_r153483875
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/json/ResourceIDSerializer.java ---
@@ -29,16 +30,16 @@
/**
* Json serializer for {@link InstanceID}.
*/
-public class InstanceIDSerializer extends StdSerializer<InstanceID> {
+public class ResourceIDSerializer extends StdSerializer<ResourceID> {
private static final long serialVersionUID = 5798852092159615938L;
- protected InstanceIDSerializer() {
- super(InstanceID.class);
+ protected ResourceIDSerializer() {
+ super(ResourceID.class);
}
@Override
- public void serialize(InstanceID value, JsonGenerator gen, SerializerProvider provider) throws IOException {
+ public void serialize(ResourceID value, JsonGenerator gen, SerializerProvider provider) throws IOException {
gen.writeString(value.toString());
--- End diff --
Maybe `value.getResourceIdString()`.
---
[GitHub] flink pull request #5093: [FLINK-8150] [flip6] Expose TaskExecutor's Resourc...
Posted by GJL <gi...@git.apache.org>.
Github user GJL commented on a diff in the pull request:
https://github.com/apache/flink/pull/5093#discussion_r153483098
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/taskmanager/TaskManagerInfo.java ---
@@ -53,8 +53,8 @@
public static final String FIELD_NAME_HARDWARE = "hardware";
@JsonProperty(FIELD_NAME_INSTANCE_ID)
--- End diff --
Should be `FIELD_NAME_RESOURCE_ID`
---
[GitHub] flink issue #5093: [FLINK-8150] [flip6] Expose TaskExecutor's ResourceID as ...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the issue:
https://github.com/apache/flink/pull/5093
Thanks for the review @GJL.
---