Class TaxonomyIndexArrays

java.lang.Object
org.apache.lucene.facet.taxonomy.ParallelTaxonomyArrays
org.apache.lucene.facet.taxonomy.directory.TaxonomyIndexArrays
All Implemented Interfaces:
Accountable

class TaxonomyIndexArrays extends ParallelTaxonomyArrays implements Accountable
A ParallelTaxonomyArrays that are initialized from the taxonomy index.
  • Field Details

  • Constructor Details

  • Method Details

    • allocateChunkedArray

      private static int[][] allocateChunkedArray(int size, int startFrom)
    • copyChunkedArray

      private static void copyChunkedArray(int[][] oldArray, int[][] newArray)
    • initChildrenSiblings

      private void initChildrenSiblings(TaxonomyIndexArrays copyFrom)
    • computeChildrenSiblings

      private void computeChildrenSiblings(int first)
    • initParents

      private void initParents(int[][] parentsArray, IndexReader reader, int first) throws IOException
      Throws:
      IOException
    • getMajorVersion

      private static int getMajorVersion(IndexReader reader)
    • loadParentUsingTermPosition

      private void loadParentUsingTermPosition(int[][] parentsArray, IndexReader reader, int first) throws IOException
      Try loading the old way of storing parent ordinal first, return true if the parent array is loaded Or false if not, and we will try loading using NumericDocValues
      Throws:
      IOException
    • add

      TaxonomyIndexArrays add(int ordinal, int parentOrdinal)
      Adds the given ordinal/parent info and returns either a new instance if the underlying array had to grow, or this instance otherwise.

      NOTE: you should call this method from a thread-safe code.

    • parents

      Returns the parents array, where parents[i] denotes the parent of category ordinal i.
      Specified by:
      parents in class ParallelTaxonomyArrays
    • children

      Returns the children array, where children[i] denotes the youngest child of category ordinal i. The youngest child is defined as the category that was added last to the taxonomy as an immediate child of i.
      Specified by:
      children in class ParallelTaxonomyArrays
    • siblings

      Returns the siblings array, where siblings[i] denotes the sibling of category ordinal i. The sibling is defined as the previous youngest child of parents[i].
      Specified by:
      siblings in class ParallelTaxonomyArrays
    • ramBytesUsed

      public long ramBytesUsed()
      Description copied from interface: Accountable
      Return the memory usage of this object in bytes. Negative values are illegal.
      Specified by:
      ramBytesUsed in interface Accountable
    • getChildResources

      public Collection<Accountable> getChildResources()
      Description copied from interface: Accountable
      Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).
      Specified by:
      getChildResources in interface Accountable
      See Also: