Sha256: e9a33cecb2384f2b42ceafb644b304c5793402c6e043649c6302211e1e14043e

Contents?: true

Size: 738 Bytes

Versions: 7

Compression:

Stored size: 738 Bytes

Contents

package org.embulk.executor.mapreduce;

import org.apache.hadoop.io.NullWritable;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class TestEmbulkRecordReader
{
    @Test
    public void simpleTest()
    {
        int[] taskIndexes = new int[] {0, 1, 4, 6, 7};
        try (EmbulkRecordReader r = new EmbulkRecordReader(new EmbulkInputSplit(taskIndexes))) {
            int i = 0;
            while (r.nextKeyValue()) {
                assertEquals(taskIndexes[i], r.getCurrentKey().get());
                assertTrue(r.getCurrentValue() instanceof NullWritable);
                i++;
            }
            assertEquals(taskIndexes.length, i);
        }
    }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
embulk-executor-mapreduce-0.3.0 src/test/java/org/embulk/executor/mapreduce/TestEmbulkRecordReader.java
embulk-executor-mapreduce-0.2.8 src/test/java/org/embulk/executor/mapreduce/TestEmbulkRecordReader.java
embulk-executor-mapreduce-0.2.7 src/test/java/org/embulk/executor/mapreduce/TestEmbulkRecordReader.java
embulk-executor-mapreduce-0.2.6 src/test/java/org/embulk/executor/mapreduce/TestEmbulkRecordReader.java
embulk-executor-mapreduce-0.2.5 src/test/java/org/embulk/executor/mapreduce/TestEmbulkRecordReader.java
embulk-executor-mapreduce-0.2.4 src/test/java/org/embulk/executor/mapreduce/TestEmbulkRecordReader.java
embulk-executor-mapreduce-0.2.3 src/test/java/org/embulk/executor/mapreduce/TestEmbulkRecordReader.java