Class MapDbCollectionFactory
- java.lang.Object
-
- org.eclipse.rdf4j.collection.factory.mapdb.MapDbCollectionFactory
-
- All Implemented Interfaces:
AutoCloseable
,CollectionFactory
public class MapDbCollectionFactory extends Object implements CollectionFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
MapDbCollectionFactory.CommitingMap<K,V>
protected static class
MapDbCollectionFactory.CommitingSet<T>
protected class
MapDbCollectionFactory.MemoryTillSizeXSet<V>
Only create a disk based set once the contents are large enough that it starts to pay off.
-
Field Summary
Fields Modifier and Type Field Description protected long
colectionId
protected org.mapdb.DB
db
protected long
iterationCacheSyncThreshold
-
Constructor Summary
Constructors Constructor Description MapDbCollectionFactory(long iterationCacheSyncThreshold)
MapDbCollectionFactory(long iterationCacheSyncThreshold, CollectionFactory delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
BindingSetKey
createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet,Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator)
<E> Map<BindingSetKey,E>
createGroupByMap()
<T> List<T>
createList()
<K,V>
Map<K,V>createMap()
<T> Queue<T>
createQueue()
<T> Set<T>
createSet()
Set<BindingSet>
createSetOfBindingSets()
<V> Map<Value,V>
createValueKeyedMap()
List<Value>
createValueList()
Queue<Value>
createValueQueue()
Set<Value>
createValueSet()
protected void
init()
-
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.collection.factory.api.CollectionFactory
hashAValue, hashOfBindingSetFuntion
-
-
-
-
Constructor Detail
-
MapDbCollectionFactory
public MapDbCollectionFactory(long iterationCacheSyncThreshold)
-
MapDbCollectionFactory
public MapDbCollectionFactory(long iterationCacheSyncThreshold, CollectionFactory delegate)
-
-
Method Detail
-
init
protected void init()
-
createList
public <T> List<T> createList()
- Specified by:
createList
in interfaceCollectionFactory
- Type Parameters:
T
- of the list- Returns:
- a list that may be optimised and/or disk based
-
createValueList
public List<Value> createValueList()
- Specified by:
createValueList
in interfaceCollectionFactory
- Returns:
- a list that may be optimised and/or disk based for Values only
-
createSetOfBindingSets
public Set<BindingSet> createSetOfBindingSets()
- Specified by:
createSetOfBindingSets
in interfaceCollectionFactory
- Returns:
- a set that may be optimised and/or disk based
-
createSet
public <T> Set<T> createSet()
- Specified by:
createSet
in interfaceCollectionFactory
- Type Parameters:
T
- of the set- Returns:
- a set that may be optimised and/or disk based
-
createValueSet
public Set<Value> createValueSet()
- Specified by:
createValueSet
in interfaceCollectionFactory
- Returns:
- a set that may be optimised and/or disk based for Values
-
createMap
public <K,V> Map<K,V> createMap()
- Specified by:
createMap
in interfaceCollectionFactory
- Type Parameters:
K
- key typeV
- value type- Returns:
- a map
-
createValueKeyedMap
public <V> Map<Value,V> createValueKeyedMap()
- Specified by:
createValueKeyedMap
in interfaceCollectionFactory
- Type Parameters:
V
- value type- Returns:
- a map
-
createQueue
public <T> Queue<T> createQueue()
- Specified by:
createQueue
in interfaceCollectionFactory
- Type Parameters:
T
- of the contents of the queue- Returns:
- a new queue
-
createValueQueue
public Queue<Value> createValueQueue()
- Specified by:
createValueQueue
in interfaceCollectionFactory
- Returns:
- a new queue
-
close
public void close() throws RDF4JException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCollectionFactory
- Throws:
RDF4JException
-
createGroupByMap
public <E> Map<BindingSetKey,E> createGroupByMap()
- Specified by:
createGroupByMap
in interfaceCollectionFactory
-
createBindingSetKey
public BindingSetKey createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet,Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator)
- Specified by:
createBindingSetKey
in interfaceCollectionFactory
-
-