use of com.facebook.presto.cache.alluxio.AlluxioCachingFileSystem in project presto by prestodb.
the class CacheFactory method createCachingFileSystem.
public ExtendedFileSystem createCachingFileSystem(Configuration factoryConfig, URI factoryUri, ExtendedFileSystem fileSystem, CacheManager cacheManager, boolean cachingEnabled, CacheType cacheType, boolean validationEnabled) throws IOException {
if (!cachingEnabled) {
return fileSystem;
}
checkState(cacheType != null);
switch(cacheType) {
case FILE_MERGE:
return new FileMergeCachingFileSystem(factoryUri, factoryConfig, cacheManager, fileSystem, validationEnabled);
case ALLUXIO:
ExtendedFileSystem cachingFileSystem = new AlluxioCachingFileSystem(fileSystem, factoryUri, validationEnabled);
cachingFileSystem.initialize(factoryUri, factoryConfig);
return cachingFileSystem;
default:
throw new IllegalArgumentException("Invalid CacheType: " + cacheType.name());
}
}
Aggregations