public void save(final K key, final V value, final boolean isNew) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.finer(loggerProlog + "sending for replication [key=" + key + ", value=" + value + ", isNew=" + isNew + "]");
}
HaInfo haInfo = HaContext.currentHaInfo();
if (haInfo != null) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.finer(loggerProlog + "Existing HaInfo found, using it for data replication: " + HaContext.asString(haInfo));
}
HaContext.udpateReplicaInstance(HighAvailabilityProvider.saveTo(backingStore, new StickyKey(key, haInfo.getKey()), value, isNew));
} else {
final StickyKey stickyKey = new StickyKey(key);
final String replicaId = HighAvailabilityProvider.saveTo(backingStore, stickyKey, value, isNew);
haInfo = new HaInfo(stickyKey.getHashKey(), replicaId, false);
HaContext.updateHaInfo(haInfo);
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.finer(loggerProlog + "No HaInfo found, created new after data replication: " + HaContext.asString(haInfo));
}
}