Class LinearIndex
- java.lang.Object
-
- org.apache.jena.sparql.engine.index.LinearIndex
-
- All Implemented Interfaces:
IndexTable
public class LinearIndex extends java.lang.Object implements 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
Constructors Constructor Description LinearIndex(java.util.Set<Var> commonVars, QueryIterator data)LinearIndex(java.util.Set<Var> commonVars, QueryIterator data, java.util.Set<org.apache.jena.sparql.engine.index.HashIndexTable.Key> loadedData, java.util.Map<Var,java.lang.Integer> mappings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsCompatibleWithSharedDomain(Binding bindingLeft)Is there a binding in the table that has a shared domain (variables in common) and is join-compatible? This is teh condition for MINUS to exclude the argument binding.java.lang.StringtoString()
-
-
-
Constructor Detail
-
LinearIndex
public LinearIndex(java.util.Set<Var> commonVars, QueryIterator data)
-
LinearIndex
public LinearIndex(java.util.Set<Var> commonVars, QueryIterator data, java.util.Set<org.apache.jena.sparql.engine.index.HashIndexTable.Key> loadedData, java.util.Map<Var,java.lang.Integer> mappings)
-
-
Method Detail
-
containsCompatibleWithSharedDomain
public boolean containsCompatibleWithSharedDomain(Binding bindingLeft)
Description copied from interface:IndexTableIs there a binding in the table that has a shared domain (variables in common) and is join-compatible? This is teh condition for MINUS to exclude the argument binding.- Specified by:
containsCompatibleWithSharedDomainin interfaceIndexTable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-