Search in sources :

Example 1 with MockStorageEngineConfig

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);
    }
}
Also used : StoragePluginRegistry(org.apache.drill.exec.store.StoragePluginRegistry) MockStorageEngineConfig(org.apache.drill.exec.store.mock.MockStorageEngineConfig) MockBreakageStorage(org.apache.drill.exec.store.mock.MockBreakageStorage) Drillbit(org.apache.drill.exec.server.Drillbit) StoragePluginRegistryImpl(org.apache.drill.exec.store.StoragePluginRegistryImpl)

Example 2 with MockStorageEngineConfig

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);
}
Also used : StoragePluginRegistry(org.apache.drill.exec.store.StoragePluginRegistry) MockStorageEngineConfig(org.apache.drill.exec.store.mock.MockStorageEngineConfig)

Example 3 with MockStorageEngineConfig

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);
}
Also used : StoragePluginRegistry(org.apache.drill.exec.store.StoragePluginRegistry) MockStorageEngineConfig(org.apache.drill.exec.store.mock.MockStorageEngineConfig) MockStorageEngine(org.apache.drill.exec.store.mock.MockStorageEngine) StoragePluginRegistryImpl(org.apache.drill.exec.store.StoragePluginRegistryImpl)

Aggregations

StoragePluginRegistry (org.apache.drill.exec.store.StoragePluginRegistry)3 MockStorageEngineConfig (org.apache.drill.exec.store.mock.MockStorageEngineConfig)3 StoragePluginRegistryImpl (org.apache.drill.exec.store.StoragePluginRegistryImpl)2 Drillbit (org.apache.drill.exec.server.Drillbit)1 MockBreakageStorage (org.apache.drill.exec.store.mock.MockBreakageStorage)1 MockStorageEngine (org.apache.drill.exec.store.mock.MockStorageEngine)1