Search in sources :

Example 11 with MycatPropertyConf

use of io.mycat.memory.unsafe.utils.MycatPropertyConf in project Mycat-Server by MyCATApache.

the class UnsafeInMemorySorterSuite method testSortingEmptyInput.

@Test
public void testSortingEmptyInput() {
    final DataNodeMemoryManager memoryManager = new DataNodeMemoryManager(new TestMemoryManager(new MycatPropertyConf().set("mycat.memory.offHeap.enabled", "false")), 0);
    final TestMemoryConsumer consumer = new TestMemoryConsumer(memoryManager);
    final UnsafeInMemorySorter sorter = new UnsafeInMemorySorter(consumer, memoryManager, mock(RecordComparator.class), mock(PrefixComparator.class), 100, shouldUseRadixSort(), true);
    final UnsafeSorterIterator iter = sorter.getSortedIterator();
    Assert.assertFalse(iter.hasNext());
}
Also used : TestMemoryManager(io.mycat.memory.unsafe.memory.TestMemoryManager) TestMemoryConsumer(io.mycat.memory.unsafe.memory.TestMemoryConsumer) DataNodeMemoryManager(io.mycat.memory.unsafe.memory.mm.DataNodeMemoryManager) MycatPropertyConf(io.mycat.memory.unsafe.utils.MycatPropertyConf) Test(org.junit.Test)

Aggregations

MycatPropertyConf (io.mycat.memory.unsafe.utils.MycatPropertyConf)11 Test (org.junit.Test)10 DataNodeMemoryManager (io.mycat.memory.unsafe.memory.mm.DataNodeMemoryManager)9 MyCatMemory (io.mycat.memory.MyCatMemory)2 TestMemoryConsumer (io.mycat.memory.unsafe.memory.TestMemoryConsumer)2 TestMemoryManager (io.mycat.memory.unsafe.memory.TestMemoryManager)2 MemoryManager (io.mycat.memory.unsafe.memory.mm.MemoryManager)2 MemoryBlock (io.mycat.memory.unsafe.memory.MemoryBlock)1 ResultMergeMemoryManager (io.mycat.memory.unsafe.memory.mm.ResultMergeMemoryManager)1 BufferHolder (io.mycat.memory.unsafe.row.BufferHolder)1 StructType (io.mycat.memory.unsafe.row.StructType)1 UnsafeRow (io.mycat.memory.unsafe.row.UnsafeRow)1 UnsafeRowWriter (io.mycat.memory.unsafe.row.UnsafeRowWriter)1 DataNodeDiskManager (io.mycat.memory.unsafe.storage.DataNodeDiskManager)1 SerializerManager (io.mycat.memory.unsafe.storage.SerializerManager)1 PrefixComparator (io.mycat.memory.unsafe.utils.sort.PrefixComparator)1 RowPrefixComputer (io.mycat.memory.unsafe.utils.sort.RowPrefixComputer)1 UnsafeExternalRowSorter (io.mycat.memory.unsafe.utils.sort.UnsafeExternalRowSorter)1 ColMeta (io.mycat.sqlengine.mpp.ColMeta)1 OrderCol (io.mycat.sqlengine.mpp.OrderCol)1