use of io.prestosql.sql.analyzer.FeaturesConfig in project hetu-core by openlookeng.
the class TestQuerySpillLimits method createLocalQueryRunner.
private LocalQueryRunner createLocalQueryRunner(NodeSpillConfig nodeSpillConfig) {
LocalQueryRunner queryRunner = null;
try {
String canonicalPath = spillPath.getCanonicalPath();
queryRunner = new LocalQueryRunner(SESSION, new FeaturesConfig().setSpillerSpillPaths(canonicalPath).setSpillEnabled(true), nodeSpillConfig, false, true);
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
queryRunner.createCatalog(SESSION.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
queryRunner.installPlugin(new HetuFileSystemClientPlugin());
return queryRunner;
}
use of io.prestosql.sql.analyzer.FeaturesConfig in project hetu-core by openlookeng.
the class TestGenericPartitioningSpiller method setUp.
@BeforeClass
public void setUp() throws Exception {
tempDirectory = createTempDirectory(getClass().getSimpleName());
when(fileSystemClientManager.getFileSystemClient(tempDirectory)).thenReturn(new HetuLocalFileSystemClient(new LocalConfig(new Properties()), tempDirectory));
FeaturesConfig featuresConfig = new FeaturesConfig();
featuresConfig.setSpillerSpillPaths(tempDirectory.toString());
featuresConfig.setSpillerThreads(8);
featuresConfig.setSpillMaxUsedSpaceThreshold(1.0);
SingleStreamSpillerFactory singleStreamSpillerFactory = new FileSingleStreamSpillerFactory(createTestMetadataManager(), new SpillerStats(), featuresConfig, new NodeSpillConfig(), fileSystemClientManager);
factory = new GenericPartitioningSpillerFactory(singleStreamSpillerFactory);
scheduledExecutor = newSingleThreadScheduledExecutor();
}
use of io.prestosql.sql.analyzer.FeaturesConfig in project hetu-core by openlookeng.
the class TestBinaryFileSpiller method setUp.
@BeforeMethod
public void setUp() throws IOException {
Metadata metadata = createTestMetadataManager();
FileSystemClientManager fileSystemClientManager = mock(FileSystemClientManager.class);
when(fileSystemClientManager.getFileSystemClient(any(Path.class))).thenReturn(new HetuLocalFileSystemClient(new LocalConfig(new Properties()), Paths.get(spillPath.getCanonicalPath())));
spillerStats = new SpillerStats();
FeaturesConfig featuresConfig = new FeaturesConfig();
try {
featuresConfig.setSpillerSpillPaths(spillPath.getCanonicalPath());
} catch (IOException e) {
System.out.println(e.getStackTrace());
}
featuresConfig.setSpillMaxUsedSpaceThreshold(1.0);
NodeSpillConfig nodeSpillConfig = new NodeSpillConfig();
singleStreamSpillerFactory = new FileSingleStreamSpillerFactory(metadata, spillerStats, featuresConfig, nodeSpillConfig, fileSystemClientManager);
factory = new GenericSpillerFactory(singleStreamSpillerFactory);
PagesSerdeFactory pagesSerdeFactory = new PagesSerdeFactory(metadata.getFunctionAndTypeManager().getBlockEncodingSerde(), nodeSpillConfig.isSpillCompressionEnabled());
pagesSerde = pagesSerdeFactory.createPagesSerde();
memoryContext = newSimpleAggregatedMemoryContext();
}
use of io.prestosql.sql.analyzer.FeaturesConfig in project hetu-core by openlookeng.
the class TaskTestUtils method createTestingPlanner.
public static LocalExecutionPlanner createTestingPlanner() {
Metadata metadata = createTestMetadataManager();
PageSourceManager pageSourceManager = new PageSourceManager();
HetuMetaStoreManager hetuMetaStoreManager = new HetuMetaStoreManager();
FeaturesConfig featuresConfig = new FeaturesConfig();
CubeManager cubeManager = new CubeManager(featuresConfig, hetuMetaStoreManager);
pageSourceManager.addConnectorPageSourceProvider(CONNECTOR_ID, new TestingPageSourceProvider());
// we don't start the finalizer so nothing will be collected, which is ok for a test
FinalizerService finalizerService = new FinalizerService();
NodeScheduler nodeScheduler = new NodeScheduler(new LegacyNetworkTopology(), new InMemoryNodeManager(), new NodeSchedulerConfig().setIncludeCoordinator(true), new NodeTaskMap(finalizerService));
NodePartitioningManager nodePartitioningManager = new NodePartitioningManager(nodeScheduler);
PageFunctionCompiler pageFunctionCompiler = new PageFunctionCompiler(metadata, 0);
NodeInfo nodeInfo = new NodeInfo("test");
FileSystemClientManager fileSystemClientManager = new FileSystemClientManager();
SeedStoreManager seedStoreManager = new SeedStoreManager(fileSystemClientManager);
StateStoreProvider stateStoreProvider = new LocalStateStoreProvider(seedStoreManager);
HeuristicIndexerManager heuristicIndexerManager = new HeuristicIndexerManager(new FileSystemClientManager(), new HetuMetaStoreManager());
return new LocalExecutionPlanner(metadata, new TypeAnalyzer(new SqlParser(), metadata), Optional.empty(), pageSourceManager, new IndexManager(), nodePartitioningManager, new PageSinkManager(), new MockExchangeClientSupplier(), new ExpressionCompiler(metadata, pageFunctionCompiler), pageFunctionCompiler, new JoinFilterFunctionCompiler(metadata), new IndexJoinLookupStats(), new TaskManagerConfig(), new GenericSpillerFactory((types, spillContext, memoryContext) -> {
throw new UnsupportedOperationException();
}), (types, spillContext, memoryContext) -> {
throw new UnsupportedOperationException();
}, (types, partitionFunction, spillContext, memoryContext) -> {
throw new UnsupportedOperationException();
}, new PagesIndex.TestingFactory(false), new JoinCompiler(metadata), new LookupJoinOperators(), new OrderingCompiler(), nodeInfo, stateStoreProvider, new StateStoreListenerManager(stateStoreProvider), new DynamicFilterCacheManager(), heuristicIndexerManager, cubeManager);
}
use of io.prestosql.sql.analyzer.FeaturesConfig in project hetu-core by openlookeng.
the class TestSetRoleTask method setUp.
@BeforeClass
public void setUp() {
CatalogManager catalogManager = new CatalogManager();
transactionManager = createTestTransactionManager(catalogManager);
accessControl = new AllowAllAccessControl();
metadata = createTestMetadataManager(transactionManager, new FeaturesConfig());
catalogManager.registerCatalog(createBogusTestingCatalog(CATALOG_NAME));
executor = newCachedThreadPool(daemonThreadsNamed("test-set-role-task-executor-%s"));
parser = new SqlParser();
}
Aggregations