Class MapDb3CollectionFactory
- java.lang.Object
-
- org.eclipse.rdf4j.collection.factory.mapdb.MapDb3CollectionFactory
-
- All Implemented Interfaces:
AutoCloseable,CollectionFactory
public class MapDb3CollectionFactory extends Object implements CollectionFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classMapDb3CollectionFactory.CommitingMap<K,V>protected static classMapDb3CollectionFactory.CommitingSet<T>protected classMapDb3CollectionFactory.MemoryTillSizeXQueue<V>Only create a disk based set once the contents are large enough that it starts to pay off.protected classMapDb3CollectionFactory.MemoryTillSizeXSet<V>Only create a disk based set once the contents are large enough that it starts to pay off.protected static classMapDb3CollectionFactory.RDF4jMapDB3Exception
-
Field Summary
Fields Modifier and Type Field Description protected longcolectionIdprotected org.mapdb.DBdbprotected longiterationCacheSyncThreshold
-
Constructor Summary
Constructors Constructor Description MapDb3CollectionFactory(long iterationCacheSyncThreshold)MapDb3CollectionFactory(long iterationCacheSyncThreshold, CollectionFactory delegate)
-
Method Summary
-
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
createBindingSetQueue, createSetOfBindingSets, hashAValue, hashOfBindingSetFuntion
-
-
-
-
Constructor Detail
-
MapDb3CollectionFactory
public MapDb3CollectionFactory(long iterationCacheSyncThreshold)
-
MapDb3CollectionFactory
public MapDb3CollectionFactory(long iterationCacheSyncThreshold, CollectionFactory delegate)
-
-
Method Detail
-
init
protected void init()
-
createList
public <T> List<T> createList()
- Specified by:
createListin 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:
createValueListin interfaceCollectionFactory- Returns:
- a list that may be optimised and/or disk based for Values only
-
createSetOfBindingSets
public Set<BindingSet> createSetOfBindingSets(Supplier<MutableBindingSet> create, Function<String,Predicate<BindingSet>> getHas, Function<String,Function<BindingSet,Value>> getget, Function<String,BiConsumer<Value,MutableBindingSet>> getSet)
Description copied from interface:CollectionFactoryAllows optimizations beyond what would otherwise be possible, regarding disk access and storage.- Specified by:
createSetOfBindingSetsin interfaceCollectionFactory- Parameters:
create- a supplier that makes bindingsets- Returns:
- a set that may be optimised and/or disk based
-
createSet
public <T> Set<T> createSet()
- Specified by:
createSetin 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:
createValueSetin interfaceCollectionFactory- Returns:
- a set that may be optimised and/or disk based for Values
-
createMap
public <K,V> Map<K,V> createMap()
- Specified by:
createMapin interfaceCollectionFactory- Type Parameters:
K- key typeV- value type- Returns:
- a map
-
createValueKeyedMap
public <V> Map<Value,V> createValueKeyedMap()
- Specified by:
createValueKeyedMapin interfaceCollectionFactory- Type Parameters:
V- value type- Returns:
- a map
-
createQueue
public <T> Queue<T> createQueue()
- Specified by:
createQueuein interfaceCollectionFactory- Type Parameters:
T- of the contents of the queue- Returns:
- a new queue
-
createValueQueue
public Queue<Value> createValueQueue()
- Specified by:
createValueQueuein interfaceCollectionFactory- Returns:
- a new queue
-
createBindingSetQueue
@Experimental public Queue<BindingSet> createBindingSetQueue(Supplier<MutableBindingSet> create, Function<String,Predicate<BindingSet>> getHas, Function<String,Function<BindingSet,Value>> getget, Function<String,BiConsumer<Value,MutableBindingSet>> getSet)
- Specified by:
createBindingSetQueuein interfaceCollectionFactory- Returns:
- a new queue that may be optimized and may use the functions passed in.
-
close
public void close() throws RDF4JException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCollectionFactory- Throws:
RDF4JException
-
createGroupByMap
public <E> Map<BindingSetKey,E> createGroupByMap()
- Specified by:
createGroupByMapin interfaceCollectionFactory
-
createBindingSetKey
public final BindingSetKey createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet,Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator)
- Specified by:
createBindingSetKeyin interfaceCollectionFactory
-
createBindingSetSerializer
protected org.mapdb.Serializer<BindingSet> createBindingSetSerializer(Supplier<MutableBindingSet> create, Function<String,Predicate<BindingSet>> getHas, Function<String,Function<BindingSet,Value>> getGet, Function<String,BiConsumer<Value,MutableBindingSet>> getSet)
These methods should be overriding in case a store can deliver a better serialization protocol.- Parameters:
getGet-getHas-create-
-
createAnySerializer
protected <T> org.mapdb.Serializer<T> createAnySerializer()
-
createValueSerializer
protected org.mapdb.Serializer<Value> createValueSerializer()
-
createBindingSetKeySerializer
protected final org.mapdb.Serializer<BindingSetKey> createBindingSetKeySerializer()
-
-