Class HashJoinIteration
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<BindingSet>
org.eclipse.rdf4j.common.iteration.LookAheadIteration<BindingSet>
org.eclipse.rdf4j.query.algebra.evaluation.iterator.HashJoinIteration
- All Implemented Interfaces:
AutoCloseable
,Iterator<BindingSet>
,CloseableIteration<BindingSet>
Generic hash join implementation suitable for use by Sail implementations.
- Author:
- MJAHale
-
Field Summary
-
Constructor Summary
ConstructorDescriptionHashJoinIteration
(CloseableIteration<BindingSet> leftIter, Set<String> leftBindingNames, CloseableIteration<BindingSet> rightIter, Set<String> rightBindingNames, boolean leftJoin) Deprecated, for removal: This API element is subject to removal in a future version.HashJoinIteration
(QueryEvaluationStep left, QueryEvaluationStep right, BindingSet bindings, boolean leftJoin, String[] joinAttributes, QueryEvaluationContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected <E> void
add
(Collection<E> col, E value) protected <E> void
addAll
(Collection<E> col, List<E> values) protected <E> void
closeHashValue
(Iterator<E> iter) Utility methods to clear-up in case not using in-memory hash table.protected void
disposeCache
(Iterator<BindingSet> iter) Utility methods to clear-up in case not using in-memory cache.protected void
Utility methods to clear-up in case not using in-memory hash table.protected BindingSet
Gets the next element.protected void
Called 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> E
nextFromCache
(Iterator<E> iter) protected void
putHashTableEntry
(Map<BindingSetHashKey, List<BindingSet>> nextHashTable, BindingSetHashKey hashKey, List<BindingSet> hashValue, boolean newEntry) Methods inherited from class org.eclipse.rdf4j.common.iteration.LookAheadIteration
hasNext, next, remove
Methods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosed
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
stream
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
joinAttributes
-
-
Constructor Details
-
HashJoinIteration
public HashJoinIteration(QueryEvaluationStep left, QueryEvaluationStep right, BindingSet bindings, boolean leftJoin, String[] joinAttributes, QueryEvaluationContext context) throws QueryEvaluationException - Throws:
QueryEvaluationException
-
HashJoinIteration
@Deprecated(since="5.0.0", forRemoval=true) public HashJoinIteration(CloseableIteration<BindingSet> leftIter, Set<String> leftBindingNames, CloseableIteration<BindingSet> rightIter, Set<String> rightBindingNames, boolean leftJoin) 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:LookAheadIteration
Gets the next element. Subclasses should implement this method so that it returns the next element.- Specified by:
getNextElement
in classLookAheadIteration<BindingSet>
- Returns:
- The next element, or null if no more elements are available.
- Throws:
QueryEvaluationException
-
handleClose
Description copied from class:AbstractCloseableIteration
Called 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.- Specified by:
handleClose
in classAbstractCloseableIteration<BindingSet>
- Throws:
QueryEvaluationException
-
putHashTableEntry
protected void putHashTableEntry(Map<BindingSetHashKey, List<BindingSet>> nextHashTable, BindingSetHashKey hashKey, List<BindingSet> hashValue, boolean newEntry) throws QueryEvaluationException- Throws:
QueryEvaluationException
-
makeIterationCache
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
-