Package org.eclipse.rdf4j.model.impl
Class AbstractMemoryOverflowModel<T extends AbstractModel>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<Statement>
-
- org.eclipse.rdf4j.model.impl.AbstractModel
-
- org.eclipse.rdf4j.model.impl.AbstractMemoryOverflowModel<T>
-
- All Implemented Interfaces:
Serializable,Iterable<Statement>,Collection<Statement>,Set<Statement>,Model,NamespaceAware
@InternalUseOnly public abstract class AbstractMemoryOverflowModel<T extends AbstractModel> extends AbstractModel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intBATCH_SIZEThe default batch size is 1024.protected Tdiskstatic intMEMORY_THRESHOLD_HIGHms GC activity over the past second that triggers overflow to diskstatic intMEMORY_THRESHOLD_LOWms GC activity over the past second that skips overflow to disk in anticipation of GC freeing up memorystatic intMEMORY_THRESHOLD_MEDIUMms GC activity over the past second that disables overflow to diskstatic intMIN_AVAILABLE_MEM_BEFORE_OVERFLOWINGThe minimum amount of free memory before overflowing to disk.-
Fields inherited from class org.eclipse.rdf4j.model.impl.AbstractModel
NULL_CONTEXT
-
-
Constructor Summary
Constructors Constructor Description AbstractMemoryOverflowModel()AbstractMemoryOverflowModel(Set<Namespace> namespaces)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanadd(Resource subj, IRI pred, Value obj, Resource... contexts)booleanadd(Statement st)booleanaddAll(Collection<? extends Statement> c)booleanclear(Resource... contexts)booleancontains(Resource subj, IRI pred, Value obj, Resource... contexts)Modelfilter(Resource subj, IRI pred, Value obj, Resource... contexts)Optional<Namespace>getNamespace(String prefix)Set<Namespace>getNamespaces()Iterator<Statement>iterator()protected abstract voidoverflowToDiskInner(Model memory)booleanremove(Resource subj, IRI pred, Value obj, Resource... contexts)Optional<Namespace>removeNamespace(String prefix)voidremoveTermIteration(Iterator<Statement> iter, Resource subj, IRI pred, Value obj, Resource... contexts)Called by aggregate sets when a term has been removed from a term iterator.NamespacesetNamespace(String prefix, String name)voidsetNamespace(Namespace namespace)intsize()-
Methods inherited from class org.eclipse.rdf4j.model.impl.AbstractModel
clear, closeIterator, contains, containsAll, contexts, isEmpty, objects, predicates, remove, removeAll, retainAll, subjects, toArray, toArray, unmodifiable
-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.eclipse.rdf4j.model.Model
getStatements
-
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
-
-
-
Field Detail
-
BATCH_SIZE
public static int BATCH_SIZE
The default batch size is 1024. This is the number of statements that will be written to disk at a time.
-
MEMORY_THRESHOLD_HIGH
public static int MEMORY_THRESHOLD_HIGH
ms GC activity over the past second that triggers overflow to disk
-
MEMORY_THRESHOLD_MEDIUM
public static int MEMORY_THRESHOLD_MEDIUM
ms GC activity over the past second that disables overflow to disk
-
MEMORY_THRESHOLD_LOW
public static int MEMORY_THRESHOLD_LOW
ms GC activity over the past second that skips overflow to disk in anticipation of GC freeing up memory
-
MIN_AVAILABLE_MEM_BEFORE_OVERFLOWING
public static int MIN_AVAILABLE_MEM_BEFORE_OVERFLOWING
The minimum amount of free memory before overflowing to disk. Defaults to 32 MB for heaps smaller than 1 GB and 128 MB for heaps larger than 1 GB.
-
disk
protected transient volatile T extends AbstractModel disk
-
-
Method Detail
-
setNamespace
public void setNamespace(Namespace namespace)
-
add
public boolean add(Statement st)
- Specified by:
addin interfaceCollection<T extends AbstractModel>- Specified by:
addin interfaceSet<T extends AbstractModel>- Overrides:
addin classAbstractModel
-
addAll
public boolean addAll(Collection<? extends Statement> c)
- Specified by:
addAllin interfaceCollection<T extends AbstractModel>- Specified by:
addAllin interfaceSet<T extends AbstractModel>- Overrides:
addAllin classAbstractModel
-
size
public int size()
- Specified by:
sizein interfaceCollection<T extends AbstractModel>- Specified by:
sizein interfaceSet<T extends AbstractModel>- Specified by:
sizein classAbstractCollection<Statement>
-
iterator
public Iterator<Statement> iterator()
- Specified by:
iteratorin interfaceCollection<T extends AbstractModel>- Specified by:
iteratorin interfaceIterable<T extends AbstractModel>- Specified by:
iteratorin interfaceSet<T extends AbstractModel>- Specified by:
iteratorin classAbstractCollection<Statement>
-
clear
public boolean clear(Resource... contexts)
- Specified by:
clearin interfaceModel- Overrides:
clearin classAbstractModel
-
removeTermIteration
public void removeTermIteration(Iterator<Statement> iter, Resource subj, IRI pred, Value obj, Resource... contexts)
Description copied from class:AbstractModelCalled by aggregate sets when a term has been removed from a term iterator. Exactly one of the last four terms will be non-empty.- Specified by:
removeTermIterationin classAbstractModel- Parameters:
iter- The iterator used to navigate the live set (never null)subj- the subject term to be removed or nullpred- the predicate term to be removed or nullobj- the object term to be removed or nullcontexts- an array of one context term to be removed or an empty array
-
overflowToDiskInner
protected abstract void overflowToDiskInner(Model memory)
-
-