Apache9 commented on code in PR #4855:
URL: https://github.com/apache/hbase/pull/4855#discussion_r1008703592


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/ReplicationPeerManager.java:
##########
@@ -271,6 +271,15 @@ private void setPeerState(String peerId, boolean enabled) 
throws ReplicationExce
       desc.getSyncReplicationState()));
   }
 
+  public boolean getPeerState(String peerId) throws ReplicationException {

Review Comment:
   Better add a method to get the ReplicationPeerDescription? Anyway, not a big 
problem since this class is IA.Private.



##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java:
##########
@@ -2555,4 +2555,12 @@ List<LogEntry> getLogEntries(Set<ServerName> 
serverNames, String logType, Server
    * Flush master local region
    */
   void flushMasterStore() throws IOException;
+
+  /**
+   * Check if a replication peer is enabled.
+   * @param peerId id of replication peer to check
+   * @return <code>true</code> if replication peer is enabled
+   * @throws IOException if a remote or network exception occurs
+   */
+  boolean isReplicationPeerEnabled(String peerId) throws IOException;

Review Comment:
   Better put this method together with other replication related method :)



##########
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestGetReplicationPeerState.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.replication;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.testclassification.LargeTests;
+import org.apache.hadoop.hbase.testclassification.ReplicationTests;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+@Category({ ReplicationTests.class, LargeTests.class })
+public class TestGetReplicationPeerState extends TestReplicationBase {
+
+  @ClassRule
+  public static final HBaseClassTestRule CLASS_RULE =
+    HBaseClassTestRule.forClass(TestGetReplicationPeerState.class);
+
+  @Test
+  public void testGetReplicationPeerState() throws Exception {

Review Comment:
   Can we add this to another existing test classes?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to