MCPcopy Create free account
hub / github.com/cschanck/single-file-java / snapshot

Method snapshot

src/main/java/org/sfj/ChiseledMap.java:520–526  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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) {

Callers 1

Calls 3

entriesMethod · 0.95
ioSetMethod · 0.95
getKeyMethod · 0.45

Tested by 1