Search in sources :

Example 1 with MappedSimpleStatement

use of com.datastax.oss.dsbulk.workflow.commons.statement.MappedSimpleStatement in project dsbulk by datastax.

the class MetricsManagerTest method setUp.

@BeforeEach
void setUp() throws Exception {
    URI resource1 = new URI("file:///file1.csv");
    URI resource2 = new URI("file:///file2.csv");
    URI resource3 = new URI("file:///file3.csv");
    String source1 = "line1\n";
    String source2 = "line2\n";
    String source3 = "line3\n";
    record1 = DefaultRecord.indexed(source1, resource1, -1, "irrelevant");
    record2 = DefaultRecord.indexed(source2, resource2, -1, "irrelevant");
    record3 = new DefaultErrorRecord(source3, resource3, -1, new RuntimeException("irrelevant"));
    BatchableStatement<?> stmt1 = new MappedSimpleStatement(record1, SimpleStatement.newInstance("irrelevant"));
    BatchableStatement<?> stmt2 = new MappedSimpleStatement(record2, SimpleStatement.newInstance("irrelevant"));
    stmt3 = new UnmappableStatement(record3, new RuntimeException("irrelevant"));
    batch = BatchStatement.newInstance(DefaultBatchType.UNLOGGED).add(stmt1).add(stmt2);
}
Also used : MappedSimpleStatement(com.datastax.oss.dsbulk.workflow.commons.statement.MappedSimpleStatement) DefaultErrorRecord(com.datastax.oss.dsbulk.connectors.api.DefaultErrorRecord) URI(java.net.URI) UnmappableStatement(com.datastax.oss.dsbulk.workflow.commons.statement.UnmappableStatement) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

DefaultErrorRecord (com.datastax.oss.dsbulk.connectors.api.DefaultErrorRecord)1 MappedSimpleStatement (com.datastax.oss.dsbulk.workflow.commons.statement.MappedSimpleStatement)1 UnmappableStatement (com.datastax.oss.dsbulk.workflow.commons.statement.UnmappableStatement)1 URI (java.net.URI)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1