diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIterator.java index 9bb0d51dfdf..943dde243fd 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIterator.java @@ -7,8 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.query.algebra.evaluation.iterator; -import java.io.File; -import java.io.IOException; import java.io.Serializable; import java.util.Collection; import java.util.HashSet; @@ -51,6 +49,7 @@ import org.eclipse.rdf4j.query.impl.EmptyBindingSet; import org.mapdb.DB; import org.mapdb.DBMaker; +import org.mapdb.Serializer; /** * @author David Huynh @@ -76,8 +75,6 @@ public class GroupIterator extends CloseableIteratorIteration 0) { - try { - this.tempFile = File.createTempFile("group-eval", null); - } catch (IOException e) { - throw new QueryEvaluationException("could not initialize temp db", e); - } - this.db = DBMaker.newFileDB(tempFile).deleteFilesAfterClose().closeOnJvmShutdown().make(); + this.db = DBMaker.tempFileDB() + .fileDeleteAfterClose() + .fileChannelEnable() + .closeOnJvmShutdown() + .make(); } else { - this.tempFile = null; this.db = null; } } @@ -158,7 +153,7 @@ protected void handleClose() throws QueryEvaluationException { private Set createSet(String setName) { if (db != null) { - return db.getHashSet(setName); + return (Set) db.hashSet(setName).serializer(Serializer.JAVA).create(); } else { return new HashSet<>(); } diff --git a/pom.xml b/pom.xml index ddbee47b31b..dc93aed594a 100644 --- a/pom.xml +++ b/pom.xml @@ -637,7 +637,7 @@ org.mapdb mapdb - 1.0.8 + 3.0.8