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

Method ioGetSet

src/main/java/org/sfj/ChiseledMap.java:501–511  ·  view source on GitHub ↗
(K key, V v)

Source from the content-addressed store, hash-verified

499 }
500
501 public synchronized V ioGetSet(K key, V v) throws IOException {
502 Objects.requireNonNull(v);
503 Long addr = map.get(key);
504 V ret = null;
505 if (addr != null) {
506 ret = fetch(addr, false, null).getValue();
507 }
508 long newAddr = append(key, v);
509 map.put(key, newAddr);
510 return ret;
511 }
512
513 /**
514 * Copy only live entries to another file. Blocks writes to this map

Callers 1

putMethod · 0.95

Calls 4

fetchMethod · 0.95
appendMethod · 0.95
getMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected