.closeOnJvmShutdown() .transactionDisable() .deleteFilesAfterClose() .strictDBGet() .asyncWriteEnable()
.transactionDisable() .syncOnCommitDisable() .deleteFilesAfterClose() .cacheDisable() .mmapFileEnableIfSupported()
/** Create a GTFS feed in a temp file */ public GTFSFeed () { // calls to this must be first operation in constructor - why, Java? this(DBMaker.newTempFileDB() .transactionDisable() .mmapFileEnable() .asyncWriteEnable() .deleteFilesAfterClose() .compressionEnable() // .cacheSize(1024 * 1024) this bloats memory consumption .make()); // TODO db.close(); }
m = DBMaker.newTempFileDB().deleteFilesAfterClose();
@Override public V put(K key, V value) { if (hashMap.size() == THRESHOLD) { File dbFile; try { dbFile = File.createTempFile("mapdb", "temp"); } catch (IOException e) { throw new UncheckedIOException(e); } mapDB = DBMaker.newFileDB(dbFile).deleteFilesAfterClose().transactionDisable().make(); map = mapDB.createHashMap("map").make(); map.putAll(hashMap); hashMap.clear(); } if (map == null) { return hashMap.put(key, value); } return map.put(key, value); }
@Override public boolean add(E obj) { if (hashSet.size() == THRESHOLD) { File dbFile; try { dbFile = File.createTempFile("mapdb", "temp"); } catch (IOException e) { throw new UncheckedIOException(e); } mapDB = DBMaker.newFileDB(dbFile).deleteFilesAfterClose().transactionDisable().make(); set = mapDB.createHashSet("set").make(); set.addAll(hashSet); hashSet.clear(); } if (set == null) { return hashSet.add(obj); } return set.add(obj); }
public OrderIterator(CloseableIteration<BindingSet, QueryEvaluationException> iter, Comparator<BindingSet> comparator, long limit, boolean distinct, long iterationSyncThreshold) { this.iter = iter; this.comparator = comparator; this.limit = limit; this.distinct = distinct; this.iterationSyncThreshold = iterationSyncThreshold; if (iterationSyncThreshold > 0) { try { this.tempFile = File.createTempFile("order-eval", null); } catch (IOException e) { throw new IOError(e); } this.db = DBMaker.newFileDB(tempFile).deleteFilesAfterClose().closeOnJvmShutdown().make(); } else { this.tempFile = null; this.db = null; } }
public GroupIterator(EvaluationStrategy strategy, Group group, BindingSet parentBindings, long iterationCacheSyncThreshold) throws QueryEvaluationException { this.strategy = strategy; this.group = group; this.parentBindings = parentBindings; this.iterationCacheSyncThreshold = iterationCacheSyncThreshold; if (this.iterationCacheSyncThreshold > 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(); } else { this.tempFile = null; this.db = null; } }
public GroupIterator(EvaluationStrategy strategy, Group group, BindingSet parentBindings, long iterationCacheSyncThreshold) throws QueryEvaluationException { this.strategy = strategy; this.group = group; this.parentBindings = parentBindings; this.iterationCacheSyncThreshold = iterationCacheSyncThreshold; if (this.iterationCacheSyncThreshold > 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(); } else { this.tempFile = null; this.db = null; } }
public GroupIterator(EvaluationStrategy strategy, Group group, BindingSet parentBindings, long iterationCacheSyncThreshold) throws QueryEvaluationException { this.strategy = strategy; this.group = group; this.parentBindings = parentBindings; this.iterationCacheSyncThreshold = iterationCacheSyncThreshold; if (this.iterationCacheSyncThreshold > 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(); } else { this.tempFile = null; this.db = null; } }
.transactionDisable() .syncOnCommitDisable() .deleteFilesAfterClose() .cacheDisable() .mmapFileEnableIfSupported()
/** Create a GTFS feed in a temp file */ public GTFSFeed () { // calls to this must be first operation in constructor - why, Java? this(DBMaker.newTempFileDB() .transactionDisable() .mmapFileEnable() .asyncWriteEnable() .deleteFilesAfterClose() .compressionEnable() // .cacheSize(1024 * 1024) this bloats memory consumption .make()); // TODO db.close(); }
public DB initDb(String cacheName) throws PropertyEnricherException { File mapdbCacheDir = new File(getCacheDir(), "mapdb"); createCacheDir(mapdbCacheDir, isTemporary()); DBMaker dbMaker = DBMaker .newFileDB(new File(mapdbCacheDir, cacheName)) .mmapFileEnableIfSupported() .closeOnJvmShutdown() .transactionDisable(); if (isTemporary()) { dbMaker.deleteFilesAfterClose(); } return dbMaker .make(); }
/** * Constructs Sorter with optional limit and optional distinct filtering * @param limit long limit, where Long.MAXLONG means no limit * @param distinct optional boolean switch to do not preserve multiple equal elements */ public Sorter(long limit, boolean distinct) { this.db = DBMaker.newTempFileDB().deleteFilesAfterClose().closeOnJvmShutdown().transactionDisable().make(); this.map = db.createTreeMap(MAP_NAME).make(); this.limit = limit; this.distinct = distinct; }
public MapDbCachingIndexProvider(LuceneBatchInserterIndexProvider luceneIndex) { this.luceneIndex = luceneIndex; db = DBMaker.newTempFileDB(). asyncFlushDelay(1000). cacheSize(1024 * 1024). closeOnJvmShutdown(). deleteFilesAfterClose(). syncOnCommitDisable(). writeAheadLogDisable(). make(); }
if (diskPath == null) { LOG.info("OSM will be stored in a temporary file."); dbMaker = DBMaker.newTempFileDB().deleteFilesAfterClose(); } else { if (diskPath.equals("__MEMORY__")) {