@Override public void add( String nodeKey, String propertyName, T value ) { logger.trace("Adding node '{0}' to '{1}' index with value '{2}'", nodeKey, name, value); // Store the value of the next counter in the options map first so in the case of a failure we'll pick up at least from there long nextId = (long) options.compute(NEXT_COUNTER, (key, val) -> counter.incrementAndGet()); // then store the data in the index keysByValue.compute(new UniqueKey<T>(value, nextId), (key, val) -> nodeKey); }
@Override public void add( String nodeKey, String propertyName, T value ) { logger.trace("Adding node '{0}' to '{1}' index with value '{2}'", nodeKey, name, value); // Store the value of the next counter in the options map first so in the case of a failure we'll pick up at least from there long nextId = (long) options.compute(NEXT_COUNTER, (key, val) -> counter.incrementAndGet()); // then store the data in the index keysByValue.compute(new UniqueKey<T>(value, nextId), (key, val) -> nodeKey); }