You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2015/11/05 02:33:28 UTC

[05/19] incubator-kylin git commit: check whether path exists before set permission

check whether path exists before set permission


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

Branch: refs/heads/KYLIN-1112-2
Commit: ed2784aeadcd35d1d78e499dc28e146ab1aae179
Parents: d8c689a
Author: shaofengshi <sh...@apache.org>
Authored: Mon Nov 2 14:33:44 2015 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Thu Nov 5 09:24:17 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/storage/hbase/ii/IIBulkLoadJob.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/ed2784ae/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/IIBulkLoadJob.java
----------------------------------------------------------------------
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/IIBulkLoadJob.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/IIBulkLoadJob.java
index 149791b..4098797 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/IIBulkLoadJob.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/ii/IIBulkLoadJob.java
@@ -46,12 +46,17 @@ public class IIBulkLoadJob extends AbstractHadoopJob {
             options.addOption(OPTION_II_NAME);
             parseOptions(options, args);
 
-            String tableName = getOptionValue(OPTION_HTABLE_NAME);
+            String tableName = getOptionValue(OPTION_HTABLE_NAME).toUpperCase();
             String input = getOptionValue(OPTION_INPUT_PATH);
 
             FileSystem fs = FileSystem.get(getConf());
-            FsPermission permission = new FsPermission((short) 0777);
-            fs.setPermission(new Path(input, IIDesc.HBASE_FAMILY), permission);
+            Path columnFamilyPath = new Path(input, IIDesc.HBASE_FAMILY);
+
+            // File may have already been auto-loaded (in the case of MapR DB)
+            if (fs.exists(columnFamilyPath)) {
+                FsPermission permission = new FsPermission((short) 0777);
+                fs.setPermission(columnFamilyPath, permission);
+            }
 
             return ToolRunner.run(new LoadIncrementalHFiles(getConf()), new String[] { input, tableName });