Skip to content

Commit

Permalink
GH-2061 use filechannel and faster serialization
Browse files Browse the repository at this point in the history
Signed-off-by:Bart Hanssens <[email protected]>
  • Loading branch information
barthanssens authored and abrokenjester committed Apr 16, 2021
1 parent 34c87fc commit 6257895
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

import org.mapdb.DB;
import org.mapdb.DBMaker;
import org.mapdb.Serializer;

/**
* @author David Huynh
Expand Down Expand Up @@ -102,6 +103,7 @@ public GroupIterator(EvaluationStrategy strategy, Group group, BindingSet parent
if (this.iterationCacheSyncThreshold > 0) {
this.db = DBMaker.tempFileDB()
.fileDeleteAfterClose()
.fileChannelEnable()
.closeOnJvmShutdown()
.make();
} else {
Expand Down Expand Up @@ -152,7 +154,7 @@ protected void handleClose() throws QueryEvaluationException {

private <T> Set<T> createSet(String setName) {
if (db != null) {
return (Set<T>) db.hashSet(setName).create();
return (Set<T>) db.hashSet(setName).serializer(Serializer.JAVA).create();
} else {
return new HashSet<>();
}
Expand Down

0 comments on commit 6257895

Please sign in to comment.