com.hp.hpl.jena.sparql.engine.index
Class LinearIndex
java.lang.Object
com.hp.hpl.jena.sparql.engine.index.LinearIndex
- All Implemented Interfaces:
- IndexTable
public class LinearIndex
- extends 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.
- Author:
- Paul Gearon
LinearIndex
public LinearIndex(Set<Var> commonVars,
QueryIterator data)
LinearIndex
public LinearIndex(Set<Var> commonVars,
QueryIterator data,
Set<com.hp.hpl.jena.sparql.engine.index.HashIndexTable.Key> loadedData,
Map<Var,Integer> mappings)
containsCompatibleWithSharedDomain
public boolean containsCompatibleWithSharedDomain(Binding bindingLeft)
- Specified by:
containsCompatibleWithSharedDomain
in interface IndexTable
Licenced under the Apache License, Version 2.0