-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26214 Introduce a ConnectionRegistryEndpoint interface #3613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
* Define the necessary method for carrying {@code ClientMetaService}. | ||
*/ | ||
@InterfaceAudience.Private | ||
public interface ConnectionRegistryEndpoint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you just do, this doesn't work for any reason?
public interface ServerConnectionRegistry extends ConnectionRegistry {}
HRegionServer implements ServerConnectionRegistry {
setupConnection(this);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having two interfaces that look very much alike is only adding to the confusion of the code readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a prior work for undoing HMaster extends HRegionServer. If HMaster does not extends HRegionServer, then it can not use RegionServerRegistry any more. So I agree with you that in the current code it is not necessary to do this refactoring, but I think it is also no big harm? If we could land this first, the final patch for HBASE-25288 could be smaller. But anyway, I respect your decision, if you do not think this is good to land, I’m OK that we just close this one and include this patch in the final patch for HBASE-25288.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should land this (thanks for your other patch btw). All I'm saying is perhaps we could do this refactor without creating another new interface ConnectionRegistryEndpoint that looks exactly like ConnectionRegistry? (like I mentioned in my first comment, pasting again below). This seems simpler than your patch, right, you can use 'this' instance as the registry object in both HMaster and HRegionServer, don't have to construct something explicit? or did I miss something?
public interface ServerConnectionRegistry extends ConnectionRegistry {}
HMaster implements ServerConnectionRegistry {
<Implement master based registry server side>
}
HRegionServer implements ServerConnectionRegistry {
<Implement RegionServerRegistry server side here>
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, got it. Let me have a try. Was wondering that returning a CompletableFuture at server side while there is no actual asynchronous in code is a bit strange, but seems no big real harm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I know why I introduce a special interface then, we need to use these methods in RSRpcServices and MasterRpcServices too, to return these information to connection registry running at client side.
It will be a bit strange that, we get a CompletableFuture which is not async actually...
WDYT? You can take a look at the code in RSRpcService.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
No description provided.