Search in sources :

Example 1 with OpenTSDBStoragePluginConfig

use of org.apache.drill.exec.store.openTSDB.OpenTSDBStoragePluginConfig in project drill by axbaretto.

the class TestOpenTSDBPlugin method setup.

@BeforeClass
public static void setup() throws Exception {
    portNumber = getFreePortNumber(10_000, 200);
    final StoragePluginRegistry pluginRegistry = getDrillbitContext().getStorage();
    OpenTSDBStoragePluginConfig storagePluginConfig = new OpenTSDBStoragePluginConfig(String.format("http://localhost:%s", portNumber));
    storagePluginConfig.setEnabled(true);
    pluginRegistry.createOrUpdate(OpenTSDBStoragePluginConfig.NAME, storagePluginConfig, true);
}
Also used : OpenTSDBStoragePluginConfig(org.apache.drill.exec.store.openTSDB.OpenTSDBStoragePluginConfig) StoragePluginRegistry(org.apache.drill.exec.store.StoragePluginRegistry) BeforeClass(org.junit.BeforeClass)

Example 2 with OpenTSDBStoragePluginConfig

use of org.apache.drill.exec.store.openTSDB.OpenTSDBStoragePluginConfig in project drill by apache.

the class TestOpenTSDBPlugin method testInformationSchemaWrongPluginConfig.

@Test
public void testInformationSchemaWrongPluginConfig() throws Exception {
    try (ClusterFixture cluster = ClusterFixture.bareBuilder(dirTestWatcher).build();
        ClientFixture client = cluster.clientFixture()) {
        int portNumber = QueryTestUtil.getFreePortNumber(10_000, 200);
        final StoragePluginRegistry pluginRegistry = cluster.drillbit().getContext().getStorage();
        OpenTSDBStoragePluginConfig storagePluginConfig = new OpenTSDBStoragePluginConfig(String.format("http://localhost:%s/", portNumber));
        storagePluginConfig.setEnabled(true);
        pluginRegistry.put(OpenTSDBStoragePluginConfig.NAME, storagePluginConfig);
        String query = "select * from information_schema.`views`";
        client.queryBuilder().sql(query).run();
    }
}
Also used : OpenTSDBStoragePluginConfig(org.apache.drill.exec.store.openTSDB.OpenTSDBStoragePluginConfig) ClusterFixture(org.apache.drill.test.ClusterFixture) StoragePluginRegistry(org.apache.drill.exec.store.StoragePluginRegistry) ClientFixture(org.apache.drill.test.ClientFixture) ClusterTest(org.apache.drill.test.ClusterTest) Test(org.junit.Test)

Example 3 with OpenTSDBStoragePluginConfig

use of org.apache.drill.exec.store.openTSDB.OpenTSDBStoragePluginConfig in project drill by apache.

the class TestOpenTSDBPlugin method setup.

@BeforeClass
public static void setup() throws Exception {
    startCluster(ClusterFixture.builder(dirTestWatcher));
    portNumber = QueryTestUtil.getFreePortNumber(10_000, 200);
    final StoragePluginRegistry pluginRegistry = cluster.drillbit().getContext().getStorage();
    OpenTSDBStoragePluginConfig storagePluginConfig = new OpenTSDBStoragePluginConfig(String.format("http://localhost:%s", portNumber));
    storagePluginConfig.setEnabled(true);
    pluginRegistry.put(OpenTSDBStoragePluginConfig.NAME, storagePluginConfig);
}
Also used : OpenTSDBStoragePluginConfig(org.apache.drill.exec.store.openTSDB.OpenTSDBStoragePluginConfig) StoragePluginRegistry(org.apache.drill.exec.store.StoragePluginRegistry) BeforeClass(org.junit.BeforeClass)

Aggregations

StoragePluginRegistry (org.apache.drill.exec.store.StoragePluginRegistry)3 OpenTSDBStoragePluginConfig (org.apache.drill.exec.store.openTSDB.OpenTSDBStoragePluginConfig)3 BeforeClass (org.junit.BeforeClass)2 ClientFixture (org.apache.drill.test.ClientFixture)1 ClusterFixture (org.apache.drill.test.ClusterFixture)1 ClusterTest (org.apache.drill.test.ClusterTest)1 Test (org.junit.Test)1