Skip to content

Commit 72bfb4b

Browse files
authoredMar 4, 2019
Root temp directory path is now configurable in HiveAbstractDatasetRe… (#487)
* Root temp directory path is now configurable in HiveAbstractDatasetRepository * Log level is set to debug.
1 parent 1070ff9 commit 72bfb4b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎kite-data/kite-data-hive/src/main/java/org/kitesdk/data/spi/hive/HiveAbstractDatasetRepository.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,25 @@
2424
import org.kitesdk.data.DatasetNotFoundException;
2525
import org.kitesdk.data.spi.filesystem.FileSystemDatasetRepository;
2626
import org.kitesdk.data.spi.MetadataProvider;
27+
import org.slf4j.Logger;
28+
import org.slf4j.LoggerFactory;
2729

2830
class HiveAbstractDatasetRepository extends FileSystemDatasetRepository {
2931

32+
private static final Logger LOG = LoggerFactory
33+
.getLogger(HiveAbstractDatasetRepository.class);
34+
3035
private static final String HIVE_METASTORE_URIS_SEPARATOR = ",";
3136

3237
private final MetadataProvider provider;
3338
private final URI repoUri;
3439

40+
private static Path getRootDirectory(Configuration conf) {
41+
String pathString = conf.get("kite.hive.tmp.root", "/tmp");
42+
LOG.debug("Using root directory: " + pathString);
43+
return new Path(pathString);
44+
}
45+
3546
/**
3647
* Create an HCatalog dataset repository with external tables.
3748
*/
@@ -48,7 +59,7 @@ class HiveAbstractDatasetRepository extends FileSystemDatasetRepository {
4859
HiveAbstractDatasetRepository(Configuration conf, MetadataProvider provider) {
4960
// Because the managed provider overrides dataset locations, the only time
5061
// the storage path is used is to create temporary dataset repositories
51-
super(conf, new Path("/tmp"), provider);
62+
super(conf, getRootDirectory(conf), provider);
5263
this.provider = provider;
5364
this.repoUri = getRepositoryUri(conf, null);
5465
}

0 commit comments

Comments
 (0)