Package nz.org.riskscape.engine.join
Class HashIndexer
java.lang.Object
nz.org.riskscape.engine.join.JoinIndexer
nz.org.riskscape.engine.join.RealizedExpressionJoinIndexer
nz.org.riskscape.engine.join.HashIndexer
JoinIndexer implementation that builds an in-memory hash index of tuples when the
JoinCondition is an equality filter. Eg 'lhs.thing = rhs.thing'
-
Nested Class Summary
Nested classes/interfaces inherited from class nz.org.riskscape.engine.join.JoinIndexer
JoinIndexer.Constructor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JoinIndexer.Constructorstatic final intThe default capacity that indexes will be created for.Fields inherited from class nz.org.riskscape.engine.join.RealizedExpressionJoinIndexer
lhsExpression, operator, rhsExpressionFields inherited from class nz.org.riskscape.engine.join.JoinIndexer
expressionRealizer, join -
Constructor Summary
ConstructorsConstructorDescriptionHashIndexer(nz.org.riskscape.engine.join.Join join, nz.org.riskscape.engine.rl.ExpressionRealizer expressionRealizer, int initialIndexSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToIndex(nz.org.riskscape.engine.Tuple toCache) nz.org.riskscape.engine.relation.TupleIteratorcreateRhsIterator(nz.org.riskscape.engine.Tuple lhs) Create aTupleIteratorthat will contain at least the set ofTuples that are needed to completely join the lhs to the rhs based on the join.booleanisUsable()toString()Methods inherited from class nz.org.riskscape.engine.join.RealizedExpressionJoinIndexer
isAllowed, processIndexableMetadataMethods inherited from class nz.org.riskscape.engine.join.JoinIndexer
getExpressionRealizer, getJoin
-
Field Details
-
DEFAULT_INITIAL_INDEX_SIZE
public static final int DEFAULT_INITIAL_INDEX_SIZEThe 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
-
-
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:
addToIndexin classJoinIndexer
-
createRhsIterator
public nz.org.riskscape.engine.relation.TupleIterator createRhsIterator(nz.org.riskscape.engine.Tuple lhs) Description copied from class:JoinIndexerCreate a
TupleIteratorthat will contain at least the set ofTuples that are needed to completely join the lhs to the rhs based on the join.- Specified by:
createRhsIteratorin classJoinIndexer
-
isUsable
public boolean isUsable()- Overrides:
isUsablein classRealizedExpressionJoinIndexer- 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
DefaultJoinercan work through which ones are appropriate by checking this method.
-
toString
-