use of org.apache.drill.exec.store.StoragePluginRegistry in project drill by apache.
the class MongoTestBase method initMongoStoragePlugin.
public static void initMongoStoragePlugin() throws Exception {
final StoragePluginRegistry pluginRegistry = getDrillbitContext().getStorage();
storagePlugin = (MongoStoragePlugin) pluginRegistry.getPlugin(MongoStoragePluginConfig.NAME);
storagePluginConfig = storagePlugin.getConfig();
storagePluginConfig.setEnabled(true);
pluginRegistry.createOrUpdate(MongoStoragePluginConfig.NAME, storagePluginConfig, true);
if (System.getProperty("drill.mongo.tests.bson.reader", "true").equalsIgnoreCase("false")) {
testNoResult(String.format("alter session set `%s` = false", ExecConstants.MONGO_BSON_RECORD_READER));
} else {
testNoResult(String.format("alter session set `%s` = true", ExecConstants.MONGO_BSON_RECORD_READER));
}
}
use of org.apache.drill.exec.store.StoragePluginRegistry in project drill by apache.
the class ClusterFixture method defineWorkspace.
public static void defineWorkspace(Drillbit drillbit, String pluginName, String schemaName, String path, String defaultFormat, FormatPluginConfig format) throws ExecutionSetupException {
@SuppressWarnings("resource") final StoragePluginRegistry pluginRegistry = drillbit.getContext().getStorage();
@SuppressWarnings("resource") final FileSystemPlugin plugin = (FileSystemPlugin) pluginRegistry.getPlugin(pluginName);
final FileSystemConfig pluginConfig = (FileSystemConfig) plugin.getConfig();
final WorkspaceConfig newTmpWSConfig = new WorkspaceConfig(path, true, defaultFormat);
pluginConfig.workspaces.remove(schemaName);
pluginConfig.workspaces.put(schemaName, newTmpWSConfig);
if (format != null) {
pluginConfig.formats.put(defaultFormat, format);
}
pluginRegistry.createOrUpdate(pluginName, pluginConfig, true);
}
use of org.apache.drill.exec.store.StoragePluginRegistry in project drill by axbaretto.
the class BaseHBaseTest method setupDefaultTestCluster.
@BeforeClass
public static void setupDefaultTestCluster() throws Exception {
/*
* Change the following to HBaseTestsSuite.configure(false, true)
* if you want to test against an externally running HBase cluster.
*/
HBaseTestsSuite.configure(true, /*manageHBaseCluster*/
true);
HBaseTestsSuite.initCluster();
BaseTestQuery.setupDefaultTestCluster();
final StoragePluginRegistry pluginRegistry = getDrillbitContext().getStorage();
storagePlugin = (HBaseStoragePlugin) pluginRegistry.getPlugin(HBASE_STORAGE_PLUGIN_NAME);
storagePluginConfig = storagePlugin.getConfig();
storagePluginConfig.setEnabled(true);
storagePluginConfig.setZookeeperPort(HBaseTestsSuite.getZookeeperPort());
pluginRegistry.createOrUpdate(HBASE_STORAGE_PLUGIN_NAME, storagePluginConfig, true);
}
use of org.apache.drill.exec.store.StoragePluginRegistry in project drill by axbaretto.
the class KafkaTestBase method initKafkaStoragePlugin.
public static void initKafkaStoragePlugin(EmbeddedKafkaCluster embeddedKafkaCluster) throws Exception {
final StoragePluginRegistry pluginRegistry = getDrillbitContext().getStorage();
Map<String, String> kafkaConsumerProps = Maps.newHashMap();
kafkaConsumerProps.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, embeddedKafkaCluster.getKafkaBrokerList());
kafkaConsumerProps.put(ConsumerConfig.GROUP_ID_CONFIG, "drill-test-consumer");
storagePluginConfig = new KafkaStoragePluginConfig(kafkaConsumerProps);
storagePluginConfig.setEnabled(true);
pluginRegistry.createOrUpdate(KafkaStoragePluginConfig.NAME, storagePluginConfig, true);
testNoResult(String.format("alter session set `%s` = '%s'", ExecConstants.KAFKA_RECORD_READER, "org.apache.drill.exec.store.kafka.decoders.JsonMessageReader"));
testNoResult(String.format("alter session set `%s` = %d", ExecConstants.KAFKA_POLL_TIMEOUT, 200));
}
use of org.apache.drill.exec.store.StoragePluginRegistry in project drill by axbaretto.
the class MongoTestBase method initMongoStoragePlugin.
public static void initMongoStoragePlugin() throws Exception {
final StoragePluginRegistry pluginRegistry = getDrillbitContext().getStorage();
storagePlugin = (MongoStoragePlugin) pluginRegistry.getPlugin(MongoStoragePluginConfig.NAME);
storagePluginConfig = storagePlugin.getConfig();
storagePluginConfig.setEnabled(true);
pluginRegistry.createOrUpdate(MongoStoragePluginConfig.NAME, storagePluginConfig, true);
if (System.getProperty("drill.mongo.tests.bson.reader", "true").equalsIgnoreCase("false")) {
testNoResult(String.format("alter session set `%s` = false", ExecConstants.MONGO_BSON_RECORD_READER));
} else {
testNoResult(String.format("alter session set `%s` = true", ExecConstants.MONGO_BSON_RECORD_READER));
}
}
Aggregations