## org.apache.cassandra.utils
Class MergeIterator<In,Out>

    java.lang.Object
      com.google.common.collect.UnmodifiableIterator<T>
          com.google.common.collect.AbstractIterator<Out>
              org.apache.cassandra.utils.MergeIterator<In,Out>

All Implemented Interfaces:
  java.io.Closeable, java.util.Iterator<Out>, CloseableIterator<Out>, IMergeIterator<In,Out>

    public abstract class MergeIterator<In,Out>

extends com.google.common.collect.AbstractIterator<Out>
implements IMergeIterator<In,Out>

Merges sorted input iterators which individually contain unique items.

Nested Class Summary
`protected static class` `MergeIterator.Candidate<In>`
`static class` `MergeIterator.Reducer<In,Out>` Accumulator that collects values of type A, and outputs a value of type B.

Field Summary
`protected java.util.List<? extends CloseableIterator<In>>` `iterators`
`protected MergeIterator.Reducer<In,Out>` `reducer`

Constructor Summary
`protected` `MergeIterator(java.util.List<? extends CloseableIterator<In>> iters, MergeIterator.Reducer<In,Out> reducer)`

Method Summary
`void` `close()`

`static

`<In,Out> IMergeIterator<In,Out>`

`

`get(java.util.List<? extends CloseableIterator<In>> sources, java.util.Comparator<In> comparator, MergeIterator.Reducer<In,Out> reducer)`

`java.lang.Iterable<? extends CloseableIterator<In>>` `iterators()`

Methods inherited from class com.google.common.collect.AbstractIterator
`computeNext, endOfData, hasNext, next, peek`

Methods inherited from class com.google.common.collect.UnmodifiableIterator
`remove`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface java.util.Iterator
`hasNext, next, remove`

Field Detail

### reducer

    protected final MergeIterator.Reducer<In,Out> reducer

### iterators

    protected final java.util.List<? extends CloseableIterator<In>> iterators

Constructor Detail

### MergeIterator

    protected MergeIterator(java.util.List<? extends CloseableIterator<In>> iters,
                            MergeIterator.Reducer<In,Out> reducer)

Method Detail

### get

    public static <In,Out> IMergeIterator<In,Out> get(java.util.List<? extends CloseableIterator<In>> sources,
                                                      java.util.Comparator<In> comparator,
                                                      MergeIterator.Reducer<In,Out> reducer)

### iterators

    public java.lang.Iterable<? extends CloseableIterator<In>> iterators()

  Specified by:
    `iterators` in interface `IMergeIterator<In,Out>`

### close

    public void close()

  Specified by:
    `close` in interface `java.io.Closeable`

Copyright © 2013 The Apache Software Foundation