SWH12 commented on code in PR #5884:
URL: https://github.com/apache/hbase/pull/5884#discussion_r1776149863
##########
bin/replication/copy_tables_desc.rb:
##########
@@ -39,6 +39,17 @@ def usage
exit!
end
+def create_namespace_if_not_exists(dst, namespace)
+ begin
+ dst.getNamespaceDescriptor(namespace)
+ puts format('Namespace "%s" already exists.', namespace)
+ rescue org.apache.hadoop.hbase.NamespaceNotFoundException
+ descriptor =
org.apache.hadoop.hbase.NamespaceDescriptor.create(namespace).build()
+ dst.createNamespace(descriptor)
Review Comment:
The namespace of the source cluster is obtained using the method namespace =
TableName.valueOf(table).getNamespaceAsString. In
create_namespace_if_not_exists, dst.getNamespaceDescriptor(namespace) is used
to check if the specified namespace exists in the target cluster, and if it
does not exist, it is created.
--
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]