Copy only live entries to another file. Blocks writes to this map while snapshotting. @param f dest file @return new TinyKVMap @throws IOException on exception
(File f)
| 518 | * @throws IOException on exception |
| 519 | */ |
| 520 | public synchronized ChiseledMap<K, V> snapshot(File f) throws IOException { |
| 521 | ChiseledMap<K, V> ret = new ChiseledMap<>(f, OpenOption.MUST_BE_NEW, comp, encoder, decoder); |
| 522 | for (Entry<K, V> ent : entries()) { |
| 523 | ret.ioSet(ent.getKey(), ent.getValue()); |
| 524 | } |
| 525 | return ret; |
| 526 | } |
| 527 | |
| 528 | @Override |
| 529 | public boolean containsKey(Object key) { |