use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestHivePartitionManager method testIgnoresBucketingWhenTooManyBuckets.
@Test
public void testIgnoresBucketingWhenTooManyBuckets() {
ConnectorSession session = new TestingConnectorSession(new HiveSessionProperties(new HiveClientConfig().setMaxBucketsForGroupedExecution(100), new OrcFileWriterConfig(), new ParquetFileWriterConfig(), new CacheConfig()).getSessionProperties());
HivePartitionResult result = hivePartitionManager.getPartitions(metastore, new HiveTableHandle(SCHEMA_NAME, TABLE_NAME), Constraint.alwaysTrue(), session);
assertFalse(result.getBucketHandle().isPresent(), "bucketHandle is present");
assertFalse(result.getBucketFilter().isPresent(), "bucketFilter is present");
}
use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestAlluxioCachingFileSystem method testStress.
@Test(invocationCount = 10)
public void testStress() throws ExecutionException, InterruptedException, URISyntaxException, IOException {
CacheConfig cacheConfig = new CacheConfig().setCacheType(ALLUXIO).setCachingEnabled(true).setBaseDirectory(cacheDirectory);
AlluxioCacheConfig alluxioCacheConfig = new AlluxioCacheConfig().setMaxCacheSize(new DataSize(10, KILOBYTE));
Configuration configuration = getHdfsConfiguration(cacheConfig, alluxioCacheConfig);
AlluxioCachingFileSystem cachingFileSystem = cachingFileSystem(configuration);
stressTest(data, (position, buffer, offset, length) -> {
try {
readFully(cachingFileSystem, position, buffer, offset, length);
} catch (Exception e) {
e.printStackTrace();
}
});
}
use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestFileMergeCacheManager method testStress.
@Test(invocationCount = 10)
public void testStress() throws ExecutionException, InterruptedException {
CacheConfig cacheConfig = new CacheConfig().setBaseDirectory(cacheDirectory);
FileMergeCacheConfig fileMergeCacheConfig = new FileMergeCacheConfig().setCacheTtl(new Duration(10, MILLISECONDS));
CacheManager cacheManager = fileMergeCacheManager(cacheConfig, fileMergeCacheConfig);
stressTest(data, (position, buffer, offset, length) -> readFully(cacheManager, NO_CACHE_CONSTRAINTS, position, buffer, offset, length));
}
use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestFileMergeCacheManager method fileMergeCacheManager.
private CacheManager fileMergeCacheManager(CacheStats cacheStats) {
CacheConfig cacheConfig = new CacheConfig();
FileMergeCacheConfig fileMergeCacheConfig = new FileMergeCacheConfig();
return new FileMergeCacheManager(cacheConfig.setBaseDirectory(cacheDirectory), fileMergeCacheConfig, cacheStats, flushExecutor, removeExecutor, cacheSizeCalculator);
}
use of com.facebook.presto.cache.CacheConfig in project presto by prestodb.
the class TestAlluxioCachingFileSystem method testStressWithQuota.
@Test(invocationCount = 10)
public void testStressWithQuota() throws ExecutionException, InterruptedException, URISyntaxException, IOException {
CacheQuota cacheQuota = new CacheQuota("test.table", Optional.of(DataSize.succinctDataSize(5, KILOBYTE)));
CacheConfig cacheConfig = new CacheConfig().setCacheType(ALLUXIO).setCachingEnabled(true).setValidationEnabled(false).setBaseDirectory(cacheDirectory).setCacheQuotaScope(TABLE);
AlluxioCacheConfig alluxioCacheConfig = new AlluxioCacheConfig().setMaxCacheSize(new DataSize(10, KILOBYTE)).setCacheQuotaEnabled(true);
Configuration configuration = getHdfsConfiguration(cacheConfig, alluxioCacheConfig);
AlluxioCachingFileSystem cachingFileSystem = cachingFileSystem(configuration);
stressTest(data, (position, buffer, offset, length) -> {
try {
readFully(cachingFileSystem, cacheQuota, position, buffer, offset, length);
} catch (Exception e) {
e.printStackTrace();
}
});
}
Aggregations