HBASE-13010 HFileOutputFormat2 partitioner's path is hard-coded as '/tmp'

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Aditya Kishore 2015-02-13 18:35:33 -08:00 committed by Andrew Purtell
parent c96df5e240
commit f286797fbf
1 changed files with 5 additions and 5 deletions

View File

@ -584,17 +584,17 @@ public class HFileOutputFormat2
*/
static void configurePartitioner(Job job, List<ImmutableBytesWritable> splitPoints)
throws IOException {
Configuration conf = job.getConfiguration();
// create the partitions file
FileSystem fs = FileSystem.get(job.getConfiguration());
Path partitionsPath = new Path("/tmp", "partitions_" + UUID.randomUUID());
FileSystem fs = FileSystem.get(conf);
Path partitionsPath = new Path(conf.get("hadoop.tmp.dir"), "partitions_" + UUID.randomUUID());
fs.makeQualified(partitionsPath);
writePartitions(job.getConfiguration(), partitionsPath, splitPoints);
writePartitions(conf, partitionsPath, splitPoints);
fs.deleteOnExit(partitionsPath);
// configure job to use it
job.setPartitionerClass(TotalOrderPartitioner.class);
TotalOrderPartitioner.setPartitionFile(job.getConfiguration(), partitionsPath);
TotalOrderPartitioner.setPartitionFile(conf, partitionsPath);
}
/**