You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by wenlong88 <gi...@git.apache.org> on 2016/08/22 06:08:56 UTC
[GitHub] flink pull request #2401: [FLInk-4443][rpc] Add support in RpcCompletenessTe...
GitHub user wenlong88 opened a pull request:
https://github.com/apache/flink/pull/2401
[FLInk-4443][rpc] Add support in RpcCompletenessTest for inheritance of RpcGateway and RpcEndpoint
adding support for RpcCompletenessTest needs to support RpcGateway which is composited by some basic functions like following:
```
public interface ExecutionStateListener extends RpcGateway {
public void notifyExecutionStateChanges();
}
public interface JobStateListener extends RpcGateway {
public void notifyJobStateChanges();
}
public interface JobWatcher extends ExecutionStateListener, JobStateListener, RpcGateway {
}
public class JobWatcherEndpoint extends RpcEndpoint<JobWatcher> {
protected JobWatcherEndpoint(RpcService rpcService) {
super(rpcService);
}
@RpcMethod
public void notifyExecutionStateChanges() {
}
@RpcMethod
public void notifyJobStateChanges() {
}
}
public class AttachedJobClient extends JobWatcherEndpoint {
protected JobClient(RpcService rpcService) {
super(rpcService);
}
}
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/alibaba/flink flink-4443
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2401.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 #2401
----
commit 83b46df346d3626aa15f690c449d17fe3218014e
Author: wenlong.lwl <we...@alibaba-inc.com>
Date: 2016-08-20T16:46:51Z
add support for rpc gateway and rpc endpoint inheritance
commit b471bd249fbc40a23c6d32e5840c5ab95d693f75
Author: wenlong.lwl <we...@alibaba-inc.com>
Date: 2016-08-22T05:33:33Z
update comments
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTe...
Posted by wenlong88 <gi...@git.apache.org>.
GitHub user wenlong88 reopened a pull request:
https://github.com/apache/flink/pull/2401
[FLINK-4443][rpc] Add support in RpcCompletenessTest for inheritance of RpcGateway and RpcEndpoint
RpcCompletenessTest needs to support RpcGateway which is composited by some basic functions like following:
```
public interface ExecutionStateListener extends RpcGateway {
public void notifyExecutionStateChanges();
}
public interface JobStateListener extends RpcGateway {
public void notifyJobStateChanges();
}
public interface JobWatcher extends ExecutionStateListener, JobStateListener, RpcGateway {
}
public class JobWatcherEndpoint extends RpcEndpoint<JobWatcher> {
protected JobWatcherEndpoint(RpcService rpcService) {
super(rpcService);
}
@RpcMethod
public void notifyExecutionStateChanges() {
}
@RpcMethod
public void notifyJobStateChanges() {
}
}
public class AttachedJobClient extends JobWatcherEndpoint {
protected JobClient(RpcService rpcService) {
super(rpcService);
}
}
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/alibaba/flink flink-4443
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2401.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 #2401
----
commit 83b46df346d3626aa15f690c449d17fe3218014e
Author: wenlong.lwl <we...@alibaba-inc.com>
Date: 2016-08-20T16:46:51Z
add support for rpc gateway and rpc endpoint inheritance
commit b471bd249fbc40a23c6d32e5840c5ab95d693f75
Author: wenlong.lwl <we...@alibaba-inc.com>
Date: 2016-08-22T05:33:33Z
update comments
commit dc9d435f7bd732b5f75e228e65ffcad278e3d28b
Author: wenlong.lwl <we...@alibaba-inc.com>
Date: 2016-08-23T01:53:31Z
remove native method annotation
commit 37b4f01b4c207ace518b3af842c015537a183e55
Author: wenlong.lwl <we...@alibaba-inc.com>
Date: 2016-08-23T02:46:28Z
add line break
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTest for ...
Posted by wenlong88 <gi...@git.apache.org>.
Github user wenlong88 commented on the issue:
https://github.com/apache/flink/pull/2401
@tillrohrmann all comments addressed. I have removed the `NativeMethod` annotation.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTest for ...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the issue:
https://github.com/apache/flink/pull/2401
Thanks for your contribution @wenlong88. Your changes look good to me. I only had a comment concerning the `NativeMethod` annotation. I think that at the moment we could get along without it by considering all `RpcGateway` methods implicitly native. That would simplify decrease the complexity a little bit because we can get rid of/not introduce another annotation. What do you think?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTest for ...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the issue:
https://github.com/apache/flink/pull/2401
Great @wenlong88. Changes look good to me. Will merge your PR. Thanks a lot for your contribution :-) Please close the PR after I've merged it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTe...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/2401#discussion_r75690212
--- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/rpc/RpcCompletenessTest.java ---
@@ -337,4 +337,25 @@ private static boolean isRpcTimeout(Annotation[] annotations) {
throw new RuntimeException("Could not retrive basic type information for primitive type " + primitveType + '.');
}
}
+
+ /**
+ * Extract all rpc methods defined by the gateway interface
+ * @param interfaceClass the given rpc gateway interface
+ * @return all methods defined by the given interface
+ */
+ private List<Method> getRpcMethodsFromGateway(Class<? extends RpcGateway> interfaceClass) {
--- End diff --
Here we would simply test if `interfaceClass` is of type `RpcGateway` and if so, then return an empty list.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTe...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/2401#discussion_r75690051
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcGateway.java ---
@@ -28,5 +28,6 @@
*
* @return Fully qualified address under which the associated rpc endpoint is reachable
*/
+ @NativeMethod
String getAddress();
--- End diff --
Can't we simply say that all methods defined in `RpcGateway` are implicitly a *native* method. Then we could save the `@NativeMethod` annotation.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTe...
Posted by wenlong88 <gi...@git.apache.org>.
Github user wenlong88 closed the pull request at:
https://github.com/apache/flink/pull/2401
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTe...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/2401#discussion_r75690285
--- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/rpc/RpcCompletenessTest.java ---
@@ -337,4 +337,25 @@ private static boolean isRpcTimeout(Annotation[] annotations) {
throw new RuntimeException("Could not retrive basic type information for primitive type " + primitveType + '.');
}
}
+
+ /**
+ * Extract all rpc methods defined by the gateway interface
+ * @param interfaceClass the given rpc gateway interface
+ * @return all methods defined by the given interface
+ */
+ private List<Method> getRpcMethodsFromGateway(Class<? extends RpcGateway> interfaceClass) {
+ if(!interfaceClass.isInterface()) {
+ fail(interfaceClass.getName() + "is not a interface");
+ }
+ ArrayList<Method> allMethods = new ArrayList<>();
+ for(Method method : interfaceClass.getDeclaredMethods()) {
+ if (!method.isAnnotationPresent(NativeMethod.class)) {
+ allMethods.add(method);
+ }
+ }
--- End diff --
line break missing
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2401: [FLINK-4443][rpc] Add support in RpcCompletenessTe...
Posted by wenlong88 <gi...@git.apache.org>.
Github user wenlong88 closed the pull request at:
https://github.com/apache/flink/pull/2401
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---