[ 
https://issues.apache.org/jira/browse/FLINK-4547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15469345#comment-15469345
 ] 

ASF GitHub Bot commented on FLINK-4547:
---------------------------------------

Github user beyond1920 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2455#discussion_r77754084
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
 ---
    @@ -189,7 +191,49 @@ public void stop() {
                rpcEndpoint.tell(Processing.STOP, ActorRef.noSender());
        }
     
    -   // 
------------------------------------------------------------------------
    +   @Override
    +   public boolean equals(Object o) {
    +           if (this == o) {
    +                   return true;
    +           }
    +
    +           if (o == null) {
    +                   return false;
    +           }
    +
    +           if(Proxy.isProxyClass(o.getClass())) {
    +                   return o.equals(this);
    +           }
    --- End diff --
    
    @tillrohrmann ,  It does not means that AkkaInvocationHandler be a proxy 
class. In fact it means if input parameter class is a proxy class, then return 
o.equals(this) result. Here is my reason.  when call connect method in 
AkkaRpcService, the returned gateway which is wrapped in Future is in fact a 
Proxy. When I call equals method to compare two gateway, the equals method of 
AkkaInvocationHandler will be called. But the input parameter is still another 
Gateway  which class is Proxy class instead of AkkaInvocationHandler. 


> Return same object when call connect method in AkkaRpcService using same 
> address and same rpc gateway class
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-4547
>                 URL: https://issues.apache.org/jira/browse/FLINK-4547
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Distributed Coordination
>            Reporter: zhangjing
>            Assignee: zhangjing
>
> Now every time call connect method in AkkaRpcService class using same address 
> and same rpc gateway class, the return gateway object is totally different 
> with each other which equals and hashcode are not same. 
> Maybe it’s reasonable to have the same result (equals return true, and 
> hashcode is same) when using the same address and same Gateway class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to