Search in sources :

Example 1 with MutableObjectIteratorWrapper

use of org.apache.flink.runtime.operators.testutils.MutableObjectIteratorWrapper in project flink by apache.

the class BlockResettableMutableObjectIteratorTest method startup.

@Before
public void startup() {
    // set up IO and memory manager
    this.memman = new MemoryManager(MEMORY_CAPACITY, 1);
    // create test objects
    this.objects = new ArrayList<Record>(20000);
    for (int i = 0; i < NUM_VALUES; ++i) {
        this.objects.add(new Record(new IntValue(i)));
    }
    // create the reader
    this.reader = new MutableObjectIteratorWrapper(this.objects.iterator());
}
Also used : MutableObjectIteratorWrapper(org.apache.flink.runtime.operators.testutils.MutableObjectIteratorWrapper) Record(org.apache.flink.types.Record) MemoryManager(org.apache.flink.runtime.memory.MemoryManager) IntValue(org.apache.flink.types.IntValue) Before(org.junit.Before)

Example 2 with MutableObjectIteratorWrapper

use of org.apache.flink.runtime.operators.testutils.MutableObjectIteratorWrapper in project flink by apache.

the class SpillingResettableMutableObjectIteratorTest method startup.

@Before
public void startup() {
    // set up IO and memory manager
    this.memman = new MemoryManager(MEMORY_CAPACITY, 1);
    this.ioman = new IOManagerAsync();
    // create test objects
    final ArrayList<Record> objects = new ArrayList<Record>(NUM_TESTRECORDS);
    for (int i = 0; i < NUM_TESTRECORDS; ++i) {
        Record tmp = new Record(new IntValue(i));
        objects.add(tmp);
    }
    this.reader = new MutableObjectIteratorWrapper(objects.iterator());
}
Also used : IOManagerAsync(org.apache.flink.runtime.io.disk.iomanager.IOManagerAsync) MutableObjectIteratorWrapper(org.apache.flink.runtime.operators.testutils.MutableObjectIteratorWrapper) ArrayList(java.util.ArrayList) Record(org.apache.flink.types.Record) MemoryManager(org.apache.flink.runtime.memory.MemoryManager) IntValue(org.apache.flink.types.IntValue) Before(org.junit.Before)

Aggregations

MemoryManager (org.apache.flink.runtime.memory.MemoryManager)2 MutableObjectIteratorWrapper (org.apache.flink.runtime.operators.testutils.MutableObjectIteratorWrapper)2 IntValue (org.apache.flink.types.IntValue)2 Record (org.apache.flink.types.Record)2 Before (org.junit.Before)2 ArrayList (java.util.ArrayList)1 IOManagerAsync (org.apache.flink.runtime.io.disk.iomanager.IOManagerAsync)1