dlmarion commented on a change in pull request #2324:
URL: https://github.com/apache/accumulo/pull/2324#discussion_r738480624
##########
File path:
core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
##########
@@ -124,6 +124,34 @@ public boolean putPersistentData(String zPath, byte[]
data, NodeExistsPolicy pol
e -> e.code() == Code.NONODE && policy == NodeExistsPolicy.OVERWRITE);
}
+ /**
+ * Overwrite a persistent node if the data version matches.
+ *
+ * @param zPath
+ * the zookeeper path
+ * @param data
+ * the byte array data
+ * @param expectedVersion
+ * the expected data version of the zookeeper node.
+ * @return true if the data was set, false if the version does not match
expected.
+ * @throws KeeperException
+ * if a KeeperException occurs (no node most likely)
+ * @throws InterruptedException
+ * if the zookeeper write is interrupted.
+ */
+ public boolean overwritePersistentData(String zPath, byte[] data, final int
expectedVersion)
Review comment:
It seems like you could add another overloaded method signature for
putPersistentData and achieve the same outcome.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]