use of org.apache.flink.runtime.memory.MemoryManager in project flink by apache.
the class DriverTestBase method shutdownAll.
// --------------------------------------------------------------------------------------------
@After
public void shutdownAll() throws Exception {
// 1st, shutdown sorters
for (UnilateralSortMerger<?> sorter : this.sorters) {
if (sorter != null) {
sorter.close();
}
}
this.sorters.clear();
// 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();
}
}
use of org.apache.flink.runtime.memory.MemoryManager in project flink by apache.
the class SpillingResettableIteratorTest method startup.
@Before
public void startup() {
// set up IO and memory manager
this.memman = new MemoryManager(MEMORY_CAPACITY, 1, 32 * 1024, MemoryType.HEAP, true);
this.ioman = new IOManagerAsync();
// create test objects
ArrayList<IntValue> objects = new ArrayList<IntValue>(NUM_TESTRECORDS);
for (int i = 0; i < NUM_TESTRECORDS; ++i) {
IntValue tmp = new IntValue(i);
objects.add(tmp);
}
this.reader = objects.iterator();
}
use of org.apache.flink.runtime.memory.MemoryManager 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());
}
use of org.apache.flink.runtime.memory.MemoryManager in project flink by apache.
the class CombiningUnilateralSortMergerITCase method beforeTest.
@SuppressWarnings("unchecked")
@Before
public void beforeTest() {
this.memoryManager = new MemoryManager(MEMORY_SIZE, 1);
this.ioManager = new IOManagerAsync();
this.serializerFactory1 = TestData.getIntStringTupleSerializerFactory();
this.comparator1 = TestData.getIntStringTupleComparator();
this.serializerFactory2 = TestData.getIntIntTupleSerializerFactory();
this.comparator2 = TestData.getIntIntTupleComparator();
}
use of org.apache.flink.runtime.memory.MemoryManager in project flink by apache.
the class HashVsSortMiniBenchmark method beforeTest.
@SuppressWarnings("unchecked")
@Before
public void beforeTest() {
this.serializer1 = TestData.getIntStringTupleSerializerFactory();
this.serializer2 = TestData.getIntStringTupleSerializerFactory();
this.comparator1 = TestData.getIntStringTupleComparator();
this.comparator2 = TestData.getIntStringTupleComparator();
this.pairComparator11 = new GenericPairComparator(this.comparator1, this.comparator2);
this.memoryManager = new MemoryManager(MEMORY_SIZE, 1, PAGE_SIZE, MemoryType.HEAP, true);
this.ioManager = new IOManagerAsync();
}
Aggregations