public AbstractMergeIterator(MutableObjectIterator<T1> input1, MutableObjectIterator<T2> input2, TypeSerializer<T1> serializer1, TypeComparator<T1> comparator1, TypeSerializer<T2> serializer2, TypeComparator<T2> comparator2, TypePairComparator<T1, T2> pairComparator, MemoryManager memoryManager, IOManager ioManager, int numMemoryPages, AbstractInvokable parentTask) throws MemoryAllocationException { if (numMemoryPages < 2) { throw new IllegalArgumentException("Merger needs at least 2 memory pages."); } this.pairComparator = pairComparator; this.serializer1 = serializer1; this.serializer2 = serializer2; this.memoryManager = memoryManager; this.ioManager = ioManager; this.iterator1 = createKeyGroupedIterator(input1, serializer1, comparator1.duplicate()); this.iterator2 = createKeyGroupedIterator(input2, serializer2, comparator2.duplicate()); final int numPagesForSpiller = numMemoryPages > 20 ? 2 : 1; this.blockIt = new NonReusingBlockResettableIterator<>(this.memoryManager, this.serializer2, (numMemoryPages - numPagesForSpiller), parentTask); this.memoryForSpillingIterator = memoryManager.allocatePages(parentTask, numPagesForSpiller); }
public AbstractMergeIterator(MutableObjectIterator<T1> input1, MutableObjectIterator<T2> input2, TypeSerializer<T1> serializer1, TypeComparator<T1> comparator1, TypeSerializer<T2> serializer2, TypeComparator<T2> comparator2, TypePairComparator<T1, T2> pairComparator, MemoryManager memoryManager, IOManager ioManager, int numMemoryPages, AbstractInvokable parentTask) throws MemoryAllocationException { if (numMemoryPages < 2) { throw new IllegalArgumentException("Merger needs at least 2 memory pages."); } this.pairComparator = pairComparator; this.serializer1 = serializer1; this.serializer2 = serializer2; this.memoryManager = memoryManager; this.ioManager = ioManager; this.iterator1 = createKeyGroupedIterator(input1, serializer1, comparator1.duplicate()); this.iterator2 = createKeyGroupedIterator(input2, serializer2, comparator2.duplicate()); final int numPagesForSpiller = numMemoryPages > 20 ? 2 : 1; this.blockIt = new NonReusingBlockResettableIterator<>(this.memoryManager, this.serializer2, (numMemoryPages - numPagesForSpiller), parentTask); this.memoryForSpillingIterator = memoryManager.allocatePages(parentTask, numPagesForSpiller); }
public AbstractMergeIterator(MutableObjectIterator<T1> input1, MutableObjectIterator<T2> input2, TypeSerializer<T1> serializer1, TypeComparator<T1> comparator1, TypeSerializer<T2> serializer2, TypeComparator<T2> comparator2, TypePairComparator<T1, T2> pairComparator, MemoryManager memoryManager, IOManager ioManager, int numMemoryPages, AbstractInvokable parentTask) throws MemoryAllocationException { if (numMemoryPages < 2) { throw new IllegalArgumentException("Merger needs at least 2 memory pages."); } this.pairComparator = pairComparator; this.serializer1 = serializer1; this.serializer2 = serializer2; this.memoryManager = memoryManager; this.ioManager = ioManager; this.iterator1 = createKeyGroupedIterator(input1, serializer1, comparator1.duplicate()); this.iterator2 = createKeyGroupedIterator(input2, serializer2, comparator2.duplicate()); final int numPagesForSpiller = numMemoryPages > 20 ? 2 : 1; this.blockIt = new NonReusingBlockResettableIterator<>(this.memoryManager, this.serializer2, (numMemoryPages - numPagesForSpiller), parentTask); this.memoryForSpillingIterator = memoryManager.allocatePages(parentTask, numPagesForSpiller); }
public AbstractMergeIterator(MutableObjectIterator<T1> input1, MutableObjectIterator<T2> input2, TypeSerializer<T1> serializer1, TypeComparator<T1> comparator1, TypeSerializer<T2> serializer2, TypeComparator<T2> comparator2, TypePairComparator<T1, T2> pairComparator, MemoryManager memoryManager, IOManager ioManager, int numMemoryPages, AbstractInvokable parentTask) throws MemoryAllocationException { if (numMemoryPages < 2) { throw new IllegalArgumentException("Merger needs at least 2 memory pages."); } this.pairComparator = pairComparator; this.serializer1 = serializer1; this.serializer2 = serializer2; this.memoryManager = memoryManager; this.ioManager = ioManager; this.iterator1 = createKeyGroupedIterator(input1, serializer1, comparator1.duplicate()); this.iterator2 = createKeyGroupedIterator(input2, serializer2, comparator2.duplicate()); final int numPagesForSpiller = numMemoryPages > 20 ? 2 : 1; this.blockIt = new NonReusingBlockResettableIterator<>(this.memoryManager, this.serializer2, (numMemoryPages - numPagesForSpiller), parentTask); this.memoryForSpillingIterator = memoryManager.allocatePages(parentTask, numPagesForSpiller); }