use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestMemoryCalculator method TestZKBasedQueue.
@Test
public void TestZKBasedQueue() throws Exception {
String sql = "select * from cp.`employee.json`";
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).configProperty(EmbeddedQueryQueue.ENABLED, true);
try (ClusterFixture cluster = builder.build();
ClientFixture client = cluster.clientFixture()) {
client.queryBuilder().sql(sql).run();
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestRMConfigLoad method testDefaultRMWithLocalCoordinatorAndRMDisabled.
@Test
public void testDefaultRMWithLocalCoordinatorAndRMDisabled() throws Exception {
ClusterFixtureBuilder fixtureBuilder = ClusterFixture.builder(dirTestWatcher).configProperty(ExecConstants.RM_ENABLED, false);
try (ClusterFixture cluster = fixtureBuilder.build()) {
ResourceManager resourceManager = cluster.drillbit().getContext().getResourceManager();
assertTrue(resourceManager instanceof DefaultResourceManager);
}
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestCastEmptyStrings method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).sessionOption(PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY, true).systemOption(ExecConstants.CAST_EMPTY_STRING_TO_NULL, true);
startCluster(builder);
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestTypeFns method setup.
@BeforeClass
public static void setup() throws Exception {
// Use the following three lines if you add a function
// to avoid the need for a full Drill build.
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher).configProperty("drill.classpath.scanning.cache.enabled", false);
startCluster(builder);
// Use the following line if a full Drill build has been
// done since adding new functions.
// startCluster(ClusterFixture.builder(dirTestWatcher).maxParallelization(1));
}
use of org.apache.drill.test.ClusterFixtureBuilder in project drill by apache.
the class TestPluginRegistry method testFormatPlugin.
@Test
public void testFormatPlugin() throws Exception {
ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher);
try (ClusterFixture cluster = builder.build()) {
StoragePluginRegistry registry = cluster.storageRegistry();
StoragePluginConfig config = registry.getStoredConfig(CP_PLUGIN_NAME);
FileSystemConfig fsConfig = (FileSystemConfig) config;
assertFalse(fsConfig.getFormats().containsKey("bsv"));
// Add a new format
TextFormatConfig bsv = new TextFormatConfig(null, // line delimiter
null, // field delimiter
"!", // quote
null, // escape
null, // comment
null, // skip first line
false, // extract header
false);
registry.putFormatPlugin(CP_PLUGIN_NAME, "bsv", bsv);
config = registry.getStoredConfig(CP_PLUGIN_NAME);
fsConfig = (FileSystemConfig) config;
assertTrue(fsConfig.getFormats().containsKey("bsv"));
assertSame(bsv, fsConfig.getFormats().get("bsv"));
// Remove the format
registry.putFormatPlugin(CP_PLUGIN_NAME, "bsv", null);
config = registry.getStoredConfig(CP_PLUGIN_NAME);
fsConfig = (FileSystemConfig) config;
assertFalse(fsConfig.getFormats().containsKey("bsv"));
// Undefined plugin
try {
registry.putFormatPlugin("bogus", "bsv", bsv);
fail();
} catch (PluginException e) {
// Expected
}
// Try to set a non-FS plugin
try {
registry.putFormatPlugin(SYS_PLUGIN_NAME, "bsv", bsv);
fail();
} catch (PluginException e) {
// Expected
}
}
}
Aggregations