Class DictionaryMergingIterator<T extends Comparable<T>>

java.lang.Object
org.apache.druid.segment.DictionaryMergingIterator<T>
All Implemented Interfaces:
Closeable, AutoCloseable, Iterator<T>, CloseableIterator<T>

public class DictionaryMergingIterator<T extends Comparable<T>> extends Object implements CloseableIterator<T>
Iterator for merging dictionaries for some comparable type into a single sorted dictionary, useful when merging dictionary encoded columns
  • Field Details

  • Constructor Details

    • DictionaryMergingIterator

      public DictionaryMergingIterator(Indexed<T>[] dimValueLookups, Comparator<Pair<Integer,com.google.common.collect.PeekingIterator<T>>> comparator, boolean useDirect)
  • Method Details

    • makePeekingComparator

      public static <T extends Comparable<T>> Comparator<Pair<Integer,com.google.common.collect.PeekingIterator<T>>> makePeekingComparator()
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T extends Comparable<T>>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T extends Comparable<T>>
    • getCardinality

      public int getCardinality()
    • transformIndexedIterator

      protected com.google.common.collect.PeekingIterator<T> transformIndexedIterator(Indexed<T> indexed)
    • needConversion

      protected boolean needConversion(int index)
    • writeTranslate

      protected T writeTranslate(Pair<Integer,com.google.common.collect.PeekingIterator<T>> smallest, int counter)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable