Search in sources :

Example 51 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class CheckStorageConfig method ensureStorageEnginePickup.

@Test
public void ensureStorageEnginePickup() {
    DrillConfig config = DrillConfig.create();
    ScanResult scan = ClassPathScanner.fromPrescan(config);
    Collection<?> engines = scan.getImplementations(StoragePluginConfig.class);
    assertEquals(engines.size(), 1);
}
Also used : ScanResult(org.apache.drill.common.scanner.persistence.ScanResult) DrillConfig(org.apache.drill.common.config.DrillConfig) Test(org.junit.Test) DrillTest(org.apache.drill.test.DrillTest)

Example 52 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class CheckStorageConfig method checkPlanParsing.

@Test
public void checkPlanParsing() throws Exception {
    DrillConfig config = DrillConfig.create();
    ScanResult scan = ClassPathScanner.fromPrescan(config);
    LogicalPlan plan = LogicalPlan.parse(new LogicalPlanPersistence(config, scan), FileUtils.getResourceAsString("/storage_engine_plan.json"));
}
Also used : ScanResult(org.apache.drill.common.scanner.persistence.ScanResult) DrillConfig(org.apache.drill.common.config.DrillConfig) LogicalPlan(org.apache.drill.common.logical.LogicalPlan) LogicalPlanPersistence(org.apache.drill.common.config.LogicalPlanPersistence) Test(org.junit.Test) DrillTest(org.apache.drill.test.DrillTest)

Example 53 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class TestFormatPluginOptionExtractor method test.

@Test
public void test() {
    DrillConfig config = DrillConfig.create();
    ScanResult scanResult = RunTimeScan.fromPrescan(config);
    FormatPluginOptionExtractor e = new FormatPluginOptionExtractor(scanResult);
    Collection<FormatPluginOptionsDescriptor> options = e.getOptions();
    for (FormatPluginOptionsDescriptor d : options) {
        assertEquals(d.pluginConfigClass.getAnnotation(JsonTypeName.class).value(), d.typeName);
        switch(d.typeName) {
            case "text":
                assertEquals(TextFormatConfig.class, d.pluginConfigClass);
                assertEquals("(type: String, lineDelimiter: String, fieldDelimiter: String, quote: String, escape: String, comment: String, skipFirstLine: boolean, extractHeader: boolean)", d.presentParams());
                break;
            case "named":
                assertEquals(NamedFormatPluginConfig.class, d.pluginConfigClass);
                assertEquals("(type: String, name: String)", d.presentParams());
                break;
            case "parquet":
                assertEquals(d.typeName, "(type: String, autoCorrectCorruptDates: boolean)", d.presentParams());
                break;
            case "json":
            case "sequencefile":
            case "avro":
                assertEquals(d.typeName, "(type: String)", d.presentParams());
                break;
            case "httpd":
                assertEquals("(type: String, logFormat: String, timestampFormat: String)", d.presentParams());
                break;
            default:
                fail("add validation for format plugin type " + d.typeName);
        }
    }
}
Also used : ScanResult(org.apache.drill.common.scanner.persistence.ScanResult) DrillConfig(org.apache.drill.common.config.DrillConfig) Test(org.junit.Test)

Example 54 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class TestByteComparisonFunctions method setup.

@BeforeClass
public static void setup() {
    DrillConfig c = DrillConfig.create();
    allocator = RootAllocatorFactory.newRoot(c);
    hello = ValueHolderHelper.getVarCharHolder(allocator, "hello");
    goodbye = ValueHolderHelper.getVarCharHolder(allocator, "goodbye");
    helloLong = ValueHolderHelper.getVarCharHolder(allocator, "hellomyfriend");
    goodbyeLong = ValueHolderHelper.getVarCharHolder(allocator, "goodbyemyenemy");
}
Also used : DrillConfig(org.apache.drill.common.config.DrillConfig) BeforeClass(org.junit.BeforeClass)

Example 55 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class TestPStoreProviders method verifyZkStore.

@Test
public void verifyZkStore() throws Exception {
    DrillConfig config = getConfig();
    String connect = config.getString(ExecConstants.ZK_CONNECTION);
    CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder().namespace(config.getString(ExecConstants.ZK_ROOT)).retryPolicy(new RetryNTimes(1, 100)).connectionTimeoutMs(config.getInt(ExecConstants.ZK_TIMEOUT)).connectString(connect);
    try (CuratorFramework curator = builder.build()) {
        curator.start();
        ZookeeperPersistentStoreProvider provider = new ZookeeperPersistentStoreProvider(config, curator);
        PStoreTestUtil.test(provider);
    }
}
Also used : RetryNTimes(org.apache.curator.retry.RetryNTimes) CuratorFramework(org.apache.curator.framework.CuratorFramework) DrillConfig(org.apache.drill.common.config.DrillConfig) CuratorFrameworkFactory(org.apache.curator.framework.CuratorFrameworkFactory) ZookeeperPersistentStoreProvider(org.apache.drill.exec.store.sys.store.provider.ZookeeperPersistentStoreProvider) Test(org.junit.Test)

Aggregations

DrillConfig (org.apache.drill.common.config.DrillConfig)57 Test (org.junit.Test)35 Properties (java.util.Properties)19 DrillProperties (org.apache.drill.common.config.DrillProperties)15 Drillbit (org.apache.drill.exec.server.Drillbit)8 RemoteServiceSet (org.apache.drill.exec.server.RemoteServiceSet)8 BeforeClass (org.junit.BeforeClass)8 ScanResult (org.apache.drill.common.scanner.persistence.ScanResult)7 ExecTest (org.apache.drill.exec.ExecTest)7 LogicalPlanPersistence (org.apache.drill.common.config.LogicalPlanPersistence)6 RpcException (org.apache.drill.exec.rpc.RpcException)6 DrillbitEndpoint (org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint)5 NonTransientRpcException (org.apache.drill.exec.rpc.NonTransientRpcException)5 DrillTest (org.apache.drill.test.DrillTest)5 SchemaPath (org.apache.drill.common.expression.SchemaPath)4 BufferAllocator (org.apache.drill.exec.memory.BufferAllocator)4 DrillBuf (io.netty.buffer.DrillBuf)3 File (java.io.File)3 IOException (java.io.IOException)3 Field (java.lang.reflect.Field)3