output.close(); if (comparisonDb != null) { comparisonDb.close();
@Override public void close() throws IOException { this.db.commit(); this.treeMap.close(); this.db.close(); }
@Override public void close() { if(m instanceof BTreeMap) ((BTreeMap)m).close(); }
@Override public void close() { btree.close(); }
@Override public void close(boolean cleanLog) { if (cleanLog) { db.compact(); } btree.close(); }
@Override public synchronized void close() { super.close(); btreeMap.close(); LOG.info("Closed {}", this.mapId); }
@Override public boolean dropTable(final String tableName) { final BTreeMap<?, ?> table = mapDB.treeMap(tableName).open(); table.clear(); table.close(); return true; }
@Test public void testOnHeapDB() { DB db = DBMaker.heapDB().make(); BTreeMap<Long, String> map = db.treeMap("btree").keySerializer(Serializer.LONG).valueSerializer(Serializer.STRING).create(); Assert.assertFalse(map.putIfAbsentBoolean(1L, "val_1")); Assert.assertTrue(map.putIfAbsentBoolean(1L, "val_2")); Assert.assertTrue(map.putIfAbsentBoolean(1L, "val_3")); Assert.assertFalse(map.putIfAbsentBoolean(2L, "val_4")); Assert.assertEquals("val_1", map.get(1L)); Assert.assertEquals("val_4", map.get(2L)); Assert.assertTrue(map.replace(2L, "val_4", "val_5")); Assert.assertEquals("val_5", map.get(2L)); map.close(); db.close(); } }