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/07/23 01:51:34 UTC

[GitHub] [hbase] Apache9 commented on a change in pull request #3523: HBASE-26115 - ServerTestHBaseCluster interface for testing coprocs

Apache9 commented on a change in pull request #3523:
URL: https://github.com/apache/hbase/pull/3523#discussion_r675262428



##########
File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseCommonTestingUtil.java
##########
@@ -40,7 +40,9 @@
 /**
  * Common helpers for testing HBase that do not depend on specific server/etc. things.
  */
-@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.PHOENIX)
+@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC,

Review comment:
       Ah, in general let's not do this.
   
   Mark it as IA.LP("Phoenix") is already a compromise, let's not add more compromise here...

##########
File path: hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/ServerTestingHBaseCluster.java
##########
@@ -0,0 +1,50 @@
+/**
+ * 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.testing;
+
+import org.apache.hadoop.hbase.HBaseInterfaceAudience;
+import org.apache.hadoop.hbase.HBaseTestingUtil;
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * This interface is intended for uncommon testing use cases which need to access internal state
+ * on an HBase minicluster. This may be necessary when testing code which runs within an HBase
+ * server process, such as coprocessors or replication endpoints. It provides access to the
+ * underlying {@link HBaseTestingUtil}, which its parent {@link TestingHBaseCluster} interface
+ * intentionally does not. External use cases that just need to test their code using the HBase
+ * client API should use {@link TestingHBaseCluster} instead.
+ */
+@InterfaceAudience.LimitedPrivate(
+  {HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.REPLICATION,
+    HBaseInterfaceAudience.PHOENIX})
+public interface ServerTestingHBaseCluster extends TestingHBaseCluster {
+  /**
+   *
+   * @return the utility running the minicluster
+   */
+  HBaseTestingUtil getUtil();

Review comment:
       This is a no no.
   
   Let's find another way to only expose the necessary methods for testing coprocessors and other server side hooks such as tags. The point here is, HBaseTestingUtil is a class, not an interface, which makes very hard for the HBase developper to make it stable while keeping it clean.




-- 
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: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org