use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestConformance method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher);
startCluster(builder);
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestConfigLinkage method testSessionPrecedence.
/* Test if altering session option takes precedence over system option */
@Test
public void testSessionPrecedence() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).systemOption(ExecConstants.SLICE_TARGET, 100000);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
client.queryBuilder().sql("ALTER SESSION SET `planner.slice_target` = 10000").run();
String slice_target = client.queryBuilder().sql("SELECT val FROM sys.%s where name='planner.slice_target' and optionScope = 'SESSION'", SystemTable.OPTIONS.getTableName()).singletonString();
assertEquals(slice_target, "10000");
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class StatusResourcesTest method testRetrievePublicOption.
@Test
public void testRetrievePublicOption() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).configProperty(ExecConstants.HTTP_ENABLE, true).configProperty(ExecConstants.HTTP_PORT_HUNT, true).configProperty(ExecConstants.SYS_STORE_PROVIDER_LOCAL_ENABLE_WRITE, false).systemOption(ExecConstants.SLICE_TARGET, 20);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture();
RestClientFixture restClientFixture = cluster.restClientFixture()) {
Assert.assertNull(restClientFixture.getStatusInternalOption(ExecConstants.SLICE_TARGET));
StatusResources.OptionWrapper option = restClientFixture.getStatusOption(ExecConstants.SLICE_TARGET);
Assert.assertEquals(20, option.getValue());
client.alterSystem(ExecConstants.SLICE_TARGET, 30);
Assert.assertNull(restClientFixture.getStatusInternalOption(ExecConstants.SLICE_TARGET));
option = restClientFixture.getStatusOption(ExecConstants.SLICE_TARGET);
Assert.assertEquals(30, option.getValue());
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class StatusResourcesTest method testRetrieveInternalOption.
@Test
public void testRetrieveInternalOption() throws Exception {
OptionDefinition optionDefinition = createMockPropOptionDefinition();
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).configProperty(ExecConstants.HTTP_ENABLE, true).configProperty(ExecConstants.bootDefaultFor(MOCK_PROPERTY), "a").configProperty(ExecConstants.HTTP_PORT_HUNT, true).configProperty(ExecConstants.SYS_STORE_PROVIDER_LOCAL_ENABLE_WRITE, false).putDefinition(optionDefinition);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture();
RestClientFixture restClientFixture = cluster.restClientFixture()) {
Assert.assertNull(restClientFixture.getStatusOption(MOCK_PROPERTY));
StatusResources.OptionWrapper option = restClientFixture.getStatusInternalOption(MOCK_PROPERTY);
Assert.assertEquals("a", option.getValueAsString());
client.alterSystem(MOCK_PROPERTY, "c");
Assert.assertNull(restClientFixture.getStatusOption(MOCK_PROPERTY));
option = restClientFixture.getStatusInternalOption(MOCK_PROPERTY);
Assert.assertEquals("c", option.getValueAsString());
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestQueryProfiles method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterFixtureBuilder builder = new ClusterFixtureBuilder(dirTestWatcher).configProperty(ExecConstants.HTTP_ENABLE, true).configProperty(ExecConstants.HTTP_PORT_HUNT, true);
startCluster(builder);
portNumber = cluster.drillbit().getWebServerPort();
}
Aggregations