Class HashIndexer


public class HashIndexer extends RealizedExpressionJoinIndexer

JoinIndexer implementation that builds an in-memory hash index of tuples when the JoinCondition is an equality filter. Eg 'lhs.thing = rhs.thing'

  • Field Details

    • DEFAULT_INITIAL_INDEX_SIZE

      public static final int DEFAULT_INITIAL_INDEX_SIZE

      The default capacity that indexes will be created for.

      The HashIndexer contains a map of right hand side values to items.

      For best performance the index should be as large as the expected number of unique right hand side values.

      See Also:
    • CONSTRUCTOR

      public static final JoinIndexer.Constructor CONSTRUCTOR
  • Constructor Details

    • HashIndexer

      public HashIndexer(nz.org.riskscape.engine.join.Join join, nz.org.riskscape.engine.rl.ExpressionRealizer expressionRealizer, int initialIndexSize)
  • Method Details

    • addToIndex

      public void addToIndex(nz.org.riskscape.engine.Tuple toCache)
      Specified by:
      addToIndex in class JoinIndexer
    • createRhsIterator

      public nz.org.riskscape.engine.relation.TupleIterator createRhsIterator(nz.org.riskscape.engine.Tuple lhs)
      Description copied from class: JoinIndexer

      Create a TupleIterator that will contain at least the set of Tuples that are needed to completely join the lhs to the rhs based on the join.

      Specified by:
      createRhsIterator in class JoinIndexer
    • isUsable

      public boolean isUsable()
      Overrides:
      isUsable in class RealizedExpressionJoinIndexer
      Returns:
      true if this join can be used, e.g. it's suitable for the query and join. This is intended as a simpler way of providing a set of implementations such that the DefaultJoiner can work through which ones are appropriate by checking this method.
    • toString

      public String toString()
      Overrides:
      toString in class Object