Search in sources :

Example 1 with MockBreakageStorageEngineConfig

use of org.apache.drill.exec.store.mock.MockBreakageStorage.MockBreakageStorageEngineConfig in project drill by apache.

the class ClusterMockStorageFixture method insertMockStorage.

/**
 * This should be called after bits are started
 * @param name the 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();
        MockBreakageStorage plugin;
        try {
            MockBreakageStorageEngineConfig config = MockBreakageStorageEngineConfig.INSTANCE;
            config.setEnabled(true);
            pluginRegistry.put(name, config);
            plugin = (MockBreakageStorage) pluginRegistry.getPlugin(name);
        } catch (PluginException e) {
            throw new IllegalStateException(e);
        }
        plugin.setBreakRegister(breakRegisterSchema);
    }
}
Also used : StoragePluginRegistry(org.apache.drill.exec.store.StoragePluginRegistry) MockBreakageStorage(org.apache.drill.exec.store.mock.MockBreakageStorage) Drillbit(org.apache.drill.exec.server.Drillbit) PluginException(org.apache.drill.exec.store.StoragePluginRegistry.PluginException) MockBreakageStorageEngineConfig(org.apache.drill.exec.store.mock.MockBreakageStorage.MockBreakageStorageEngineConfig)

Aggregations

Drillbit (org.apache.drill.exec.server.Drillbit)1 StoragePluginRegistry (org.apache.drill.exec.store.StoragePluginRegistry)1 PluginException (org.apache.drill.exec.store.StoragePluginRegistry.PluginException)1 MockBreakageStorage (org.apache.drill.exec.store.mock.MockBreakageStorage)1 MockBreakageStorageEngineConfig (org.apache.drill.exec.store.mock.MockBreakageStorage.MockBreakageStorageEngineConfig)1