Search in sources :

Example 51 with MemoryManager

use of org.apache.flink.runtime.memory.MemoryManager in project flink by apache.

the class ReOpenableHashTableTestBase method beforeTest.

@SuppressWarnings({ "unchecked", "rawtypes" })
@Before
public void beforeTest() {
    this.recordSerializer = TestData.getIntStringTupleSerializer();
    this.record1Comparator = TestData.getIntStringTupleComparator();
    this.record2Comparator = TestData.getIntStringTupleComparator();
    this.recordPairComparator = new GenericPairComparator(this.record1Comparator, this.record2Comparator);
    this.recordBuildSideAccesssor = TestData.getIntIntTupleSerializer();
    this.recordProbeSideAccesssor = TestData.getIntIntTupleSerializer();
    this.recordBuildSideComparator = TestData.getIntIntTupleComparator();
    this.recordProbeSideComparator = TestData.getIntIntTupleComparator();
    this.pactRecordComparator = new GenericPairComparator(this.recordBuildSideComparator, this.recordProbeSideComparator);
    this.memoryManager = new MemoryManager(MEMORY_SIZE, 1, PAGE_SIZE, MemoryType.HEAP, true);
    this.ioManager = new IOManagerAsync();
}
Also used : IOManagerAsync(org.apache.flink.runtime.io.disk.iomanager.IOManagerAsync) GenericPairComparator(org.apache.flink.api.common.typeutils.GenericPairComparator) MemoryManager(org.apache.flink.runtime.memory.MemoryManager) Before(org.junit.Before)

Example 52 with MemoryManager

use of org.apache.flink.runtime.memory.MemoryManager in project flink by apache.

the class UnaryOperatorTestBase method shutdownAll.

// --------------------------------------------------------------------------------------------
@After
public void shutdownAll() throws Exception {
    // 1st, shutdown sorters
    if (this.sorter != null) {
        sorter.close();
    }
    // 2nd, shutdown I/O
    this.ioManager.shutdown();
    Assert.assertTrue("I/O Manager has not properly shut down.", this.ioManager.isProperlyShutDown());
    // last, verify all memory is returned and shutdown mem manager
    MemoryManager memMan = getMemoryManager();
    if (memMan != null) {
        Assert.assertTrue("Memory Manager managed memory was not completely freed.", memMan.verifyEmpty());
        memMan.shutdown();
    }
}
Also used : MemoryManager(org.apache.flink.runtime.memory.MemoryManager) After(org.junit.After)

Example 53 with MemoryManager

use of org.apache.flink.runtime.memory.MemoryManager in project flink by apache.

the class ReusingBlockResettableIteratorTest 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 = objects.iterator();
}
Also used : 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)53 IOManagerAsync (org.apache.flink.runtime.io.disk.iomanager.IOManagerAsync)33 Before (org.junit.Before)22 IOManager (org.apache.flink.runtime.io.disk.iomanager.IOManager)19 ExecutionConfig (org.apache.flink.api.common.ExecutionConfig)12 DummyInvokable (org.apache.flink.runtime.operators.testutils.DummyInvokable)12 Test (org.junit.Test)10 IOException (java.io.IOException)9 ArrayList (java.util.ArrayList)8 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)8 MemorySegment (org.apache.flink.core.memory.MemorySegment)8 TupleTypeInfo (org.apache.flink.api.java.typeutils.TupleTypeInfo)7 File (java.io.File)6 GenericPairComparator (org.apache.flink.api.common.typeutils.GenericPairComparator)6 IntValue (org.apache.flink.types.IntValue)6 Configuration (org.apache.flink.configuration.Configuration)5 AbstractInvokable (org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable)5 BufferedReader (java.io.BufferedReader)4 FileReader (java.io.FileReader)4 Random (java.util.Random)4