Class MapDbCollectionFactory
java.lang.Object
org.eclipse.rdf4j.collection.factory.mapdb.MapDbCollectionFactory
- All Implemented Interfaces:
AutoCloseable,CollectionFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classprotected static final classprotected classOnly create a disk based set once the contents are large enough that it starts to pay off. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected org.mapdb.DBprotected final long -
Constructor Summary
ConstructorsConstructorDescriptionMapDbCollectionFactory(long iterationCacheSyncThreshold) MapDbCollectionFactory(long iterationCacheSyncThreshold, CollectionFactory delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet, Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator) <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 voidinit()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.collection.factory.api.CollectionFactory
createBindingSetQueue, createBindingSetQueue, hashAValue, hashOfBindingSetFuntion
-
Field Details
-
db
protected volatile org.mapdb.DB db -
colectionId
protected volatile long colectionId -
iterationCacheSyncThreshold
protected final long iterationCacheSyncThreshold
-
-
Constructor Details
-
MapDbCollectionFactory
public MapDbCollectionFactory(long iterationCacheSyncThreshold) -
MapDbCollectionFactory
-
-
Method Details
-
init
protected void init() -
createList
- Specified by:
createListin interfaceCollectionFactory- Type Parameters:
T- of the list- Returns:
- a list that may be optimised and/or disk based
-
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
-
createSetOfBindingSets
- Specified by:
createSetOfBindingSetsin interfaceCollectionFactory- Returns:
- a set that may be optimised and/or disk based
-
createSet
- Specified by:
createSetin interfaceCollectionFactory- Type Parameters:
T- of the set- Returns:
- a set that may be optimised and/or disk based
-
createValueSet
- Specified by:
createValueSetin interfaceCollectionFactory- Returns:
- a set that may be optimised and/or disk based for Values
-
createMap
- Specified by:
createMapin interfaceCollectionFactory- Type Parameters:
K- key typeV- value type- Returns:
- a map
-
createValueKeyedMap
- Specified by:
createValueKeyedMapin interfaceCollectionFactory- Type Parameters:
V- value type- Returns:
- a map
-
createQueue
- Specified by:
createQueuein interfaceCollectionFactory- Type Parameters:
T- of the contents of the queue- Returns:
- a new queue
-
createValueQueue
- Specified by:
createValueQueuein interfaceCollectionFactory- Returns:
- a new queue
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCollectionFactory- Throws:
RDF4JException
-
createGroupByMap
- Specified by:
createGroupByMapin interfaceCollectionFactory
-
createBindingSetKey
public BindingSetKey createBindingSetKey(BindingSet bindingSet, List<Function<BindingSet, Value>> getValues, ToIntFunction<BindingSet> hashOfBindingSetCalculator) - Specified by:
createBindingSetKeyin interfaceCollectionFactory
-