Search in sources :

Example 1 with TestingEventListenerPlugin

use of com.facebook.presto.execution.TestEventListenerPlugin.TestingEventListenerPlugin in project presto by prestodb.

the class TestCompletedEventWarnings method setUp.

@BeforeClass
public void setUp() throws Exception {
    SessionBuilder sessionBuilder = testSessionBuilder();
    generatedEvents = new EventsBuilder();
    queryRunner = DistributedQueryRunner.builder(sessionBuilder.build()).setExtraProperties(ImmutableMap.of("testing-warning-collector.preloaded-warnings", String.valueOf(TEST_WARNINGS))).setNodeCount(1).build();
    queryRunner.installPlugin(new TestingEventListenerPlugin(generatedEvents));
    generatedEvents.initialize(EXPECTED_EVENTS);
}
Also used : EventsBuilder(com.facebook.presto.execution.TestEventListener.EventsBuilder) TestingEventListenerPlugin(com.facebook.presto.execution.TestEventListenerPlugin.TestingEventListenerPlugin) SessionBuilder(com.facebook.presto.Session.SessionBuilder) TestingSession.testSessionBuilder(com.facebook.presto.testing.TestingSession.testSessionBuilder) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with TestingEventListenerPlugin

use of com.facebook.presto.execution.TestEventListenerPlugin.TestingEventListenerPlugin in project presto by prestodb.

the class TestEventListener method setUp.

@BeforeClass
private void setUp() throws Exception {
    session = testSessionBuilder().setSystemProperty("task_concurrency", "1").setCatalog("tpch").setSchema("tiny").setClientInfo("{\"clientVersion\":\"testVersion\"}").build();
    queryRunner = new DistributedQueryRunner(session, 1);
    queryRunner.installPlugin(new TpchPlugin());
    queryRunner.installPlugin(new TestingEventListenerPlugin(generatedEvents));
    queryRunner.installPlugin(new ResourceGroupManagerPlugin());
    queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of("tpch.splits-per-node", Integer.toString(SPLITS_PER_NODE)));
    queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
}
Also used : TestingEventListenerPlugin(com.facebook.presto.execution.TestEventListenerPlugin.TestingEventListenerPlugin) DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) TpchPlugin(com.facebook.presto.tpch.TpchPlugin) ResourceGroupManagerPlugin(com.facebook.presto.resourceGroups.ResourceGroupManagerPlugin) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

TestingEventListenerPlugin (com.facebook.presto.execution.TestEventListenerPlugin.TestingEventListenerPlugin)2 BeforeClass (org.testng.annotations.BeforeClass)2 SessionBuilder (com.facebook.presto.Session.SessionBuilder)1 EventsBuilder (com.facebook.presto.execution.TestEventListener.EventsBuilder)1 ResourceGroupManagerPlugin (com.facebook.presto.resourceGroups.ResourceGroupManagerPlugin)1 TestingSession.testSessionBuilder (com.facebook.presto.testing.TestingSession.testSessionBuilder)1 DistributedQueryRunner (com.facebook.presto.tests.DistributedQueryRunner)1 TpchPlugin (com.facebook.presto.tpch.TpchPlugin)1