Search in sources :

Example 1 with ResourcePoolTreeImpl

use of org.apache.drill.exec.resourcemgr.config.ResourcePoolTreeImpl in project drill by apache.

the class TestResourcePoolTree method testSelectionPolicyLowerCase.

@Test
public void testSelectionPolicyLowerCase() throws Exception {
    // leaf pool with queue
    poolTreeConfig.put(ResourcePoolImpl.POOL_NAME_KEY, "drill");
    poolTreeConfig.put(ResourcePoolImpl.POOL_QUEUE_KEY, queue1);
    poolTreeConfig.put(ResourcePoolImpl.POOL_SELECTOR_KEY, tagSelectorConfig1);
    poolTreeConfig.put(ResourcePoolTreeImpl.ROOT_POOL_QUEUE_SELECTION_POLICY_KEY, "bestfit");
    Config rmConfig = ConfigFactory.empty().withValue("drill.exec.rm", ConfigValueFactory.fromMap(poolTreeConfig));
    ResourcePoolTree poolTree = new ResourcePoolTreeImpl(rmConfig, 10000, 10, 2);
    assertTrue("Root pool is not a leaf pool", poolTree.getRootPool().isLeafPool());
    assertEquals("Root pool name is not drill", "drill", poolTree.getRootPool().getPoolName());
    assertTrue("Root pool is not the only leaf pool", poolTree.getAllLeafQueues().size() == 1);
    assertTrue("Root pool name is not same as leaf pool name", poolTree.getAllLeafQueues().containsKey("drill"));
    assertFalse("Root pool should not be a default pool", poolTree.getRootPool().isDefaultPool());
    assertTrue("Selection policy is not bestfit", poolTree.getSelectionPolicyInUse().getSelectionPolicy().toString().equals("bestfit"));
}
Also used : Config(com.typesafe.config.Config) ResourcePoolTreeImpl(org.apache.drill.exec.resourcemgr.config.ResourcePoolTreeImpl) ResourcePoolTree(org.apache.drill.exec.resourcemgr.config.ResourcePoolTree) BaseTest(org.apache.drill.test.BaseTest) Test(org.junit.Test) ResourceManagerTest(org.apache.drill.categories.ResourceManagerTest)

Example 2 with ResourcePoolTreeImpl

use of org.apache.drill.exec.resourcemgr.config.ResourcePoolTreeImpl in project drill by apache.

the class TestResourcePoolTree method testRootPoolAsLeaf.

@Test
public void testRootPoolAsLeaf() throws Exception {
    // leaf pool with queue
    poolTreeConfig.put(ResourcePoolImpl.POOL_NAME_KEY, "drill");
    poolTreeConfig.put(ResourcePoolImpl.POOL_QUEUE_KEY, queue1);
    poolTreeConfig.put(ResourcePoolImpl.POOL_SELECTOR_KEY, tagSelectorConfig1);
    Config rmConfig = ConfigFactory.empty().withValue("drill.exec.rm", ConfigValueFactory.fromMap(poolTreeConfig));
    ResourcePoolTree poolTree = new ResourcePoolTreeImpl(rmConfig, 10000, 10, 2);
    assertTrue("Root pool is not a leaf pool", poolTree.getRootPool().isLeafPool());
    assertEquals("Root pool name is not drill", "drill", poolTree.getRootPool().getPoolName());
    assertTrue("Root pool is not the only leaf pool", poolTree.getAllLeafQueues().size() == 1);
    assertTrue("Root pool name is not same as leaf pool name", poolTree.getAllLeafQueues().containsKey("drill"));
    assertFalse("Root pool should not be a default pool", poolTree.getRootPool().isDefaultPool());
}
Also used : Config(com.typesafe.config.Config) ResourcePoolTreeImpl(org.apache.drill.exec.resourcemgr.config.ResourcePoolTreeImpl) ResourcePoolTree(org.apache.drill.exec.resourcemgr.config.ResourcePoolTree) BaseTest(org.apache.drill.test.BaseTest) Test(org.junit.Test) ResourceManagerTest(org.apache.drill.categories.ResourceManagerTest)

Example 3 with ResourcePoolTreeImpl

use of org.apache.drill.exec.resourcemgr.config.ResourcePoolTreeImpl in project drill by apache.

the class TestResourcePoolTree method getPoolTreeConfig.

private ResourcePoolTree getPoolTreeConfig() throws RMConfigException {
    poolTreeConfig.put(ResourcePoolImpl.POOL_NAME_KEY, "drill");
    poolTreeConfig.put(ResourcePoolImpl.POOL_CHILDREN_POOLS_KEY, childResourcePools);
    Config rmConfig = ConfigFactory.empty().withValue("drill.exec.rm", ConfigValueFactory.fromMap(poolTreeConfig));
    return new ResourcePoolTreeImpl(rmConfig, 10000, 10, 2);
}
Also used : Config(com.typesafe.config.Config) ResourcePoolTreeImpl(org.apache.drill.exec.resourcemgr.config.ResourcePoolTreeImpl)

Aggregations

Config (com.typesafe.config.Config)3 ResourcePoolTreeImpl (org.apache.drill.exec.resourcemgr.config.ResourcePoolTreeImpl)3 ResourceManagerTest (org.apache.drill.categories.ResourceManagerTest)2 ResourcePoolTree (org.apache.drill.exec.resourcemgr.config.ResourcePoolTree)2 BaseTest (org.apache.drill.test.BaseTest)2 Test (org.junit.Test)2