diff --git a/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusher.java b/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusher.java index 52ac15129d4..09fdf72f863 100644 --- a/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusher.java +++ b/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusher.java @@ -43,7 +43,7 @@ public class HdfsDataSegmentPusher implements DataSegmentPusher public DataSegment push(File inDir, DataSegment segment) throws IOException { final String storageDir = DataSegmentPusherUtil.getStorageDir(segment); - Path outFile = new Path(String.format("%s/%s/index.zip", config.getStorageDirectory(), storageDir)); + Path outFile = config.getStorageDirectory().suffix(String.format("/%s/index.zip", storageDir)); FileSystem fs = outFile.getFileSystem(hadoopConfig); fs.mkdirs(outFile.getParent()); diff --git a/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusherConfig.java b/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusherConfig.java index c3f6d603ccb..70f3c979388 100644 --- a/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusherConfig.java +++ b/server/src/main/java/com/metamx/druid/loading/HdfsDataSegmentPusherConfig.java @@ -19,6 +19,7 @@ package com.metamx.druid.loading; +import org.apache.hadoop.fs.Path; import org.skife.config.Config; import java.io.File; @@ -28,5 +29,5 @@ import java.io.File; public abstract class HdfsDataSegmentPusherConfig { @Config("druid.pusher.hdfs.storageDirectory") - public abstract File getStorageDirectory(); + public abstract Path getStorageDirectory(); }