diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java index c74a5e20fd8..347709833b1 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java @@ -413,7 +413,7 @@ public final class TableName implements Comparable { for (TableName tn : tableCache) { if (qualifierAsString.equals(tn.getQualifierAsString()) && - namespaceAsString.equals(tn.getNameAsString())) { + namespaceAsString.equals(tn.getNamespaceAsString())) { return tn; } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHFileLink.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHFileLink.java index eac3a6a54af..33bac39f257 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHFileLink.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHFileLink.java @@ -106,7 +106,8 @@ public class TestHFileLink { TableName.NAMESPACE_DELIM, '=') + "=" + encodedRegion + "-" + storeFileName; TableName tableNames[] = {TableName.valueOf(name.getMethodName() + "1"), - TableName.valueOf("ns", name.getMethodName() + "2")}; + TableName.valueOf("ns", name.getMethodName() + "2"), + TableName.valueOf(name.getMethodName()+ ":" +name.getMethodName())}; for( TableName tableName : tableNames) { Path tableDir = FSUtils.getTableDir(rootDir, tableName); @@ -116,7 +117,7 @@ public class TestHFileLink { //Verify back reference creation assertEquals(encodedRegion+"."+ tableName.getNameAsString().replace(TableName.NAMESPACE_DELIM, '='), - HFileLink.createBackReferenceName(tableName.getNameAsString(), + HFileLink.createBackReferenceName(FSUtils.getTableName(tableDir).getNameAsString(), encodedRegion)); //verify parsing back reference