Source:
public void apply(final LoadingCache<EncodedKey<K>, Wrapped<V>> kvCache) { final long pushStartTime = ticker.read(); final Wrapped<V> wrapped = kvCache.getIfPresent(encodedKey); if (wrapped != null) { final V oldValue = wrapped.getValue(); final V deltaValue = parameterUpdater.process(encodedKey.getKey(), preValue); if (deltaValue == null) { return; } final V updatedValue = parameterUpdater.update(oldValue, deltaValue); wrapped.setValue(updatedValue); } int resendCount = 0; while (true) { if (resendCount++ > MAX_RESEND_COUNT) { throw new RuntimeException("Fail to send a push message"); } final String serverId = serverResolver.resolveServer(encodedKey.getHash()); LOG.log(Level.FINEST, "Resolve server for encodedKey. key: {0}, hash: {1}", new Object[]{encodedKey.getKey(), encodedKey.getHash()}); try { final long encodeStartTime = ticker.read(); sender.get().sendPushMsg(serverId, encodedKey, preValue); final long endTime = ticker.read(); pushStats[threadId].put(endTime - pushStartTime); encodeStats[threadId].put(endTime - encodeStartTime); final long elapsedTime = endTime - startTimes[threadId]; if (logPeriod > 0 && elapsedTime > logPeriod) { printStatistics(threadId, elapsedTime); } break; } catch (final NetworkException e) { LOG.log(Level.FINE, "NetworkException while sending push msg. Do retry", e); } LOG.log(Level.INFO, "Wait {0} ms before resending a push msg", RESEND_INTERVAL_MS); try { Thread.sleep(RESEND_INTERVAL_MS); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while waiting for routing table to be updated", e); } } }

Target:
public void apply(final LoadingCache<EncodedKey<K>, Wrapped<V>> kvCache) { final long pushStartTime = ticker.read(); final Wrapped<V> wrapped = kvCache.getIfPresent(encodedKey); if (wrapped != null) { final V oldValue = wrapped.getValue(); final V deltaValue = parameterUpdater.process(encodedKey.getKey(), preValue); if (deltaValue == null) { return; } final V updatedValue = parameterUpdater.update(oldValue, deltaValue); wrapped.setValue(updatedValue); } int resendCount = 0; while (true) { if (resendCount++ > MAX_RESEND_COUNT) { throw new RuntimeException("Fail to send a push message"); } final String serverId = serverResolver.resolveServer(encodedKey.getHash()); LOG.log(Level.FINEST, "Resolve server for encodedKey. key: {0}, hash: {1}, serverId: {2}", new Object[]{encodedKey.getKey(), encodedKey.getHash(), serverId}); try { final long encodeStartTime = ticker.read(); sender.get().sendPushMsg(serverId, encodedKey, preValue); final long endTime = ticker.read(); pushStats[threadId].put(endTime - pushStartTime); encodeStats[threadId].put(endTime - encodeStartTime); final long elapsedTime = endTime - startTimes[threadId]; if (logPeriod > 0 && elapsedTime > logPeriod) { printStatistics(threadId, elapsedTime); } break; } catch (final NetworkException e) { LOG.log(Level.FINE, "NetworkException while sending push msg. Do retry", e); } LOG.log(Level.FINE, "Wait {0} ms before resending a push msg", RESEND_INTERVAL_MS); try { Thread.sleep(RESEND_INTERVAL_MS); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while waiting for routing table to be updated", e); } } }