Class MapDb3CollectionFactory
java.lang.Object
org.eclipse.rdf4j.collection.factory.mapdb.MapDb3CollectionFactory
- All Implemented Interfaces:
AutoCloseable
,CollectionFactory
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
protected static final class
protected class
Only create a disk based set once the contents are large enough that it starts to pay off.protected class
Only create a disk based set once the contents are large enough that it starts to pay off.protected static final class
-
Field Summary
Modifier and TypeFieldDescriptionprotected long
protected org.mapdb.DB
protected final long
-
Constructor Summary
ConstructorDescriptionMapDb3CollectionFactory
(long iterationCacheSyncThreshold) MapDb3CollectionFactory
(long iterationCacheSyncThreshold, CollectionFactory delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected <T> org.mapdb.Serializer
<T> final BindingSetKey
createBindingSetKey
(BindingSet bindingSet, List<Function<BindingSet, Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator) protected final org.mapdb.Serializer
<BindingSetKey> createBindingSetQueue
(Supplier<MutableBindingSet> create, Function<String, Predicate<BindingSet>> getHas, Function<String, Function<BindingSet, Value>> getget, Function<String, BiConsumer<Value, MutableBindingSet>> getSet) 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.<E> Map
<BindingSetKey, E> <T> List
<T> <K,
V> Map <K, V> <T> Queue
<T> <T> Set
<T> createSetOfBindingSets
(Supplier<MutableBindingSet> create, Function<String, Predicate<BindingSet>> getHas, Function<String, Function<BindingSet, Value>> getget, Function<String, BiConsumer<Value, MutableBindingSet>> getSet) Allows optimizations beyond what would otherwise be possible, regarding disk access and storage.protected org.mapdb.Serializer
<Value> 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
createBindingSetQueue, createSetOfBindingSets, hashAValue, hashOfBindingSetFuntion
-
Field Details
-
db
protected volatile org.mapdb.DB db -
colectionId
protected volatile long colectionId -
iterationCacheSyncThreshold
protected final long iterationCacheSyncThreshold
-
-
Constructor Details
-
MapDb3CollectionFactory
public MapDb3CollectionFactory(long iterationCacheSyncThreshold) -
MapDb3CollectionFactory
-
-
Method Details
-
init
protected void init() -
createList
- Specified by:
createList
in interfaceCollectionFactory
- Type Parameters:
T
- of the list- Returns:
- a list that may be optimised and/or disk based
-
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(Supplier<MutableBindingSet> create, Function<String, Predicate<BindingSet>> getHas, Function<String, Function<BindingSet, Value>> getget, Function<String, BiConsumer<Value, MutableBindingSet>> getSet) Description copied from interface:CollectionFactory
Allows optimizations beyond what would otherwise be possible, regarding disk access and storage.- Specified by:
createSetOfBindingSets
in interfaceCollectionFactory
- Parameters:
create
- a supplier that makes bindingsets- Returns:
- a set that may be optimised and/or disk based
-
createSet
- Specified by:
createSet
in interfaceCollectionFactory
- Type Parameters:
T
- of the set- Returns:
- a set that may be optimised and/or disk based
-
createValueSet
- Specified by:
createValueSet
in interfaceCollectionFactory
- Returns:
- a set that may be optimised and/or disk based for Values
-
createMap
- Specified by:
createMap
in interfaceCollectionFactory
- Type Parameters:
K
- key typeV
- value type- Returns:
- a map
-
createValueKeyedMap
- Specified by:
createValueKeyedMap
in interfaceCollectionFactory
- Type Parameters:
V
- value type- Returns:
- a map
-
createQueue
- Specified by:
createQueue
in interfaceCollectionFactory
- Type Parameters:
T
- of the contents of the queue- Returns:
- a new queue
-
createValueQueue
- Specified by:
createValueQueue
in 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:
createBindingSetQueue
in interfaceCollectionFactory
- Returns:
- a new queue that may be optimized and may use the functions passed in.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCollectionFactory
- Throws:
RDF4JException
-
createGroupByMap
- Specified by:
createGroupByMap
in interfaceCollectionFactory
-
createBindingSetKey
public final BindingSetKey createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet, Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator) - Specified by:
createBindingSetKey
in 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:
create
-getHas
-getGet
-
-
createAnySerializer
protected <T> org.mapdb.Serializer<T> createAnySerializer() -
createValueSerializer
-
createBindingSetKeySerializer
-