keith-turner commented on code in PR #4160:
URL: https://github.com/apache/accumulo/pull/4160#discussion_r1468246449
##########
core/src/main/java/org/apache/accumulo/core/fate/accumulo/AccumuloStore.java:
##########
@@ -70,7 +70,8 @@ public AccumuloStore(ClientContext context) {
public long create() {
long tid = RANDOM.get().nextLong() & 0x7fffffffffffffffL;
-
newMutator(tid).putStatus(TStatus.NEW).putCreateTime(System.currentTimeMillis()).mutate();
+
newMutator(tid).requireStatus().putStatus(TStatus.NEW).putCreateTime(System.currentTimeMillis())
Review Comment:
I experimented with making mutate() return something, but that seemed a bit
dangerous as it would be easy to ignore the return value. Realized maybe
adding a new `tryMutate()` method might be good because the prefix `try`
implies a return value, this is following some of the methods in the java api
that have a `try` prefix. Below is the commit where I experimented with this.
https://github.com/keith-turner/accumulo/commit/f70f6bc65a879515bc803358d5219cafbb90ec57
It also adds a new enum because we only want to handle a subset of the
statuses that conditional writer can return.
--
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]