You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/01/07 08:20:50 UTC

[GitHub] [hbase] cuibo01 commented on a change in pull request #2779: HBASE-23340 hmaster /hbase/replication/rs session expired (hbase repl…

cuibo01 commented on a change in pull request #2779:
URL: https://github.com/apache/hbase/pull/2779#discussion_r553172257



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/ReplicationLogCleaner.java
##########
@@ -92,12 +96,20 @@ public boolean apply(FileStatus file) {
   }
 
   @Override
-  public void setConf(Configuration config) {
-    // Make my own Configuration.  Then I'll have my own connection to zk that
-    // I can close myself when comes time.
-    Configuration conf = new Configuration(config);
+  public void init(Map<String, Object> params) {
+    super.init(params);
     try {
-      setConf(conf, new ZKWatcher(conf, "replicationLogCleaner", null));
+      if (MapUtils.isNotEmpty(params)) {
+        Object master = params.get(HMaster.MASTER);
+        if (master != null && master instanceof HMaster) {
+          zkw = ((HMaster) master).getZooKeeper();
+          shareZK = true;

Review comment:
       yes,it is bettetr. But it is impossible that HMaster.getZooKeeper returns null,and if zk of hmaster is null, master must be abort. 
   
   




----------------------------------------------------------------
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:
users@infra.apache.org