hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject git commit: HBASE-12375 LoadIncrementalHFiles fails to load data in table when CF name starts with '_'
Date Thu, 30 Oct 2014 16:17:12 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 c466c6197 -> d8874fbc2


HBASE-12375 LoadIncrementalHFiles fails to load data in table when CF name starts with '_'

Signed-off-by: stack <stack@apache.org>


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

Branch: refs/heads/branch-1
Commit: d8874fbc21525a5af2db3d8b9edd6e67fa1b5572
Parents: c466c61
Author: Ashish Singhi <ashish.singhi@huawei.com>
Authored: Thu Oct 30 12:33:07 2014 +0530
Committer: stack <stack@apache.org>
Committed: Thu Oct 30 09:17:02 2014 -0700

----------------------------------------------------------------------
 .../hbase/mapreduce/LoadIncrementalHFiles.java  |  4 ---
 .../mapreduce/TestLoadIncrementalHFiles.java    | 28 ++++++++++++++++++++
 2 files changed, 28 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d8874fbc/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
index 855417d..8376e85 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
@@ -203,8 +203,6 @@ public class LoadIncrementalHFiles extends Configured implements Tool
{
         continue;
       }
       Path familyDir = stat.getPath();
-      // Skip _logs, etc
-      if (familyDir.getName().startsWith("_")) continue;
       byte[] family = familyDir.getName().getBytes();
       Path[] hfiles = FileUtil.stat2Paths(fs.listStatus(familyDir));
       for (Path hfile : hfiles) {
@@ -850,8 +848,6 @@ public class LoadIncrementalHFiles extends Configured implements Tool
{
         continue;
       }
       Path familyDir = stat.getPath();
-      // Skip _logs, etc
-      if (familyDir.getName().startsWith("_")) continue;
       byte[] family = familyDir.getName().getBytes();
 
       hcd = new HColumnDescriptor(family);

http://git-wip-us.apache.org/repos/asf/hbase/blob/d8874fbc/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java
index b13e28e..cf7dcea 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFiles.java
@@ -431,5 +431,33 @@ public class TestLoadIncrementalHFiles {
     String[] args = { "directory", "nonExistingTable" };
     loader.run(args);
   }
+
+  @Test
+  public void testTableWithCFNameStartWithUnderScore() throws Exception {
+    Path dir = util.getDataTestDirOnTestFS("cfNameStartWithUnderScore");
+    FileSystem fs = util.getTestFileSystem();
+    dir = dir.makeQualified(fs.getUri(), fs.getWorkingDirectory());
+    String family = "_cf";
+    Path familyDir = new Path(dir, family);
+
+    byte[] from = Bytes.toBytes("begin");
+    byte[] to = Bytes.toBytes("end");
+    Configuration conf = util.getConfiguration();
+    String tableName = "mytable_cfNameStartWithUnderScore";
+    Table table = util.createTable(TableName.valueOf(tableName), family);
+    HFileTestUtil.createHFile(conf, fs, new Path(familyDir, "hfile"), Bytes.toBytes(family),
+      QUALIFIER, from, to, 1000);
+
+    LoadIncrementalHFiles loader = new LoadIncrementalHFiles(conf);
+    String[] args = { dir.toString(), tableName };
+    try {
+      loader.run(args);
+      assertEquals(1000, util.countRows(table));
+    } finally {
+      if (null != table) {
+        table.close();
+      }
+    }
+  }
 }
 


Mime
View raw message