org.apache.lucene.index
Class SortedBytesMergeUtils

java.lang.Object
  extended by org.apache.lucene.index.SortedBytesMergeUtils

public final class SortedBytesMergeUtils
extends Object

Utility class for merging SortedBytes DocValues instances.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

Nested Class Summary
static interface SortedBytesMergeUtils.BytesRefConsumer
          Implementation of this interface consume the merged bytes with their corresponding ordinal and byte offset.
static class SortedBytesMergeUtils.IndexOutputBytesRefConsumer
          A simple SortedBytesMergeUtils.BytesRefConsumer that writes the merged BytesRef instances sequentially to an IndexOutput.
static class SortedBytesMergeUtils.MergeContext
          Encapsulates contextual information about the merge.
static class SortedBytesMergeUtils.SortedSourceSlice
          SortedBytesMergeUtils.SortedSourceSlice represents a single DocValues.SortedSource merge candidate.
 
Method Summary
static List<SortedBytesMergeUtils.SortedSourceSlice> buildSlices(int[] docBases, MergeState.DocMap[] docMaps, DocValues[] docValues, SortedBytesMergeUtils.MergeContext ctx)
          Creates the SortedBytesMergeUtils.SortedSourceSlices for merging.
static SortedBytesMergeUtils.MergeContext init(DocValues.Type type, DocValues[] docValues, Comparator<BytesRef> comp, int mergeDocCount)
          Creates the SortedBytesMergeUtils.MergeContext necessary for merging the ordinals.
static int mergeRecords(SortedBytesMergeUtils.MergeContext ctx, SortedBytesMergeUtils.BytesRefConsumer consumer, List<SortedBytesMergeUtils.SortedSourceSlice> slices)
          Does the "real work" of merging the slices and computing the ord mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static SortedBytesMergeUtils.MergeContext init(DocValues.Type type,
                                                      DocValues[] docValues,
                                                      Comparator<BytesRef> comp,
                                                      int mergeDocCount)
Creates the SortedBytesMergeUtils.MergeContext necessary for merging the ordinals.


buildSlices

public static List<SortedBytesMergeUtils.SortedSourceSlice> buildSlices(int[] docBases,
                                                                        MergeState.DocMap[] docMaps,
                                                                        DocValues[] docValues,
                                                                        SortedBytesMergeUtils.MergeContext ctx)
                                                                 throws IOException
Creates the SortedBytesMergeUtils.SortedSourceSlices for merging.

Throws:
IOException

mergeRecords

public static int mergeRecords(SortedBytesMergeUtils.MergeContext ctx,
                               SortedBytesMergeUtils.BytesRefConsumer consumer,
                               List<SortedBytesMergeUtils.SortedSourceSlice> slices)
                        throws IOException
Does the "real work" of merging the slices and computing the ord mapping.

Throws:
IOException


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.