Attempts to read the current value of the long.
Tries to decrement the value by 'n' and return the new value.
Tries to decrement the value by 'n' and return the new value.
The value to decrement with.
Tries to decrement the counter by one and return the new value.
Tries to increment the value by 'n' and return the new value.
Tries to increment the value by 'n' and return the new value.
The value to increment with.
Tries to increment the counter by one and return the new value.
(Since version ) see corresponding Javadoc for more information.
Implements atomic distributed Long using optimistic locking mechanism. The principle of changing the persisted counter/long value is to: 1) read the value from Consul including the latest ModificationIndex. 2) store the updated value to Consul using compare-and-set with the read ModificationIndex. Should the write fail due to concurrency issues, we loop back to step 1 and try again. Generally all operations will fail if there is no such key/path or the key doesn't have a numerical value.