Source:
<code>private FateMetricValues updateFromZookeeper() { FateMetricValues.Builder builder = FateMetricValues.builder(); AdminUtil<FateMetrics> admin = new AdminUtil<>(false); try { List<AdminUtil.TransactionStatus> currFates = admin.getTransactionStatus(zooStore, null, null); builder.withCurrentFateOps(currFates.size()); Map<String,Long> states = new TreeMap<>(); for (ReadOnlyTStore.TStatus t : ReadOnlyTStore.TStatus.values()) { states.put(t.name(), 0L); } Map<String,Long> opTypeCounters = new TreeMap<>(); for (AdminUtil.TransactionStatus tx : currFates) { String stateName = tx.getStatus().name(); <START> states.compute(stateName, (k, v) -> (v == null) ? 1 : v + 1); <END> if (ReadOnlyTStore.TStatus.IN_PROGRESS.equals(tx.getStatus())) { String opType = tx.getDebug(); if (opType == null || opType.isEmpty()) { opType = "UNKNOWN"; } opTypeCounters.compute(opType, (k, v) -> (v == null) ? 1 : v + 1); } } builder.withTxStateCounters(states); builder.withOpTypeCounters(opTypeCounters); Stat node = zooReaderWriter.getZooKeeper().exists(fateRootPath, false); builder.withZkFateChildOpsTotal(node.getCversion()); if (log.isTraceEnabled()) { log.trace( "ZkNodeStat: {czxid: {}, mzxid: {}, pzxid: {}, ctime: {}, mtime: {}, " + "version: {}, cversion: {}, num children: {}", node.getCzxid(), node.getMzxid(), node.getPzxid(), node.getCtime(), node.getMtime(), node.getVersion(), node.getCversion(), node.getNumChildren()); } } catch (KeeperException ex) { log.debug("Error connecting to ZooKeeper", ex); builder.incrZkConnectionErrors(); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } return builder.build(); }</code><technical_language>completely sure, I this written java states.merge(stateName, 1L, Long::sum);</technical_language>

Target:
private FateMetricValues updateFromZookeeper() { FateMetricValues.Builder builder = FateMetricValues.builder(); AdminUtil<FateMetrics> admin = new AdminUtil<>(false); try { List<AdminUtil.TransactionStatus> currFates = admin.getTransactionStatus(zooStore, null, null); builder.withCurrentFateOps(currFates.size()); Map<String,Long> states = new TreeMap<>(); for (ReadOnlyTStore.TStatus t : ReadOnlyTStore.TStatus.values()) { states.put(t.name(), 0L); } Map<String,Long> opTypeCounters = new TreeMap<>(); for (AdminUtil.TransactionStatus tx : currFates) { String stateName = tx.getStatus().name(); states.merge(stateName, 1L, Long::sum); if (ReadOnlyTStore.TStatus.IN_PROGRESS.equals(tx.getStatus())) { String opType = tx.getDebug(); if (opType == null || opType.isEmpty()) { opType = "UNKNOWN"; } opTypeCounters.merge(opType, 1L, Long::sum); } } builder.withTxStateCounters(states); builder.withOpTypeCounters(opTypeCounters); Stat node = zooReaderWriter.getZooKeeper().exists(fateRootPath, false); builder.withZkFateChildOpsTotal(node.getCversion()); if (log.isTraceEnabled()) { log.trace( "ZkNodeStat: {czxid: {}, mzxid: {}, pzxid: {}, ctime: {}, mtime: {}, " + "version: {}, cversion: {}, num children: {}", node.getCzxid(), node.getMzxid(), node.getPzxid(), node.getCtime(), node.getMtime(), node.getVersion(), node.getCversion(), node.getNumChildren()); } } catch (KeeperException ex) { log.debug("Error connecting to ZooKeeper", ex); builder.incrZkConnectionErrors(); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } return builder.build(); }