Class MidxIterators

java.lang.Object
org.eclipse.jgit.internal.storage.midx.MidxIterators

public final class MidxIterators extends Object
Helpers for midx iterators
  • Method Details

    • fromPackIndexIterator

      public static MultiPackIndex.MidxIterator fromPackIndexIterator(String packName, PackIndex idx)
      Wrap a PackIndex iterator so it looks like a midx iterator with a fixed packId
      Parameters:
      packName - pack name this iterator is going over
      idx - a PackIndex
      Returns:
      a midx iterator that returns the objects of the pack index in the original iterator order
    • join

      Merge results from multiple midx iterators.

      This iterator can return duplicates (in ascending packId order). Wrap with dedup(MidxIterator) to remove duplicates.

      This iterator shifts the pack ids in iterator order. If the first iterator covers 3 packs, packIds of the second iterator are increased by 3.

      Parameters:
      iterators - midx iterators to combine
      Returns:
      a unique iterator that returns the union of the iterators in sha1 order. The packIds of the entries are shi
    • dedup

      Dedup consecutive duplicates from a midx iterator
      Parameters:
      source - a midx iterator emitting entries in sha1 order. In case of duplicates, the first one is returned and others skipped.
      Returns:
      iterator without duplicates.