Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE29417816 for ; Thu, 30 Oct 2014 16:17:12 +0000 (UTC) Received: (qmail 33507 invoked by uid 500); 30 Oct 2014 16:17:12 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 33462 invoked by uid 500); 30 Oct 2014 16:17:12 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 33453 invoked by uid 99); 30 Oct 2014 16:17:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2014 16:17:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 70156980F8C; Thu, 30 Oct 2014 16:17:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stack@apache.org To: commits@hbase.apache.org Message-Id: <8de5db36239b4d5bbc98051436eb1704@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) 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 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 Authored: Thu Oct 30 12:33:07 2014 +0530 Committer: stack 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(); + } + } + } }