24
24
import org .kitesdk .data .DatasetNotFoundException ;
25
25
import org .kitesdk .data .spi .filesystem .FileSystemDatasetRepository ;
26
26
import org .kitesdk .data .spi .MetadataProvider ;
27
+ import org .slf4j .Logger ;
28
+ import org .slf4j .LoggerFactory ;
27
29
28
30
class HiveAbstractDatasetRepository extends FileSystemDatasetRepository {
29
31
32
+ private static final Logger LOG = LoggerFactory
33
+ .getLogger (HiveAbstractDatasetRepository .class );
34
+
30
35
private static final String HIVE_METASTORE_URIS_SEPARATOR = "," ;
31
36
32
37
private final MetadataProvider provider ;
33
38
private final URI repoUri ;
34
39
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
+
35
46
/**
36
47
* Create an HCatalog dataset repository with external tables.
37
48
*/
@@ -48,7 +59,7 @@ class HiveAbstractDatasetRepository extends FileSystemDatasetRepository {
48
59
HiveAbstractDatasetRepository (Configuration conf , MetadataProvider provider ) {
49
60
// Because the managed provider overrides dataset locations, the only time
50
61
// the storage path is used is to create temporary dataset repositories
51
- super (conf , new Path ( "/tmp" ), provider );
62
+ super (conf , getRootDirectory ( conf ), provider );
52
63
this .provider = provider ;
53
64
this .repoUri = getRepositoryUri (conf , null );
54
65
}
0 commit comments