KYLIN-2648 fix wrong FS in HDFSPathGarbageCollectionStep
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/216ae033 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/216ae033 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/216ae033 Branch: refs/heads/master Commit: 216ae0337bcb57ec75fc3f694ec8c13e137572a5 Parents: 21a1768 Author: Li Yang <liy...@apache.org> Authored: Fri Jun 2 19:19:24 2017 +0800 Committer: liyang-gmt8 <liy...@apache.org> Committed: Sun Jun 4 09:12:32 2017 +0800 ---------------------------------------------------------------------- .../hbase/steps/HDFSPathGarbageCollectionStep.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/216ae033/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HDFSPathGarbageCollectionStep.java ---------------------------------------------------------------------- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HDFSPathGarbageCollectionStep.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HDFSPathGarbageCollectionStep.java index 4c0747e..86e8e6b 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HDFSPathGarbageCollectionStep.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/steps/HDFSPathGarbageCollectionStep.java @@ -81,19 +81,20 @@ public class HDFSPathGarbageCollectionStep extends AbstractExecutable { if (path.endsWith("*")) path = path.substring(0, path.length() - 1); - Path oldPath = new Path(path); + Path oldPath = Path.getPathWithoutSchemeAndAuthority(new Path(path)); if (fileSystem.exists(oldPath)) { fileSystem.delete(oldPath, true); - logger.debug("HDFS path " + path + " is dropped."); - output.append("HDFS path " + path + " is dropped.\n"); + logger.debug("HDFS path " + oldPath + " is dropped."); + output.append("HDFS path " + oldPath + " is dropped.\n"); } else { - logger.debug("HDFS path " + path + " not exists."); - output.append("HDFS path " + path + " not exists.\n"); + logger.debug("HDFS path " + oldPath + " not exists."); + output.append("HDFS path " + oldPath + " not exists.\n"); } // If hbase was deployed on another cluster, the job dir is empty and should be dropped, // because of rowkey_stats and hfile dirs are both dropped. if (fileSystem.listStatus(oldPath.getParent()).length == 0) { Path emptyJobPath = new Path(JobBuilderSupport.getJobWorkingDir(config, getJobId())); + emptyJobPath = Path.getPathWithoutSchemeAndAuthority(emptyJobPath); if (fileSystem.exists(emptyJobPath)) { fileSystem.delete(emptyJobPath, true); logger.debug("HDFS path " + emptyJobPath + " is empty and dropped.");