-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-24999 Master manages ReplicationServers #2579
Conversation
💔 -1 overall
This message was automatically generated. |
ecbfcdb
to
00f78ba
Compare
💔 -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. |
* server from the original instance. | ||
*/ | ||
@InterfaceAudience.Private | ||
public class ReplicationServerManager { |
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.
Would it make sense to extend ServerManager
, or maybe both this one and ServerManager
could implement a common interface? It seems there is a common workflow for server managers.
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.
Yes. But we want do this refator after we finished this, because ReplicationServerManager may have new featrues but ServerManager not need. It is not easy to decide that extend ServerManager or implement a common interface. Thanks.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/ReplicationServerManager.java
Show resolved
Hide resolved
} | ||
return peerConnection; | ||
} | ||
|
||
/** | ||
* Get the list of all the servers that are responsible for replication sink | ||
* from the specified peer master | ||
* @return list of server addresses or an empty list if the slave is unavailable |
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.
Is it true that an empty list would be returned if we can't reach slave master? Looks like we either throw an IOException or a RemoteException.
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.
Yes, I ignored changing the comment.
Fixed it.
00f78ba
to
6140c03
Compare
💔 -1 overall
This message was automatically generated. |
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* The ServerManager class manages info about replication servers. |
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.
ServerManager => ReplicationServerManager?
* @param sl the server load on the server | ||
* @return true if the server is recorded, otherwise, false | ||
*/ | ||
boolean checkAndRecordNewServer(final ServerName serverName, final ServerMetrics sl) { |
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.
private method?
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HBaseReplicationEndpoint.java
Show resolved
Hide resolved
@@ -388,4 +446,152 @@ protected ReplicationServerRpcServices createRpcServices() throws IOException { | |||
protected boolean setAbortRequested() { | |||
return abortRequested.compareAndSet(false, true); | |||
} | |||
|
|||
protected void tryReplicationServerReport(long reportStartTime, long reportEndTime) |
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.
private method is enough?
* @param refresh If true then master address will be read from ZK, otherwise use cached data | ||
* @return master + port, or null if server has been stopped | ||
*/ | ||
protected synchronized ServerName createReplicationServerStatusStub(boolean refresh) { |
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.
Ditto.
Add master UI to show ReplicationServer? |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
6140c03
to
cb2c73f
Compare
Thanks @infraio for reviewing. I have fixed as comments.
Do it in this PR? I was going to do it in a new PR? |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Ok. Let's do it in follow-on PR. |
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
Show resolved
Hide resolved
* @param refresh If true then master address will be read from ZK, otherwise use cached data | ||
* @return master + port, or null if server has been stopped | ||
*/ | ||
private synchronized ServerName createReplicationServerStatusStub(boolean refresh) { |
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.
The return ServerName never used?
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.
It should be useful, let me fix it.
cb2c73f
to
a84cabf
Compare
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
The spotbugs warnings is about HBASE-24666, not about this PR. And this PR fixed thems. "hbase-server generated 0 new + 0 unchanged - 3 fixed = 0 total (was 3)" |
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
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
No description provided.