Class HashJoinIteration
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<BindingSet, QueryEvaluationException>
org.eclipse.rdf4j.common.iteration.LookAheadIteration<BindingSet, QueryEvaluationException>
org.eclipse.rdf4j.query.algebra.evaluation.iterator.HashJoinIteration
- All Implemented Interfaces:
AutoCloseable, CloseableIteration<BindingSet, QueryEvaluationException>, Iteration<BindingSet, QueryEvaluationException>
Generic hash join implementation suitable for use by Sail implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Function<BindingSet, MutableBindingSet> private BindingSetprivate Map<BindingSetHashKey, List<BindingSet>> private Iterator<BindingSet> protected final String[]private final CloseableIteration<BindingSet, QueryEvaluationException> private final booleanprivate final IntFunction<Map<BindingSetHashKey, List<BindingSet>>> private final IntFunction<List<BindingSet>> private final CloseableIteration<BindingSet, QueryEvaluationException> private Iterator<BindingSet> -
Constructor Summary
ConstructorsConstructorDescriptionHashJoinIteration(CloseableIteration<BindingSet, QueryEvaluationException> leftIter, Set<String> leftBindingNames, CloseableIteration<BindingSet, QueryEvaluationException> rightIter, Set<String> rightBindingNames, boolean leftJoin) HashJoinIteration(CloseableIteration<BindingSet, QueryEvaluationException> leftIter, Set<String> leftBindingNames, CloseableIteration<BindingSet, QueryEvaluationException> rightIter, Set<String> rightBindingNames, boolean leftJoin, IntFunction<Map<BindingSetHashKey, List<BindingSet>>> mapMaker, IntFunction<List<BindingSet>> mapValueMaker) Deprecated, for removal: This API element is subject to removal in a future version.HashJoinIteration(EvaluationStrategy strategy, Join join, BindingSet bindings) Deprecated, for removal: This API element is subject to removal in a future version.HashJoinIteration(EvaluationStrategy strategy, LeftJoin join, BindingSet bindings) Deprecated, for removal: This API element is subject to removal in a future version.HashJoinIteration(EvaluationStrategy strategy, TupleExpr left, TupleExpr right, BindingSet bindings, boolean leftJoin) HashJoinIteration(QueryEvaluationStep left, QueryEvaluationStep right, BindingSet bindings, boolean leftJoin, String[] joinAttributes, QueryEvaluationContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected <E> voidadd(Collection<E> col, E value) protected <E> voidaddAll(Collection<E> col, List<E> values) protected <E> voidcloseHashValue(Iterator<E> iter) Utility methods to clear-up in case not using in-memory hash table.protected voiddisposeCache(Iterator<BindingSet> iter) Utility methods to clear-up in case not using in-memory cache.protected voidUtility methods to clear-up in case not using in-memory hash table.protected BindingSetGets the next element.protected voidCalled byAbstractCloseableIteration.close()when it is called for the first time.static String[]hashJoinAttributeNames(Join join) static String[]protected Map<BindingSetHashKey, List<BindingSet>> makeHashTable(int initialSize) Utility methods to make it easier to inserted custom store dependent mapsprotected List<BindingSet> makeHashValue(int currentMaxListSize) Utility methods to make it easier to inserted custom store dependent listprotected Collection<BindingSet> Utility methods to make it easier to inserted custom store dependent listprotected <E> EnextFromCache(Iterator<E> iter) protected voidputHashTableEntry(Map<BindingSetHashKey, List<BindingSet>> nextHashTable, BindingSetHashKey hashKey, List<BindingSet> hashValue, boolean newEntry) private Map<BindingSetHashKey, List<BindingSet>> Methods inherited from class LookAheadIteration
hasNext, next, removeMethods inherited from class AbstractCloseableIteration
close, isClosedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseableIteration
stream
-
Field Details
-
joinAttributes
-
leftIter
-
rightIter
-
leftJoin
private final boolean leftJoin -
scanList
-
restIter
-
hashTable
-
currentScanElem
-
hashTableValues
-
mapMaker
-
mapValueMaker
-
bsMaker
-
-
Constructor Details
-
HashJoinIteration
@Deprecated(forRemoval=true) public HashJoinIteration(EvaluationStrategy strategy, Join join, BindingSet bindings) throws QueryEvaluationException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
QueryEvaluationException
-
HashJoinIteration
@Deprecated(forRemoval=true) public HashJoinIteration(EvaluationStrategy strategy, LeftJoin join, BindingSet bindings) throws QueryEvaluationException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
QueryEvaluationException
-
HashJoinIteration
public HashJoinIteration(EvaluationStrategy strategy, TupleExpr left, TupleExpr right, BindingSet bindings, boolean leftJoin) throws QueryEvaluationException - Throws:
QueryEvaluationException
-
HashJoinIteration
public HashJoinIteration(QueryEvaluationStep left, QueryEvaluationStep right, BindingSet bindings, boolean leftJoin, String[] joinAttributes, QueryEvaluationContext context) throws QueryEvaluationException - Throws:
QueryEvaluationException
-
HashJoinIteration
public HashJoinIteration(CloseableIteration<BindingSet, QueryEvaluationException> leftIter, Set<String> leftBindingNames, CloseableIteration<BindingSet, QueryEvaluationException> rightIter, Set<String> rightBindingNames, boolean leftJoin) throws QueryEvaluationException - Throws:
QueryEvaluationException
-
HashJoinIteration
@Deprecated(forRemoval=true) public HashJoinIteration(CloseableIteration<BindingSet, QueryEvaluationException> leftIter, Set<String> leftBindingNames, CloseableIteration<BindingSet, QueryEvaluationException> rightIter, Set<String> rightBindingNames, boolean leftJoin, IntFunction<Map<BindingSetHashKey, List<BindingSet>>> mapMaker, IntFunction<List<BindingSet>> mapValueMaker) throws QueryEvaluationException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
QueryEvaluationException
-
-
Method Details
-
getNextElement
Description copied from class:LookAheadIterationGets the next element. Subclasses should implement this method so that it returns the next element.- Specified by:
getNextElementin classLookAheadIteration<BindingSet, QueryEvaluationException>- Returns:
- The next element, or null if no more elements are available.
- Throws:
QueryEvaluationException
-
handleClose
Description copied from class:AbstractCloseableIterationCalled byAbstractCloseableIteration.close()when it is called for the first time. This method is only called once on each iteration. By default, this method does nothing.- Overrides:
handleClosein classLookAheadIteration<BindingSet, QueryEvaluationException>- Throws:
QueryEvaluationException
-
setupHashTable
- Throws:
QueryEvaluationException
-
putHashTableEntry
protected void putHashTableEntry(Map<BindingSetHashKey, List<BindingSet>> nextHashTable, BindingSetHashKey hashKey, List<BindingSet> hashValue, boolean newEntry) throws QueryEvaluationException - Throws:
QueryEvaluationException
-
makeIterationCache
protected Collection<BindingSet> makeIterationCache(CloseableIteration<BindingSet, QueryEvaluationException> iter) Utility methods to make it easier to inserted custom store dependent list- Returns:
- list
-
makeHashTable
Utility methods to make it easier to inserted custom store dependent maps- Returns:
- map
-
makeHashValue
Utility methods to make it easier to inserted custom store dependent list- Returns:
- list
-
disposeCache
Utility methods to clear-up in case not using in-memory cache. -
disposeHashTable
Utility methods to clear-up in case not using in-memory hash table. -
closeHashValue
Utility methods to clear-up in case not using in-memory hash table. -
nextFromCache
-
add
- Throws:
QueryEvaluationException
-
addAll
- Throws:
QueryEvaluationException
-
hashJoinAttributeNames
-
hashJoinAttributeNames
-