Search in sources :

Example 1 with TestingMBeanServer

use of org.weakref.jmx.testing.TestingMBeanServer in project presto by prestodb.

the class LocalQueryRunner method createPlan.

public Plan createPlan(Session session, @Language("SQL") String sql, LogicalPlanner.Stage stage) {
    Statement statement = unwrapExecuteStatement(sqlParser.createStatement(sql), sqlParser, session);
    assertFormattedSql(sqlParser, statement);
    FeaturesConfig featuresConfig = new FeaturesConfig().setDistributedIndexJoinsEnabled(false).setOptimizeHashGeneration(true);
    PlanOptimizers planOptimizers = new PlanOptimizers(metadata, sqlParser, featuresConfig, true, new MBeanExporter(new TestingMBeanServer()));
    return createPlan(session, sql, planOptimizers.get(), stage);
}
Also used : TestingMBeanServer(org.weakref.jmx.testing.TestingMBeanServer) SqlQueryManager.unwrapExecuteStatement(com.facebook.presto.execution.SqlQueryManager.unwrapExecuteStatement) Statement(com.facebook.presto.sql.tree.Statement) FeaturesConfig(com.facebook.presto.sql.analyzer.FeaturesConfig) MBeanExporter(org.weakref.jmx.MBeanExporter) PlanOptimizers(com.facebook.presto.sql.planner.PlanOptimizers)

Example 2 with TestingMBeanServer

use of org.weakref.jmx.testing.TestingMBeanServer in project presto by prestodb.

the class AbstractTestQueryFramework method getQueryExplainer.

private QueryExplainer getQueryExplainer() {
    Metadata metadata = queryRunner.getMetadata();
    FeaturesConfig featuresConfig = new FeaturesConfig().setOptimizeHashGeneration(true);
    boolean forceSingleNode = queryRunner.getNodeCount() == 1;
    List<PlanOptimizer> optimizers = new PlanOptimizers(metadata, sqlParser, featuresConfig, forceSingleNode, new MBeanExporter(new TestingMBeanServer())).get();
    return new QueryExplainer(optimizers, metadata, queryRunner.getAccessControl(), sqlParser, ImmutableMap.of());
}
Also used : PlanOptimizer(com.facebook.presto.sql.planner.optimizations.PlanOptimizer) TestingMBeanServer(org.weakref.jmx.testing.TestingMBeanServer) QueryExplainer(com.facebook.presto.sql.analyzer.QueryExplainer) FeaturesConfig(com.facebook.presto.sql.analyzer.FeaturesConfig) MBeanExporter(org.weakref.jmx.MBeanExporter) Metadata(com.facebook.presto.metadata.Metadata) PlanOptimizers(com.facebook.presto.sql.planner.PlanOptimizers)

Aggregations

FeaturesConfig (com.facebook.presto.sql.analyzer.FeaturesConfig)2 PlanOptimizers (com.facebook.presto.sql.planner.PlanOptimizers)2 MBeanExporter (org.weakref.jmx.MBeanExporter)2 TestingMBeanServer (org.weakref.jmx.testing.TestingMBeanServer)2 SqlQueryManager.unwrapExecuteStatement (com.facebook.presto.execution.SqlQueryManager.unwrapExecuteStatement)1 Metadata (com.facebook.presto.metadata.Metadata)1 QueryExplainer (com.facebook.presto.sql.analyzer.QueryExplainer)1 PlanOptimizer (com.facebook.presto.sql.planner.optimizations.PlanOptimizer)1 Statement (com.facebook.presto.sql.tree.Statement)1