use of com.facebook.presto.verifier.prestoaction.QueryActionsModule 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);
}
}
}
}
use of com.facebook.presto.verifier.prestoaction.QueryActionsModule in project presto by prestodb.
the class TestPrestoQuerySourceQuerySupplier method setup.
@BeforeClass
public void setup() throws Exception {
queryRunner = setupPresto();
String host = queryRunner.getServer().getAddress().getHost();
int port = queryRunner.getServer().getAddress().getPort();
Bootstrap app = new Bootstrap(ImmutableList.<Module>builder().add(new SourceQueryModule(ImmutableSet.of())).add(new QueryActionsModule(PrestoExceptionClassifier.defaultBuilder().build(), ImmutableSet.of())).add(binder -> {
configBinder(binder).bindConfig(VerifierConfig.class);
binder.bind(SqlParserOptions.class).toInstance(new SqlParserOptions());
binder.bind(SqlParser.class).in(SINGLETON);
}).build());
injector = app.setRequiredConfigurationProperties(ImmutableMap.<String, String>builder().put("test-id", "10000").put("control.hosts", format("%s,%s", host, host)).put("control.jdbc-port", String.valueOf(port)).put("source-query.supplier", "presto-query").put("source-query.query", SOURCE_FETCHING_QUERY).put("source-query.catalog", CATALOG).put("source-query.schema", SCHEMA).put("source-query.username", "test_user").build()).initialize();
}
Aggregations