wchevreuil commented on a change in pull request #2071:
URL: https://github.com/apache/hbase/pull/2071#discussion_r454901025
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java
##########
@@ -337,25 +347,21 @@ public void removeAllQueuesAndHFileRefs(String peerId)
throws ReplicationExcepti
private void checkPeerConfig(ReplicationPeerConfig peerConfig) throws
DoNotRetryIOException {
String replicationEndpointImpl = peerConfig.getReplicationEndpointImpl();
- boolean checkClusterKey = true;
+ ReplicationEndpoint endpoint = null;
if (!StringUtils.isBlank(replicationEndpointImpl)) {
- // try creating a instance
- ReplicationEndpoint endpoint;
try {
+ // try creating a instance
endpoint = Class.forName(replicationEndpointImpl)
.asSubclass(ReplicationEndpoint.class).getDeclaredConstructor().newInstance();
} catch (Throwable e) {
throw new DoNotRetryIOException(
"Can not instantiate configured replication endpoint class=" +
replicationEndpointImpl,
e);
}
- // do not check cluster key if we are not
HBaseInterClusterReplicationEndpoint
- if (!(endpoint instanceof HBaseInterClusterReplicationEndpoint)) {
- checkClusterKey = false;
- }
}
- if (checkClusterKey) {
- checkClusterKey(peerConfig.getClusterKey());
+ // Default is HBaseInterClusterReplicationEndpoint and only it need to
check cluster key
+ if (endpoint == null || endpoint instanceof
HBaseInterClusterReplicationEndpoint) {
Review comment:
Just a thought while going through this code, not required for the
objective of this PR: as mentioned on the code comment, this is specific for
HBaseInterClusterReplicationEndpoint, so shouldn't we define a checkClusterKey
method on ReplicationEndpoint (with a default implementation), and implement
this check specific for HBaseInterClusterReplicationEndpoint in
HBaseInterClusterReplicationEndpoint?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]