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
Modifier and TypeFieldDescriptionstatic final JoinIndexer.Constructor
static final int
The default capacity that indexes will be created for.Fields inherited from class nz.org.riskscape.engine.join.RealizedExpressionJoinIndexer
lhsExpression, operator, rhsExpression
Fields inherited from class nz.org.riskscape.engine.join.JoinIndexer
expressionRealizer, join
-
Constructor Summary
ConstructorDescriptionHashIndexer
(nz.org.riskscape.engine.join.Join join, nz.org.riskscape.engine.rl.ExpressionRealizer expressionRealizer, int initialIndexSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToIndex
(nz.org.riskscape.engine.Tuple toCache) nz.org.riskscape.engine.relation.TupleIterator
createRhsIterator
(nz.org.riskscape.engine.Tuple lhs) Create aTupleIterator
that will contain at least the set ofTuple
s that are needed to completely join the lhs to the rhs based on the join.boolean
isUsable()
toString()
Methods inherited from class nz.org.riskscape.engine.join.RealizedExpressionJoinIndexer
isAllowed, processIndexableMetadata
Methods 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:
addToIndex
in classJoinIndexer
-
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 ofTuple
s that are needed to completely join the lhs to the rhs based on the join.- Specified by:
createRhsIterator
in classJoinIndexer
-
isUsable
public boolean isUsable()- Overrides:
isUsable
in 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
DefaultJoiner
can work through which ones are appropriate by checking this method.
-
toString
-