Class MultiDocValues.OrdinalMap

  • Enclosing class:
    MultiDocValues

    public static class MultiDocValues.OrdinalMap
    extends java.lang.Object
    maps per-segment ordinals to/from global ordinal space
    • Constructor Summary

      Constructors 
      Constructor Description
      OrdinalMap​(java.lang.Object owner, TermsEnum[] subs)
      Creates an ordinal map that allows mapping ords to/from a merged space from subs.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getFirstSegmentNumber​(long globalOrd)
      Given a global ordinal, returns the index of the first segment that contains this term.
      long getFirstSegmentOrd​(long globalOrd)
      Given global ordinal, returns the ordinal of the first segment which contains this ordinal (the corresponding to the segment return getFirstSegmentNumber(long)).
      long getGlobalOrd​(int segmentIndex, long segmentOrd)
      Given a segment number and segment ordinal, returns the corresponding global ordinal.
      long getValueCount()
      Returns the total number of unique terms in global ord space.
      long ramBytesUsed()
      Returns total byte size used by this ordinal map.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OrdinalMap

        public OrdinalMap​(java.lang.Object owner,
                          TermsEnum[] subs)
                   throws java.io.IOException
        Creates an ordinal map that allows mapping ords to/from a merged space from subs.
        Parameters:
        owner - a cache key
        subs - TermsEnums that support TermsEnum.ord(). They need not be dense (e.g. can be FilteredTermsEnums}.
        Throws:
        java.io.IOException - if an I/O error occurred.
    • Method Detail

      • getGlobalOrd

        public long getGlobalOrd​(int segmentIndex,
                                 long segmentOrd)
        Given a segment number and segment ordinal, returns the corresponding global ordinal.
      • getFirstSegmentOrd

        public long getFirstSegmentOrd​(long globalOrd)
        Given global ordinal, returns the ordinal of the first segment which contains this ordinal (the corresponding to the segment return getFirstSegmentNumber(long)).
      • getFirstSegmentNumber

        public int getFirstSegmentNumber​(long globalOrd)
        Given a global ordinal, returns the index of the first segment that contains this term.
      • getValueCount

        public long getValueCount()
        Returns the total number of unique terms in global ord space.
      • ramBytesUsed

        public long ramBytesUsed()
        Returns total byte size used by this ordinal map.