Search in sources :

Example 1 with SyntaxErrorResult

use of com.datastax.oss.simulacron.common.result.SyntaxErrorResult in project dsbulk by datastax.

the class JsonEndToEndSimulacronIT method unload_failure_during_read_multi_thread.

@Test
void unload_failure_during_read_multi_thread() {
    primeIpByCountryTable(simulacron);
    RequestPrime prime = createQueryWithError(SELECT_FROM_IP_BY_COUNTRY, new SyntaxErrorResult("Invalid table", 0L, false));
    simulacron.prime(new Prime(prime));
    String[] args = { "unload", "-c", "json", "--connector.json.url", StringUtils.quoteJson(unloadDir), "--connector.json.maxConcurrentFiles", "4", "--schema.keyspace", "ks1", "--schema.query", SELECT_FROM_IP_BY_COUNTRY, "--schema.mapping", IP_BY_COUNTRY_MAPPING_NAMED };
    ExitStatus status = new DataStaxBulkLoader(addCommonSettings(args)).run();
    assertStatus(status, STATUS_ABORTED_FATAL_ERROR);
    validateQueryCount(simulacron, 0, SELECT_FROM_IP_BY_COUNTRY, LOCAL_ONE);
    validatePrepare(simulacron, SELECT_FROM_IP_BY_COUNTRY);
}
Also used : ExitStatus(com.datastax.oss.dsbulk.runner.ExitStatus) Prime(com.datastax.oss.simulacron.common.stubbing.Prime) RequestPrime(com.datastax.oss.simulacron.common.cluster.RequestPrime) RequestPrime(com.datastax.oss.simulacron.common.cluster.RequestPrime) SyntaxErrorResult(com.datastax.oss.simulacron.common.result.SyntaxErrorResult) DataStaxBulkLoader(com.datastax.oss.dsbulk.runner.DataStaxBulkLoader) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with SyntaxErrorResult

use of com.datastax.oss.simulacron.common.result.SyntaxErrorResult in project dsbulk by datastax.

the class CSVEndToEndSimulacronIT method unload_failure_during_read_single_thread.

@Test
void unload_failure_during_read_single_thread() {
    primeIpByCountryTable(simulacron);
    RequestPrime prime = createQueryWithError(SELECT_FROM_IP_BY_COUNTRY, new SyntaxErrorResult("Invalid table", 0L, false));
    simulacron.prime(new Prime(prime));
    String[] args = { "unload", "-header", "false", "--connector.csv.url", quoteJson(unloadDir), "--connector.csv.maxConcurrentFiles", "1", "--schema.keyspace", "ks1", "--schema.query", SELECT_FROM_IP_BY_COUNTRY, "--schema.mapping", IP_BY_COUNTRY_MAPPING_INDEXED };
    ExitStatus status = new DataStaxBulkLoader(addCommonSettings(args)).run();
    assertStatus(status, STATUS_ABORTED_FATAL_ERROR);
    validateQueryCount(simulacron, 0, SELECT_FROM_IP_BY_COUNTRY, LOCAL_ONE);
    validatePrepare(simulacron, SELECT_FROM_IP_BY_COUNTRY);
}
Also used : ExitStatus(com.datastax.oss.dsbulk.runner.ExitStatus) Prime(com.datastax.oss.simulacron.common.stubbing.Prime) RequestPrime(com.datastax.oss.simulacron.common.cluster.RequestPrime) RequestPrime(com.datastax.oss.simulacron.common.cluster.RequestPrime) SyntaxErrorResult(com.datastax.oss.simulacron.common.result.SyntaxErrorResult) DataStaxBulkLoader(com.datastax.oss.dsbulk.runner.DataStaxBulkLoader) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 3 with SyntaxErrorResult

use of com.datastax.oss.simulacron.common.result.SyntaxErrorResult in project dsbulk by datastax.

the class CSVEndToEndSimulacronIT method unload_failure_during_read_multi_thread.

@Test
void unload_failure_during_read_multi_thread() {
    primeIpByCountryTable(simulacron);
    RequestPrime prime = createQueryWithError(SELECT_FROM_IP_BY_COUNTRY, new SyntaxErrorResult("Invalid table", 0L, false));
    simulacron.prime(new Prime(prime));
    String[] args = { "unload", "-header", "false", "--connector.csv.url", quoteJson(unloadDir), "--connector.csv.maxConcurrentFiles", "1C", "--schema.keyspace", "ks1", "--schema.query", SELECT_FROM_IP_BY_COUNTRY, "--schema.mapping", IP_BY_COUNTRY_MAPPING_INDEXED };
    ExitStatus status = new DataStaxBulkLoader(addCommonSettings(args)).run();
    assertStatus(status, STATUS_ABORTED_FATAL_ERROR);
    validateQueryCount(simulacron, 0, SELECT_FROM_IP_BY_COUNTRY, LOCAL_ONE);
    validatePrepare(simulacron, SELECT_FROM_IP_BY_COUNTRY);
}
Also used : ExitStatus(com.datastax.oss.dsbulk.runner.ExitStatus) Prime(com.datastax.oss.simulacron.common.stubbing.Prime) RequestPrime(com.datastax.oss.simulacron.common.cluster.RequestPrime) RequestPrime(com.datastax.oss.simulacron.common.cluster.RequestPrime) SyntaxErrorResult(com.datastax.oss.simulacron.common.result.SyntaxErrorResult) DataStaxBulkLoader(com.datastax.oss.dsbulk.runner.DataStaxBulkLoader) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 4 with SyntaxErrorResult

use of com.datastax.oss.simulacron.common.result.SyntaxErrorResult in project dsbulk by datastax.

the class JsonEndToEndSimulacronIT method unload_failure_during_read_single_thread.

@Test
void unload_failure_during_read_single_thread() {
    primeIpByCountryTable(simulacron);
    RequestPrime prime = createQueryWithError(SELECT_FROM_IP_BY_COUNTRY, new SyntaxErrorResult("Invalid table", 0L, false));
    simulacron.prime(new Prime(prime));
    String[] args = { "unload", "-c", "json", "--connector.json.url", StringUtils.quoteJson(unloadDir), "--connector.json.maxConcurrentFiles", "1", "--schema.keyspace", "ks1", "--schema.query", SELECT_FROM_IP_BY_COUNTRY, "--schema.mapping", IP_BY_COUNTRY_MAPPING_NAMED };
    ExitStatus status = new DataStaxBulkLoader(addCommonSettings(args)).run();
    assertStatus(status, STATUS_ABORTED_FATAL_ERROR);
    validateQueryCount(simulacron, 0, SELECT_FROM_IP_BY_COUNTRY, LOCAL_ONE);
    validatePrepare(simulacron, SELECT_FROM_IP_BY_COUNTRY);
}
Also used : ExitStatus(com.datastax.oss.dsbulk.runner.ExitStatus) Prime(com.datastax.oss.simulacron.common.stubbing.Prime) RequestPrime(com.datastax.oss.simulacron.common.cluster.RequestPrime) RequestPrime(com.datastax.oss.simulacron.common.cluster.RequestPrime) SyntaxErrorResult(com.datastax.oss.simulacron.common.result.SyntaxErrorResult) DataStaxBulkLoader(com.datastax.oss.dsbulk.runner.DataStaxBulkLoader) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

DataStaxBulkLoader (com.datastax.oss.dsbulk.runner.DataStaxBulkLoader)4 ExitStatus (com.datastax.oss.dsbulk.runner.ExitStatus)4 RequestPrime (com.datastax.oss.simulacron.common.cluster.RequestPrime)4 SyntaxErrorResult (com.datastax.oss.simulacron.common.result.SyntaxErrorResult)4 Prime (com.datastax.oss.simulacron.common.stubbing.Prime)4 Test (org.junit.jupiter.api.Test)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4