use of alluxio.hadoop.LocalCacheFileSystem in project presto by prestodb.
the class AlluxioCachingFileSystem method initialize.
@Override
public synchronized void initialize(URI uri, Configuration configuration) throws IOException {
this.localCacheFileSystem = new LocalCacheFileSystem(dataTier, uriStatus -> {
// CacheContext is the mechanism to pass the hiveFileContext to the source filesystem
// hiveFileContext is critical to use to open file.
CacheContext cacheContext = uriStatus.getCacheContext();
checkState(cacheContext instanceof PrestoCacheContext);
HiveFileContext hiveFileContext = ((PrestoCacheContext) cacheContext).getHiveFileContext();
try {
return dataTier.openFile(new Path(uriStatus.getPath()), hiveFileContext);
} catch (Exception e) {
throw new IOException("Failed to open file", e);
}
});
this.cacheQuotaEnabled = configuration.getBoolean(USER_CLIENT_CACHE_QUOTA_ENABLED.getName(), false);
localCacheFileSystem.initialize(uri, configuration);
}
Aggregations