Commit fccfe919 by rmani Committed by Madhan Neethiraj

ATLAS-2680: import-hbase fails to match namespaces for the given regex

parent 3b75d56d
......@@ -56,6 +56,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class HBaseBridge {
......@@ -324,11 +325,13 @@ public class HBaseBridge {
private List<NamespaceDescriptor> getMatchingNameSpaces(String nameSpace) throws Exception {
List<NamespaceDescriptor> ret = new ArrayList<>();
NamespaceDescriptor[] namespaceDescriptors = hbaseAdmin.listNamespaceDescriptors();
Pattern pattern = Pattern.compile(nameSpace);
for (NamespaceDescriptor namespaceDescriptor:namespaceDescriptors){
String nmSpace = namespaceDescriptor.getName();
Matcher matcher = pattern.matcher(nmSpace);
if (nmSpace.matches(nameSpace)){
if (matcher.find()){
ret.add(namespaceDescriptor);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment