Search in sources :

Example 1 with RetryConfig

use of com.facebook.presto.verifier.retry.RetryConfig in project presto by prestodb.

the class AbstractVerificationTest method getPrestoAction.

protected PrestoAction getPrestoAction(Optional<QueryConfiguration> queryConfiguration) {
    VerificationContext verificationContext = VerificationContext.create(NAME, SUITE);
    VerifierConfig verifierConfig = new VerifierConfig().setTestId(TEST_ID);
    RetryConfig retryConfig = new RetryConfig();
    PrestoActionConfig prestoActionConfig = new PrestoActionConfig().setHosts(queryRunner.getServer().getAddress().getHost()).setJdbcPort(queryRunner.getServer().getAddress().getPort());
    QueryActionsConfig queryActionsConfig = new QueryActionsConfig();
    return new JdbcPrestoAction(exceptionClassifier, queryConfiguration.orElse(QUERY_CONFIGURATION), verificationContext, new JdbcUrlSelector(prestoActionConfig.getJdbcUrls()), prestoActionConfig, queryActionsConfig.getMetadataTimeout(), queryActionsConfig.getChecksumTimeout(), retryConfig, retryConfig, verifierConfig);
}
Also used : QueryActionsConfig(com.facebook.presto.verifier.prestoaction.QueryActionsConfig) PrestoActionConfig(com.facebook.presto.verifier.prestoaction.PrestoActionConfig) RetryConfig(com.facebook.presto.verifier.retry.RetryConfig) JdbcPrestoAction(com.facebook.presto.verifier.prestoaction.JdbcPrestoAction) JdbcUrlSelector(com.facebook.presto.verifier.prestoaction.JdbcUrlSelector)

Example 2 with RetryConfig

use of com.facebook.presto.verifier.retry.RetryConfig in project presto by prestodb.

the class TestDeterminismAnalyzer method createDeterminismAnalyzer.

private static DeterminismAnalyzer createDeterminismAnalyzer(String mutableCatalogPattern) {
    QueryConfiguration configuration = new QueryConfiguration(CATALOG, SCHEMA, Optional.of("user"), Optional.empty(), Optional.empty());
    VerificationContext verificationContext = VerificationContext.create(SUITE, NAME);
    VerifierConfig verifierConfig = new VerifierConfig().setTestId("test-id");
    RetryConfig retryConfig = new RetryConfig();
    QueryActionsConfig queryActionsConfig = new QueryActionsConfig();
    TypeManager typeManager = createTypeManager();
    PrestoAction prestoAction = new JdbcPrestoAction(PrestoExceptionClassifier.defaultBuilder().build(), configuration, verificationContext, new JdbcUrlSelector(ImmutableList.of()), new PrestoActionConfig(), queryActionsConfig.getMetadataTimeout(), queryActionsConfig.getChecksumTimeout(), retryConfig, retryConfig, verifierConfig);
    QueryRewriter queryRewriter = new QueryRewriter(sqlParser, typeManager, prestoAction, ImmutableMap.of(CONTROL, QualifiedName.of("tmp_verifier_c"), TEST, QualifiedName.of("tmp_verifier_t")), ImmutableMap.of());
    ChecksumValidator checksumValidator = createChecksumValidator(verifierConfig);
    SourceQuery sourceQuery = new SourceQuery("test", "", "", "", configuration, configuration);
    return new DeterminismAnalyzer(sourceQuery, prestoAction, queryRewriter, checksumValidator, typeManager, new DeterminismAnalyzerConfig().setNonDeterministicCatalogs(mutableCatalogPattern));
}
Also used : QueryActionsConfig(com.facebook.presto.verifier.prestoaction.QueryActionsConfig) JdbcPrestoAction(com.facebook.presto.verifier.prestoaction.JdbcPrestoAction) PrestoAction(com.facebook.presto.verifier.prestoaction.PrestoAction) PrestoActionConfig(com.facebook.presto.verifier.prestoaction.PrestoActionConfig) QueryRewriter(com.facebook.presto.verifier.rewrite.QueryRewriter) JdbcPrestoAction(com.facebook.presto.verifier.prestoaction.JdbcPrestoAction) RetryConfig(com.facebook.presto.verifier.retry.RetryConfig) TypeManager(com.facebook.presto.common.type.TypeManager) VerifierTestUtil.createTypeManager(com.facebook.presto.verifier.VerifierTestUtil.createTypeManager) VerifierTestUtil.createChecksumValidator(com.facebook.presto.verifier.VerifierTestUtil.createChecksumValidator) ChecksumValidator(com.facebook.presto.verifier.checksum.ChecksumValidator) JdbcUrlSelector(com.facebook.presto.verifier.prestoaction.JdbcUrlSelector)

Example 3 with RetryConfig

use of com.facebook.presto.verifier.retry.RetryConfig in project presto by prestodb.

the class TestJdbcPrestoAction method setup.

@BeforeMethod
public void setup() {
    QueryActionsConfig queryActionsConfig = new QueryActionsConfig();
    verificationContext = VerificationContext.create(SUITE, NAME);
    PrestoActionConfig prestoActionConfig = new PrestoActionConfig().setHosts(queryRunner.getServer().getAddress().getHost()).setJdbcPort(queryRunner.getServer().getAddress().getPort());
    prestoAction = new JdbcPrestoAction(PrestoExceptionClassifier.defaultBuilder().build(), CONFIGURATION, verificationContext, new JdbcUrlSelector(prestoActionConfig.getJdbcUrls()), prestoActionConfig, queryActionsConfig.getMetadataTimeout(), queryActionsConfig.getChecksumTimeout(), new RetryConfig(), new RetryConfig(), new VerifierConfig().setTestId("test"));
}
Also used : RetryConfig(com.facebook.presto.verifier.retry.RetryConfig) VerifierConfig(com.facebook.presto.verifier.framework.VerifierConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 4 with RetryConfig

use of com.facebook.presto.verifier.retry.RetryConfig in project presto by prestodb.

the class TestQueryRewriter method setup.

@BeforeClass
public void setup() throws Exception {
    queryRunner = setupPresto();
    queryRunner.execute("CREATE TABLE test_table (a bigint, b varchar)");
    PrestoActionConfig prestoActionConfig = new PrestoActionConfig().setHosts(queryRunner.getServer().getAddress().getHost()).setJdbcPort(queryRunner.getServer().getAddress().getPort());
    prestoAction = new JdbcPrestoAction(PrestoExceptionClassifier.defaultBuilder().build(), CONFIGURATION, VerificationContext.create(SUITE, NAME), new JdbcUrlSelector(prestoActionConfig.getJdbcUrls()), prestoActionConfig, new QueryActionsConfig().getMetadataTimeout(), new QueryActionsConfig().getChecksumTimeout(), new RetryConfig(), new RetryConfig(), new VerifierConfig().setTestId("test"));
}
Also used : QueryActionsConfig(com.facebook.presto.verifier.prestoaction.QueryActionsConfig) PrestoActionConfig(com.facebook.presto.verifier.prestoaction.PrestoActionConfig) RetryConfig(com.facebook.presto.verifier.retry.RetryConfig) JdbcPrestoAction(com.facebook.presto.verifier.prestoaction.JdbcPrestoAction) VerifierConfig(com.facebook.presto.verifier.framework.VerifierConfig) JdbcUrlSelector(com.facebook.presto.verifier.prestoaction.JdbcUrlSelector) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

RetryConfig (com.facebook.presto.verifier.retry.RetryConfig)4 JdbcPrestoAction (com.facebook.presto.verifier.prestoaction.JdbcPrestoAction)3 JdbcUrlSelector (com.facebook.presto.verifier.prestoaction.JdbcUrlSelector)3 PrestoActionConfig (com.facebook.presto.verifier.prestoaction.PrestoActionConfig)3 QueryActionsConfig (com.facebook.presto.verifier.prestoaction.QueryActionsConfig)3 VerifierConfig (com.facebook.presto.verifier.framework.VerifierConfig)2 TypeManager (com.facebook.presto.common.type.TypeManager)1 VerifierTestUtil.createChecksumValidator (com.facebook.presto.verifier.VerifierTestUtil.createChecksumValidator)1 VerifierTestUtil.createTypeManager (com.facebook.presto.verifier.VerifierTestUtil.createTypeManager)1 ChecksumValidator (com.facebook.presto.verifier.checksum.ChecksumValidator)1 PrestoAction (com.facebook.presto.verifier.prestoaction.PrestoAction)1 QueryRewriter (com.facebook.presto.verifier.rewrite.QueryRewriter)1 BeforeClass (org.testng.annotations.BeforeClass)1 BeforeMethod (org.testng.annotations.BeforeMethod)1