HBASE-13010 HFileOutputFormat2 partitioner's path is hard-coded as '/tmp'
Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
parent
9114edece1
commit
432b2197fd
|
@ -585,17 +585,17 @@ public class HFileOutputFormat2
|
||||||
*/
|
*/
|
||||||
static void configurePartitioner(Job job, List<ImmutableBytesWritable> splitPoints)
|
static void configurePartitioner(Job job, List<ImmutableBytesWritable> splitPoints)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
Configuration conf = job.getConfiguration();
|
||||||
// create the partitions file
|
// create the partitions file
|
||||||
FileSystem fs = FileSystem.get(job.getConfiguration());
|
FileSystem fs = FileSystem.get(conf);
|
||||||
Path partitionsPath = new Path("/tmp", "partitions_" + UUID.randomUUID());
|
Path partitionsPath = new Path(conf.get("hadoop.tmp.dir"), "partitions_" + UUID.randomUUID());
|
||||||
fs.makeQualified(partitionsPath);
|
fs.makeQualified(partitionsPath);
|
||||||
writePartitions(job.getConfiguration(), partitionsPath, splitPoints);
|
writePartitions(conf, partitionsPath, splitPoints);
|
||||||
fs.deleteOnExit(partitionsPath);
|
fs.deleteOnExit(partitionsPath);
|
||||||
|
|
||||||
// configure job to use it
|
// configure job to use it
|
||||||
job.setPartitionerClass(TotalOrderPartitioner.class);
|
job.setPartitionerClass(TotalOrderPartitioner.class);
|
||||||
TotalOrderPartitioner.setPartitionFile(job.getConfiguration(), partitionsPath);
|
TotalOrderPartitioner.setPartitionFile(conf, partitionsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue