Skip to content

Commit

Permalink
Root temp directory path is now configurable in HiveAbstractDatasetRe… (
Browse files Browse the repository at this point in the history
kite-sdk#487)

* Root temp directory path is now configurable in HiveAbstractDatasetRepository

* Log level is set to debug.
  • Loading branch information
szvasas authored Mar 4, 2019
1 parent 1070ff9 commit 72bfb4b
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,25 @@
import org.kitesdk.data.DatasetNotFoundException;
import org.kitesdk.data.spi.filesystem.FileSystemDatasetRepository;
import org.kitesdk.data.spi.MetadataProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class HiveAbstractDatasetRepository extends FileSystemDatasetRepository {

private static final Logger LOG = LoggerFactory
.getLogger(HiveAbstractDatasetRepository.class);

private static final String HIVE_METASTORE_URIS_SEPARATOR = ",";

private final MetadataProvider provider;
private final URI repoUri;

private static Path getRootDirectory(Configuration conf) {
String pathString = conf.get("kite.hive.tmp.root", "/tmp");
LOG.debug("Using root directory: " + pathString);
return new Path(pathString);
}

/**
* Create an HCatalog dataset repository with external tables.
*/
Expand All @@ -48,7 +59,7 @@ class HiveAbstractDatasetRepository extends FileSystemDatasetRepository {
HiveAbstractDatasetRepository(Configuration conf, MetadataProvider provider) {
// Because the managed provider overrides dataset locations, the only time
// the storage path is used is to create temporary dataset repositories
super(conf, new Path("/tmp"), provider);
super(conf, getRootDirectory(conf), provider);
this.provider = provider;
this.repoUri = getRepositoryUri(conf, null);
}
Expand Down

0 comments on commit 72bfb4b

Please sign in to comment.