use of io.prestosql.plugin.resourcegroups.ResourceGroupManagerPlugin in project hetu-core by openlookeng.
the class TestQueues method testResourceGroupManagerWithTwoDashboardQueriesRequestedAtTheSameTime.
@Test(timeOut = 240_000)
public void testResourceGroupManagerWithTwoDashboardQueriesRequestedAtTheSameTime() throws Exception {
try (DistributedQueryRunner queryRunner = createQueryRunner()) {
queryRunner.installPlugin(new ResourceGroupManagerPlugin());
queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_dashboard.json")));
QueryId firstDashboardQuery = createDashboardQuery(queryRunner);
QueryId secondDashboardQuery = createDashboardQuery(queryRunner);
ImmutableSet<QueryState> queuedOrRunning = ImmutableSet.of(QUEUED, RUNNING);
waitForQueryState(queryRunner, firstDashboardQuery, queuedOrRunning);
waitForQueryState(queryRunner, secondDashboardQuery, queuedOrRunning);
}
}
use of io.prestosql.plugin.resourcegroups.ResourceGroupManagerPlugin in project hetu-core by openlookeng.
the class TestQueues method testQueryTypeBasedSelection.
@Test(timeOut = 240_000)
public void testQueryTypeBasedSelection() throws Exception {
try (DistributedQueryRunner queryRunner = TpchQueryRunnerBuilder.builder().build()) {
queryRunner.installPlugin(new ResourceGroupManagerPlugin());
queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_query_type_based_config.json")));
assertResourceGroup(queryRunner, newAdhocSession(), LONG_LASTING_QUERY, createResourceGroupId("global", "select"));
assertResourceGroup(queryRunner, newAdhocSession(), "SHOW TABLES", createResourceGroupId("global", "describe"));
assertResourceGroup(queryRunner, newAdhocSession(), "EXPLAIN " + LONG_LASTING_QUERY, createResourceGroupId("global", "explain"));
assertResourceGroup(queryRunner, newAdhocSession(), "DESCRIBE lineitem", createResourceGroupId("global", "describe"));
assertResourceGroup(queryRunner, newAdhocSession(), "RESET SESSION " + HASH_PARTITION_COUNT, createResourceGroupId("global", "data_definition"));
}
}
use of io.prestosql.plugin.resourcegroups.ResourceGroupManagerPlugin in project hetu-core by openlookeng.
the class TestQueues method testClientTagsBasedSelection.
@Test(timeOut = 240_000)
public void testClientTagsBasedSelection() throws Exception {
try (DistributedQueryRunner queryRunner = createQueryRunner()) {
queryRunner.installPlugin(new ResourceGroupManagerPlugin());
queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_client_tags_based_config.json")));
assertResourceGroup(queryRunner, newSessionWithTags(ImmutableSet.of("a")), LONG_LASTING_QUERY, createResourceGroupId("global", "a", "default"));
assertResourceGroup(queryRunner, newSessionWithTags(ImmutableSet.of("b")), LONG_LASTING_QUERY, createResourceGroupId("global", "b"));
assertResourceGroup(queryRunner, newSessionWithTags(ImmutableSet.of("a", "c")), LONG_LASTING_QUERY, createResourceGroupId("global", "a", "c"));
}
}
use of io.prestosql.plugin.resourcegroups.ResourceGroupManagerPlugin in project hetu-core by openlookeng.
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")));
}
use of io.prestosql.plugin.resourcegroups.ResourceGroupManagerPlugin in project hetu-core by openlookeng.
the class TestResourceGroupIntegration method testMemoryFraction.
@Test
public void testMemoryFraction() throws Exception {
try (DistributedQueryRunner queryRunner = TpchQueryRunnerBuilder.builder().build()) {
queryRunner.installPlugin(new ResourceGroupManagerPlugin());
getResourceGroupManager(queryRunner).setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_memory_percentage.json")));
queryRunner.execute("SELECT COUNT(*), clerk FROM orders GROUP BY clerk");
waitForGlobalResourceGroup(queryRunner);
}
}
Aggregations