-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-24683 Add a basic ReplicationServer which only implement Replic… #2111
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. |
| */ | ||
| @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS) | ||
| @SuppressWarnings({ "deprecation"}) | ||
| public class HReplicationServer extends Thread implements Server, RegionServerServices { |
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.
Do not need to implements RegionServerServices?
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.
Have similar feeling, given the high number of methods where an implementation is not applicable in this context.
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.
Yean, let me remove implements RegionServerServices.
| */ | ||
| @InterfaceAudience.Private | ||
| @SuppressWarnings("deprecation") | ||
| public class ReplicationServerRpcServices implements HBaseRPCErrorHandler, |
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.
No need to impl AdminService.BlockingInterface?
|
@ddupg Please rebase HBASE-24666 and push again. |
wchevreuil
left a comment
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.
Sorry, this a large PR, may rather do incremental reviews. Had put some minor observations, but one thing I had not understood so far is how ReplicationServers will choose which specific WALs each running server would track. Can you shed some light on this? Perhaps, pointing me to some code snippets where this is actually implemented.
|
|
||
| protected final Configuration conf; | ||
|
|
||
| private ReplicationSinkService replicationSinkHandler; |
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.
At the level of HReplicationServer, we only need to call methods from ReplicationService. I found a bit confusing that we were referring directly a sink only here, until I realised replicationSinkHandler is an instance of Replication. Can we just refer to ReplicationService interface here?
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/HReplicationServer.java
Outdated
Show resolved
Hide resolved
| private void setupReplication() throws IOException { | ||
| // Instantiate replication if replication enabled. Pass it the log directories. | ||
| createNewReplicationInstance(conf, this); | ||
| } | ||
|
|
||
| /** | ||
| * Load the replication executorService objects, if any | ||
| */ | ||
| private static void createNewReplicationInstance(Configuration conf, HReplicationServer server) | ||
| throws IOException { | ||
| // read in the name of the sink replication class from the config file. | ||
| String sinkClassname = conf.get(HConstants.REPLICATION_SINK_SERVICE_CLASSNAME, | ||
| HConstants.REPLICATION_SERVICE_CLASSNAME_DEFAULT); | ||
|
|
||
| server.replicationSinkHandler = newReplicationInstance(sinkClassname, | ||
| ReplicationSinkService.class, conf, server); | ||
| } |
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.
Why having these two methods? setupReplication apparently doing nothing extra to _ createNewReplicationInstance_.
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, let me remove one of them.
| throw new IOException("Could not find class for " + classname); | ||
| } | ||
| T service = ReflectionUtils.newInstance(clazz, conf); | ||
| service.initialize(server, null, null, null, null); |
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.
Why all those null params? Can we remove those from the interface?
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.
Those null params are about replication source, not replication sink. For this issue, ReplicationServer is only responsible for sink.
Those extra params are useless for sink, and I also think it’s weird that ReplicationSinkService use the same params with ReplicationSourceService. But if we need to refactor these interfaces, that should be in an another issue.
| } | ||
|
|
||
| @Override | ||
| public FlushRequester getFlushRequester() { |
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.
Should throw UnsupportedOperationException? (And same applies to all non implemented methods currently returning null).
| */ | ||
| @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS) | ||
| @SuppressWarnings({ "deprecation"}) | ||
| public class HReplicationServer extends Thread implements Server, RegionServerServices { |
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.
Have similar feeling, given the high number of methods where an implementation is not applicable in this context.
| final RpcServerInterface rpcServer; | ||
| final InetSocketAddress isa; | ||
|
|
||
| @VisibleForTesting |
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.
There's been a discussion, lately, about removing VisibleForTesting annotation, since it's not mentioned on our compatibility promises. The outcome is that we should rather rely on IA.Private only, and avoid VisibleForTesting.
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.
Got it.
For this issue, just add a basic ReplicationServer, which is only responsible for replication sink, not for source yet. So for now, it only holds and implements sink stuff. In future issues, will move replication source stuff here. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
e4b4ab3 to
a9d89a7
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. |
…ationSink Service
|
🎊 +1 overall
This message was automatically generated. |
infraio
left a comment
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
|
🎊 +1 overall
This message was automatically generated. |
…ationSink Service (apache#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <[email protected]>
…ationSink Service