} catch (Exception e) {
throw new LumifyException("failed to initialize counter for " + userId);
}
try {
AtomicValue<Integer> count = direction == Direction.INCREMENT ? distributedAtomicInteger.increment() : distributedAtomicInteger.decrement();
if (count.succeeded()) {
return count.postValue();
} else {
throw new LumifyException("failed to " + direction + " counter for " + userId);
}