Search in sources :

Example 1 with AlluxioCachingFileSystem

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());
    }
}
Also used : AlluxioCachingFileSystem(com.facebook.presto.cache.alluxio.AlluxioCachingFileSystem) ExtendedFileSystem(com.facebook.presto.hive.filesystem.ExtendedFileSystem) FileMergeCachingFileSystem(com.facebook.presto.cache.filemerge.FileMergeCachingFileSystem)

Aggregations

AlluxioCachingFileSystem (com.facebook.presto.cache.alluxio.AlluxioCachingFileSystem)1 FileMergeCachingFileSystem (com.facebook.presto.cache.filemerge.FileMergeCachingFileSystem)1 ExtendedFileSystem (com.facebook.presto.hive.filesystem.ExtendedFileSystem)1