use of org.apache.drill.exec.store.mock.MockStorageEngineConfig in project drill by axbaretto.
the class ClusterMockStorageFixture method insertMockStorage.
/**
* This should be called after bits are started
* @param name nthe mock storage name we are going to create
*/
public void insertMockStorage(String name, boolean breakRegisterSchema) {
for (Drillbit bit : drillbits()) {
// Bit name and registration.
final StoragePluginRegistry pluginRegistry = bit.getContext().getStorage();
MockStorageEngineConfig config = MockStorageEngineConfig.INSTANCE;
@SuppressWarnings("resource") MockBreakageStorage plugin = new MockBreakageStorage(MockStorageEngineConfig.INSTANCE, bit.getContext(), name);
((StoragePluginRegistryImpl) pluginRegistry).definePlugin(name, config, plugin);
plugin.setBreakRegister(breakRegisterSchema);
}
}
use of org.apache.drill.exec.store.mock.MockStorageEngineConfig in project drill by apache.
the class ClusterFixture method configureStoragePlugins.
private void configureStoragePlugins(Drillbit bit) throws Exception {
// Skip plugins if not running in test mode.
if (builder.dirTestWatcher == null) {
return;
}
// Create the dfs name space
builder.dirTestWatcher.newDfsTestTmpDir();
final StoragePluginRegistry pluginRegistry = bit.getContext().getStorage();
StoragePluginTestUtils.configureFormatPlugins(pluginRegistry);
StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getDfsTestTmpDir(), TMP_SCHEMA);
StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getRootDir(), ROOT_SCHEMA);
StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getRootDir(), SchemaFactory.DEFAULT_WS_NAME);
// Create the mock data plugin
MockStorageEngineConfig config = MockStorageEngineConfig.INSTANCE;
config.setEnabled(true);
pluginRegistry.put(MockStorageEngineConfig.NAME, config);
}
use of org.apache.drill.exec.store.mock.MockStorageEngineConfig in project drill by axbaretto.
the class ClusterFixture method configureStoragePlugins.
private void configureStoragePlugins(Drillbit bit) throws Exception {
// Create the dfs name space
builder.dirTestWatcher.newDfsTestTmpDir();
@SuppressWarnings("resource") final StoragePluginRegistry pluginRegistry = bit.getContext().getStorage();
StoragePluginTestUtils.configureFormatPlugins(pluginRegistry);
StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getDfsTestTmpDir(), TMP_SCHEMA);
StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getRootDir(), ROOT_SCHEMA);
StoragePluginTestUtils.updateSchemaLocation(StoragePluginTestUtils.DFS_PLUGIN_NAME, pluginRegistry, builder.dirTestWatcher.getRootDir(), DEFAULT_SCHEMA);
// Create the mock data plugin
MockStorageEngineConfig config = MockStorageEngineConfig.INSTANCE;
@SuppressWarnings("resource") MockStorageEngine plugin = new MockStorageEngine(MockStorageEngineConfig.INSTANCE, bit.getContext(), MockStorageEngineConfig.NAME);
((StoragePluginRegistryImpl) pluginRegistry).definePlugin(MockStorageEngineConfig.NAME, config, plugin);
}
Aggregations