dbwong commented on code in PR #1456:
URL: https://github.com/apache/phoenix/pull/1456#discussion_r901999186
##########
phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java:
##########
@@ -417,4 +418,27 @@ public static <T> Throwable
getExceptionFromFailedFuture(Future<T> f) {
}
return t;
}
+
+ /**
+ * Returns true if HBase namespace exists, else returns false
+ * @param admin HbaseAdmin Object
+ * @param schemaName Phoenix schema name for which we check existence of
the HBase namespace
+ * @return true if the HBase namespace exists, else returns false
+ * @throws SQLException If there is an exception checking the HBase
namespace
+ */
+ public static boolean isHBaseNamespaceAvailable(Admin admin, String
schemaName) throws IOException{
+ boolean namespaceExists = false;
+ try{
+ String[] hbaseNamespaces = admin.listNamespaces();
+ for(String namespace : hbaseNamespaces){
Review Comment:
nit: can we replace this with a utility method?
--
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]