@Test public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("compiler.expression-cache-size", "52") .build(); CompilerConfig expected = new CompilerConfig() .setExpressionCacheSize(52); assertFullMapping(properties, expected); } }
@Inject public PageFunctionCompiler(Metadata metadata, CompilerConfig config) { this(metadata, requireNonNull(config, "config is null").getExpressionCacheSize()); }
compiler, new IndexJoinLookupStats(), new CompilerConfig().setInterpreterEnabled(false), // make sure tests fail if compiler breaks new TaskManagerConfig().setTaskDefaultConcurrency(4) );
public static LocalExecutionPlanner createTestingPlanner() { MetadataManager metadata = MetadataManager.createTestMetadataManager(); PageSourceManager pageSourceManager = new PageSourceManager(); pageSourceManager.addConnectorPageSourceProvider("test", 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); return new LocalExecutionPlanner( metadata, new SqlParser(), pageSourceManager, new IndexManager(), nodePartitioningManager, new PageSinkManager(), new MockExchangeClientSupplier(), new ExpressionCompiler(metadata), new IndexJoinLookupStats(), new CompilerConfig(), new TaskManagerConfig()); }
@Inject public LocalExecutionPlanner( Metadata metadata, SqlParser sqlParser, PageSourceProvider pageSourceProvider, IndexManager indexManager, NodePartitioningManager nodePartitioningManager, PageSinkManager pageSinkManager, ExchangeClientSupplier exchangeClientSupplier, ExpressionCompiler compiler, IndexJoinLookupStats indexJoinLookupStats, CompilerConfig compilerConfig, TaskManagerConfig taskManagerConfig) { requireNonNull(compilerConfig, "compilerConfig is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.indexManager = requireNonNull(indexManager, "indexManager is null"); this.nodePartitioningManager = requireNonNull(nodePartitioningManager, "nodePartitioningManager is null"); this.exchangeClientSupplier = exchangeClientSupplier; this.metadata = requireNonNull(metadata, "metadata is null"); this.sqlParser = requireNonNull(sqlParser, "sqlParser is null"); this.pageSinkManager = requireNonNull(pageSinkManager, "pageSinkManager is null"); this.compiler = requireNonNull(compiler, "compiler is null"); this.indexJoinLookupStats = requireNonNull(indexJoinLookupStats, "indexJoinLookupStats is null"); this.maxIndexMemorySize = requireNonNull(taskManagerConfig, "taskManagerConfig is null").getMaxIndexMemoryUsage(); this.maxPartialAggregationMemorySize = taskManagerConfig.getMaxPartialAggregationMemoryUsage(); interpreterEnabled = compilerConfig.isInterpreterEnabled(); }