java.lang.Object
org.apache.jena.sparql.engine.index.LinearIndex
- All Implemented Interfaces:
IndexTable
A slow "index" that looks for data by searching linearly through a set.
Only used when the indexed data contains fewer bound variables than expected.
Note that this class is only used for a MINUS operation that is removing data
with potentially unbound values, and is therefore rarely used.
TODO: If this index starts to be used more often then consider various options for
indexing on the known bound variables.
One possibility is for each variable (found in commonVars) to take
the value of a var/value pair and TreeMap this to a set of Bindings that it occurs in.
This would offer a reduced set to search, and set intersections may also work
(intersections like this could be done on Binding reference equality rather than value).
TreeMap is suggested here, since there would be commonVars.size() maps, which would take
a lot of heap, particularly since performance of this class is only an issue when the
data to search is significant.
-
Constructor Summary
ConstructorDescriptionLinearIndex
(Set<Var> commonVars, QueryIterator data) LinearIndex
(Set<Var> commonVars, QueryIterator data, Set<org.apache.jena.sparql.engine.index.HashIndexTable.Key> loadedData, Map<Var, Integer> mappings) -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsCompatibleWithSharedDomain
(Binding bindingLeft) Is there a binding in the table that has a shared domain (variables in common) and is join-compatible?toString()
-
Constructor Details
-
LinearIndex
-
LinearIndex
public LinearIndex(Set<Var> commonVars, QueryIterator data, Set<org.apache.jena.sparql.engine.index.HashIndexTable.Key> loadedData, Map<Var, Integer> mappings)
-
-
Method Details