.closeOnJvmShutdown() .transactionDisable() .deleteFilesAfterClose()
.closeOnJvmShutdown() .transactionDisable() .syncOnCommitDisable()
.readOnly() .transactionDisable() .closeOnJvmShutdown() .cacheSize(24) .asyncWriteEnable() .transactionDisable() .cacheSize(48) .closeOnJvmShutdown() .make();
@Override public DBMaker<?> configure(DBMaker<?> maker) { return maker.closeOnJvmShutdown(); } };
@Override public DBMaker<?> configure(DBMaker<?> maker) { return maker.closeOnJvmShutdown(); } };
@Override public DBMaker<?> configure(DBMaker<?> maker) { return maker.closeOnJvmShutdown(); } };
@Activate public void activate() { dbFolderName = ConfigConstants.getUserDataFolder() + File.separator + dbFolderName; File folder = new File(dbFolderName); if (!folder.exists()) { folder.mkdirs(); } File dbFile = new File(dbFolderName, DB_FILE_NAME); db = DBMaker.newFileDB(dbFile).closeOnJvmShutdown().make(); logger.debug("Opened MapDB file at '{}'.", dbFile.getAbsolutePath()); }
public static synchronized DBMaker<?> SafeDefaultDb(String loc,String name){ File dbFile = new File(loc); if (!dbFile.exists()) dbFile.mkdirs(); dbFile = new File(dbFile, "mapdb"); logger.info("Opening DB "+name+" at " + dbFile); // Storing gigantic maps in this temporary DB return DBMaker.newFileDB(dbFile).freeSpaceReclaimQ(3) .mmapFileEnablePartial() .cacheLRUEnable() .closeOnJvmShutdown(); } public static <K extends Comparable<K>, V> BTreeMap<K, V> batchCreate(final Map<K, V> map,
public static synchronized DBMaker<?> SafeDefaultDb(String loc,String name){ File dbFile = new File(loc); if (!dbFile.exists()) dbFile.mkdirs(); dbFile = new File(dbFile, "mapdb"); logger.info("Opening DB "+name+" at " + dbFile); // Storing gigantic maps in this temporary DB return DBMaker.newFileDB(dbFile).freeSpaceReclaimQ(3) .mmapFileEnablePartial() .cacheLRUEnable() .closeOnJvmShutdown(); } public static <K extends Comparable<K>, V> BTreeMap<K, V> batchCreate(final Map<K, V> map,
public static synchronized DBMaker<?> SafeDefaultDb(String loc,String name){ File dbFile = new File(loc); if (!dbFile.exists()) dbFile.mkdirs(); dbFile = new File(dbFile, "mapdb"); logger.info("Opening DB "+name+" at " + dbFile); // Storing gigantic maps in this temporary DB return DBMaker.newFileDB(dbFile).freeSpaceReclaimQ(3) .mmapFileEnablePartial() .cacheLRUEnable() .closeOnJvmShutdown(); } public static <K extends Comparable<K>, V> BTreeMap<K, V> batchCreate(final Map<K, V> map,
public IdStore(File directory, String idName) { if(!directory.exists()) directory.mkdirs(); DBMaker dbm = DBMaker.newFileDB(new File(directory, "id_" + idName + ".db")) .mmapFileEnableIfSupported() .closeOnJvmShutdown(); db = dbm.make(); id = db.createAtomicLong(idName, INITIAL_VALUE); }
@Provides @Singleton DB getMaker() { File dbLocation = new File(configuration.getLocation(), "SciGraphIdMap"); return DBMaker.newFileDB(dbLocation).closeOnJvmShutdown().transactionDisable().mmapFileEnable() .make(); }
/** * Moderate space saving; * mmap file; * LRU instance cache; * close on shutdown; * write-through; * @param loc * @param name * @return */ public static synchronized DBMaker<?> newDefaultDb(String loc,String name){ File dbFile = new File(loc); if (!dbFile.exists()) dbFile.mkdirs(); dbFile = new File(dbFile, "mapdb"); logger.info("Opening DB "+name+" at " + dbFile); // Storing gigantic maps in this temporary DB return DBMaker.newFileDB(dbFile).freeSpaceReclaimQ(3) .mmapFileEnablePartial() .transactionDisable() .cacheLRUEnable() .closeOnJvmShutdown(); }
/** * Moderate space saving; * mmap file; * LRU instance cache; * close on shutdown; * write-through; * @param loc * @param name * @return */ public static synchronized DBMaker<?> newDefaultDb(String loc,String name){ File dbFile = new File(loc); if (!dbFile.exists()) dbFile.mkdirs(); dbFile = new File(dbFile, "mapdb"); logger.info("Opening DB "+name+" at " + dbFile); // Storing gigantic maps in this temporary DB return DBMaker.newFileDB(dbFile).freeSpaceReclaimQ(3) .mmapFileEnablePartial() .transactionDisable() .cacheLRUEnable() .closeOnJvmShutdown(); }
private MapDb() { try { File file = File.createTempFile("geo-analyzer", ".db"); db = DBMaker.newFileDB(file).asyncWriteEnable().cacheSize(100000) .closeOnJvmShutdown().transactionDisable().make(); } catch (IOException e) { throw new RuntimeException(e); } }
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 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(); }