hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-18743 HFiles in use by a table which has the same name and namespace with a default table cloned from snapshot may be deleted when that snapshot and default table are deleted (wenbang)
Date Sun, 03 Sep 2017 14:11:23 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 a37417c25 -> c762753b4


HBASE-18743 HFiles in use by a table which has the same name and namespace with a default
table cloned from snapshot may be deleted when that snapshot and default table are deleted
(wenbang)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/c762753b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/c762753b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/c762753b

Branch: refs/heads/branch-2
Commit: c762753b4ba98c4e17abb020d63d6f78abc61bc2
Parents: a37417c
Author: tedyu <yuzhihong@gmail.com>
Authored: Sun Sep 3 07:11:16 2017 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Sun Sep 3 07:11:16 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/TableName.java        | 2 +-
 .../src/test/java/org/apache/hadoop/hbase/io/TestHFileLink.java | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c762753b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
----------------------------------------------------------------------
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 c74a5e2..3477098 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<TableName> {
 
     for (TableName tn : tableCache) {
       if (qualifierAsString.equals(tn.getQualifierAsString()) &&
-          namespaceAsString.equals(tn.getNameAsString())) {
+          namespaceAsString.equals(tn.getNamespaceAsString())) {
         return tn;
       }
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/c762753b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestHFileLink.java
----------------------------------------------------------------------
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 eac3a6a..33bac39 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


Mime
View raw message