Search in sources :

Example 6 with FileResourceGroupConfigurationManagerFactory

use of com.facebook.presto.resourceGroups.FileResourceGroupConfigurationManagerFactory in project presto by prestodb.

the class TestDistributedQueryResource method setup.

@BeforeMethod
public void setup() throws Exception {
    client = new JettyHttpClient();
    DistributedQueryRunner runner = createQueryRunner(ImmutableMap.of("query.client.timeout", "20s"), 2);
    coordinator1 = runner.getCoordinator(0);
    coordinator2 = runner.getCoordinator(1);
    Optional<TestingPrestoServer> resourceManager = runner.getResourceManager();
    checkState(resourceManager.isPresent(), "resource manager not present");
    this.resourceManager = resourceManager.get();
    coordinator1.getResourceGroupManager().get().addConfigurationManagerFactory(new FileResourceGroupConfigurationManagerFactory());
    coordinator1.getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
    coordinator2.getResourceGroupManager().get().addConfigurationManagerFactory(new FileResourceGroupConfigurationManagerFactory());
    coordinator2.getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
}
Also used : DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) JettyHttpClient(com.facebook.airlift.http.client.jetty.JettyHttpClient) TestingPrestoServer(com.facebook.presto.server.testing.TestingPrestoServer) FileResourceGroupConfigurationManagerFactory(com.facebook.presto.resourceGroups.FileResourceGroupConfigurationManagerFactory) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 7 with FileResourceGroupConfigurationManagerFactory

use of com.facebook.presto.resourceGroups.FileResourceGroupConfigurationManagerFactory in project presto by prestodb.

the class TestDistributedQueryInfoResource method setup.

@BeforeClass
public void setup() throws Exception {
    client = new JettyHttpClient();
    DistributedQueryRunner runner = createQueryRunner(ImmutableMap.of("query.client.timeout", "20s"), COORDINATOR_COUNT);
    coordinator1 = runner.getCoordinator(0);
    coordinator2 = runner.getCoordinator(1);
    Optional<TestingPrestoServer> resourceManager = runner.getResourceManager();
    checkState(resourceManager.isPresent(), "resource manager not present");
    this.resourceManager = resourceManager.get();
    coordinator1.getResourceGroupManager().get().addConfigurationManagerFactory(new FileResourceGroupConfigurationManagerFactory());
    coordinator1.getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
    coordinator2.getResourceGroupManager().get().addConfigurationManagerFactory(new FileResourceGroupConfigurationManagerFactory());
    coordinator2.getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
}
Also used : DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) JettyHttpClient(com.facebook.airlift.http.client.jetty.JettyHttpClient) TestingPrestoServer(com.facebook.presto.server.testing.TestingPrestoServer) FileResourceGroupConfigurationManagerFactory(com.facebook.presto.resourceGroups.FileResourceGroupConfigurationManagerFactory) BeforeClass(org.testng.annotations.BeforeClass)

Example 8 with FileResourceGroupConfigurationManagerFactory

use of com.facebook.presto.resourceGroups.FileResourceGroupConfigurationManagerFactory in project presto by prestodb.

the class TestDistributedResourceGroupInfoResource method setup.

@BeforeClass
public void setup() throws Exception {
    client = new JettyHttpClient();
    DistributedQueryRunner runner = createQueryRunner(ImmutableMap.of("query.client.timeout", "20s"), COORDINATOR_COUNT);
    coordinator1 = runner.getCoordinator(0);
    coordinator2 = runner.getCoordinator(1);
    Optional<TestingPrestoServer> resourceManager = runner.getResourceManager();
    checkState(resourceManager.isPresent(), "resource manager not present");
    this.resourceManager = resourceManager.get();
    coordinator1.getResourceGroupManager().get().addConfigurationManagerFactory(new FileResourceGroupConfigurationManagerFactory());
    coordinator1.getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
    coordinator2.getResourceGroupManager().get().addConfigurationManagerFactory(new FileResourceGroupConfigurationManagerFactory());
    coordinator2.getResourceGroupManager().get().setConfigurationManager("file", ImmutableMap.of("resource-groups.config-file", getResourceFilePath("resource_groups_config_simple.json")));
}
Also used : DistributedQueryRunner(com.facebook.presto.tests.DistributedQueryRunner) JettyHttpClient(com.facebook.airlift.http.client.jetty.JettyHttpClient) TestingPrestoServer(com.facebook.presto.server.testing.TestingPrestoServer) FileResourceGroupConfigurationManagerFactory(com.facebook.presto.resourceGroups.FileResourceGroupConfigurationManagerFactory) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

FileResourceGroupConfigurationManagerFactory (com.facebook.presto.resourceGroups.FileResourceGroupConfigurationManagerFactory)8 BeforeClass (org.testng.annotations.BeforeClass)7 JettyHttpClient (com.facebook.airlift.http.client.jetty.JettyHttpClient)6 TestingPrestoServer (com.facebook.presto.server.testing.TestingPrestoServer)6 DistributedQueryRunner (com.facebook.presto.tests.DistributedQueryRunner)6 BeforeMethod (org.testng.annotations.BeforeMethod)1