Search in sources :

Example 1 with SourceQueryModule

use of com.facebook.presto.verifier.source.SourceQueryModule in project presto by prestodb.

the class AbstractVerifyCommand method run.

@Override
public void run() {
    if (configFilename != null) {
        System.setProperty("config", configFilename);
    }
    Bootstrap app = new Bootstrap(ImmutableList.<Module>builder().add(new VerifierModule(getSqlParserOptions(), getCustomQueryFilterClasses())).add(new SourceQueryModule(getCustomSourceQuerySupplierTypes())).add(new EventClientModule(getCustomEventClientTypes())).add(new QueryActionsModule(getSqlExceptionClassifier(), getCustomQueryActionTypes())).addAll(getAdditionalModules()).build());
    Injector injector = null;
    try {
        injector = app.initialize();
    } catch (Exception e) {
        throwIfUnchecked(e);
        throw new RuntimeException(e);
    } finally {
        if (injector != null) {
            try {
                injector.getInstance(LifeCycleManager.class).stop();
            } catch (Exception e) {
                log.error(e);
            }
        }
    }
}
Also used : QueryActionsModule(com.facebook.presto.verifier.prestoaction.QueryActionsModule) LifeCycleManager(com.facebook.airlift.bootstrap.LifeCycleManager) Injector(com.google.inject.Injector) Bootstrap(com.facebook.airlift.bootstrap.Bootstrap) SourceQueryModule(com.facebook.presto.verifier.source.SourceQueryModule) EventClientModule(com.facebook.presto.verifier.event.EventClientModule)

Aggregations

Bootstrap (com.facebook.airlift.bootstrap.Bootstrap)1 LifeCycleManager (com.facebook.airlift.bootstrap.LifeCycleManager)1 EventClientModule (com.facebook.presto.verifier.event.EventClientModule)1 QueryActionsModule (com.facebook.presto.verifier.prestoaction.QueryActionsModule)1 SourceQueryModule (com.facebook.presto.verifier.source.SourceQueryModule)1 Injector (com.google.inject.Injector)1