Search in sources :

Example 6 with DefaultErrorRecord

use of com.datastax.oss.dsbulk.connectors.api.DefaultErrorRecord 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)6 DefaultRecord (com.datastax.oss.dsbulk.connectors.api.DefaultRecord)4 Record (com.datastax.oss.dsbulk.connectors.api.Record)3 Path (java.nio.file.Path)3 Test (org.junit.jupiter.api.Test)3 Row (com.datastax.oss.driver.api.core.cql.Row)2 UnmappableStatement (com.datastax.oss.dsbulk.workflow.commons.statement.UnmappableStatement)2 URI (java.net.URI)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 CqlIdentifier (com.datastax.oss.driver.api.core.CqlIdentifier)1 DriverTimeoutException (com.datastax.oss.driver.api.core.DriverTimeoutException)1 BatchStatement (com.datastax.oss.driver.api.core.cql.BatchStatement)1 ColumnDefinition (com.datastax.oss.driver.api.core.cql.ColumnDefinition)1 ColumnDefinitions (com.datastax.oss.driver.api.core.cql.ColumnDefinitions)1 ExecutionInfo (com.datastax.oss.driver.api.core.cql.ExecutionInfo)1 DataType (com.datastax.oss.driver.api.core.type.DataType)1 Field (com.datastax.oss.dsbulk.connectors.api.Field)1 BulkExecutionException (com.datastax.oss.dsbulk.executor.api.exception.BulkExecutionException)1 DefaultReadResult (com.datastax.oss.dsbulk.executor.api.result.DefaultReadResult)1 DefaultWriteResult (com.datastax.oss.dsbulk.executor.api.result.DefaultWriteResult)1