Uh oh!
There was an error while loading. Please reload this page.
HBASE-24683 Add a basic ReplicationServer which only implement Replic… - #2111
Conversation
Apache-HBase
commented
Jul 21, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 21, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 21, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 22, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 22, 2020
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Jul 22, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 10, 2020
💔 -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.
Do not need to implements RegionServerServices?
There was a problem hiding this comment.
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.
Yean, let me remove implements RegionServerServices.
| */ | ||
| @InterfaceAudience.Private | ||
| @SuppressWarnings("deprecation") | ||
| public class ReplicationServerRpcServices implements HBaseRPCErrorHandler, |
There was a problem hiding this comment.
No need to impl AdminService.BlockingInterface?
infraio
commented
Aug 10, 2020
@ddupg Please rebase HBASE-24666 and push again. |
wchevreuil
left a comment
There was a problem hiding this comment.
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.
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?
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Why having these two methods? setupReplication apparently doing nothing extra to _ createNewReplicationInstance_.
| 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.
Why all those null params? Can we remove those from the interface?
There was a problem hiding this comment.
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.
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.
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.
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.
ddupg
commented
Aug 21, 2020
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. |
Apache-HBase
commented
Aug 21, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 21, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 21, 2020
🎊 +1 overall
This message was automatically generated. |
e4b4ab3 to
a9d89a7CompareApache-HBase
commented
Sep 4, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 4, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 4, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 4, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 4, 2020
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 4, 2020
🎊 +1 overall
This message was automatically generated. |
…ationSink Service (apache#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service (#2111) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…ationSink Service