public class TripleCacheIndexImpl extends Object implements ITripleCacheIndex
| Modifier and Type | Method and Description |
|---|---|
void |
addSeen(Collection<com.hp.hpl.jena.graph.Triple> triples)
Addes triples to the cache.
|
void |
clear() |
static TripleCacheIndexImpl |
create(IGraph graph,
Integer fullMaxSize,
Integer partialMaxSize,
Integer emptyMaxSize,
int... indexColumns) |
List<Object> |
extractKey(com.hp.hpl.jena.rdf.model.Statement stmt) |
static <T> void |
fill(T[] array,
Iterable<T> items,
int[] map) |
IndexCompatibilityLevel |
getCompatibilityLevel(int[] columnIds) |
IndexCompatibilityLevel |
getCompatibilityLevel(com.hp.hpl.jena.graph.Triple pattern)
Returns the compatibility level for a given pattern
|
IGraph |
getGraph() |
int[] |
getIndexColumns() |
static com.hp.hpl.jena.rdf.model.RDFNode |
getItemAt(com.hp.hpl.jena.rdf.model.Statement stmt,
int index) |
int[] |
getKeyColumns()
Returns the "columns" that are indexed - columns correspond to
0 = subject, 1 = predicate, 2 = object
|
static <T> IndexTable |
getOrCreate(org.apache.commons.collections15.map.LRUMap<List<? super T>,IndexTable> map,
List<T> key) |
static <T> IndexTable |
getOrCreate(Map<List<T>,IndexTable> map,
List<T> key) |
CacheState |
getState() |
int[] |
getValueColumns()
Returns the "columns" for which values are provided by this index
|
void |
index(Collection<com.hp.hpl.jena.graph.Triple> triples)
Note: When indexing too many triples, the LRU map might be full.
|
Collection<com.hp.hpl.jena.graph.Triple> |
lookup(List<Object> key)
lookup: returns a possible empty set of triples
or null - if no
Does not track cache misses.
|
void |
registerMisses(Set<List<Object>> keys) |
void |
removeSeen(Collection<com.hp.hpl.jena.graph.Triple> triples)
Methods which are used to notify the index about new triples
|
String |
toString() |
static com.hp.hpl.jena.graph.Triple |
toTriple(Object[] array) |
public int[] getIndexColumns()
public static TripleCacheIndexImpl create(IGraph graph, Integer fullMaxSize, Integer partialMaxSize, Integer emptyMaxSize, int... indexColumns) throws Exception
Exceptionpublic static com.hp.hpl.jena.rdf.model.RDFNode getItemAt(com.hp.hpl.jena.rdf.model.Statement stmt,
int index)
public static <T> IndexTable getOrCreate(Map<List<T>,IndexTable> map, List<T> key)
public static <T> IndexTable getOrCreate(org.apache.commons.collections15.map.LRUMap<List<? super T>,IndexTable> map, List<T> key)
public static <T> void fill(T[] array,
Iterable<T> items,
int[] map)
public static com.hp.hpl.jena.graph.Triple toTriple(Object[] array)
public Collection<com.hp.hpl.jena.graph.Triple> lookup(List<Object> key)
lookup in interface ITripleCacheIndexkey - public IGraph getGraph()
getGraph in interface ITripleCacheIndexpublic IndexCompatibilityLevel getCompatibilityLevel(com.hp.hpl.jena.graph.Triple pattern)
ITripleCacheIndexgetCompatibilityLevel in interface ITripleCacheIndexpublic void index(Collection<com.hp.hpl.jena.graph.Triple> triples)
index in interface ITripleCacheIndexpublic void removeSeen(Collection<com.hp.hpl.jena.graph.Triple> triples)
ITripleCacheIndexremoveSeen in interface ITripleCacheIndexpublic int[] getKeyColumns()
ITripleCacheIndexgetKeyColumns in interface ITripleCacheIndexpublic int[] getValueColumns()
ITripleCacheIndexgetValueColumns in interface ITripleCacheIndexpublic IndexCompatibilityLevel getCompatibilityLevel(int[] columnIds)
getCompatibilityLevel in interface ITripleCacheIndexpublic void addSeen(Collection<com.hp.hpl.jena.graph.Triple> triples)
ITripleCacheIndexaddSeen in interface ITripleCacheIndexpublic void clear()
clear in interface ITripleCacheIndexpublic void registerMisses(Set<List<Object>> keys)
registerMisses in interface ITripleCacheIndexpublic CacheState getState()
getState in interface ITripleCacheIndexCopyright © 2013. All Rights Reserved.