Search in sources :

Example 1 with CachingPersistentStoreProvider

use of org.apache.drill.exec.store.sys.store.provider.CachingPersistentStoreProvider in project drill by apache.

the class PersistentStoreRegistry method newPStoreProvider.

@SuppressWarnings("unchecked")
public PersistentStoreProvider newPStoreProvider() throws ExecutionSetupException {
    try {
        String storeProviderClassName = config.getString(ExecConstants.SYS_STORE_PROVIDER_CLASS);
        logger.info("Using the configured PStoreProvider class: '{}'.", storeProviderClassName);
        Class<? extends PersistentStoreProvider> storeProviderClass = (Class<? extends PersistentStoreProvider>) Class.forName(storeProviderClassName);
        Constructor<? extends PersistentStoreProvider> c = storeProviderClass.getConstructor(PersistentStoreRegistry.class);
        return new CachingPersistentStoreProvider(c.newInstance(this));
    } catch (ConfigException.Missing | ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
        logger.error(e.getMessage(), e);
        throw new ExecutionSetupException("A System Table provider was either not specified or could not be found or instantiated", e);
    }
}
Also used : ExecutionSetupException(org.apache.drill.common.exceptions.ExecutionSetupException) CachingPersistentStoreProvider(org.apache.drill.exec.store.sys.store.provider.CachingPersistentStoreProvider) InvocationTargetException(java.lang.reflect.InvocationTargetException) CachingPersistentStoreProvider(org.apache.drill.exec.store.sys.store.provider.CachingPersistentStoreProvider)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ExecutionSetupException (org.apache.drill.common.exceptions.ExecutionSetupException)1 CachingPersistentStoreProvider (org.apache.drill.exec.store.sys.store.provider.CachingPersistentStoreProvider)1