Source:
<code>boolean commitPrimaryColumn(CommitData cd, long commitTs) throws AccumuloException, AccumuloSecurityException { IteratorSetting iterConf = new IteratorSetting(10, PrewriteIterator.class); PrewriteIterator.setSnaptime(iterConf, startTs); boolean isTrigger = cd.prow.equals(triggerRow) && cd.pcol.equals(triggerColumn); Condition lockCheck = new Condition(cd.pcol.getFamily().toArray(), cd.pcol.getQualifier().toArray()).setIterators(iterConf).setVisibility(cd.pcol.getVisibility()) .setValue(LockValue.encode(cd.prow, cd.pcol, cd.pval != null, cd.pval == DELETE, isTrigger, getTransactorID())); <START> ConditionalMutation delLockMutation = new ConditionalMutation(cd.prow.toArray(), lockCheck); <END> ColumnUtil.commitColumn(isTrigger, true, cd.pcol, cd.pval != null, cd.pval == DELETE, startTs, commitTs, observedColumns, delLockMutation); Status mutationStatus = cd.cw.write(delLockMutation).getStatus(); while (mutationStatus == Status.UNKNOWN) { MutableLong mcts = new MutableLong(-1); TxStatus txStatus = TxStatus.getTransactionStatus(config, cd.prow, cd.pcol, startTs, mcts, null); switch (txStatus) { case COMMITTED: if (mcts.longValue() != commitTs) throw new IllegalStateException(cd.prow + " " + cd.pcol + " " + mcts.longValue() + "!=" + commitTs); mutationStatus = Status.ACCEPTED; break; case LOCKED: mutationStatus = cd.cw.write(delLockMutation).getStatus(); break; default: mutationStatus = Status.REJECTED; } } if (mutationStatus != Status.ACCEPTED) { return false; } return true; }</code><technical_language>in places conditional mutations conditions created convert Bytes ByteSequence avoid copying array. if worth it</technical_language>

Target:
boolean commitPrimaryColumn(CommitData cd, long commitTs) throws AccumuloException, AccumuloSecurityException { IteratorSetting iterConf = new IteratorSetting(10, PrewriteIterator.class); PrewriteIterator.setSnaptime(iterConf, startTs); boolean isTrigger = cd.prow.equals(triggerRow) && cd.pcol.equals(triggerColumn); Condition lockCheck = new Condition(ByteUtil.toByteSequence(cd.pcol.getFamily()), ByteUtil.toByteSequence(cd.pcol.getQualifier())).setIterators(iterConf).setVisibility(cd.pcol.getVisibility()) .setValue(LockValue.encode(cd.prow, cd.pcol, cd.pval != null, cd.pval == DELETE, isTrigger, getTransactorID())); ConditionalMutation delLockMutation = new ConditionalMutation(ByteUtil.toByteSequence(cd.prow), lockCheck); ColumnUtil.commitColumn(isTrigger, true, cd.pcol, cd.pval != null, cd.pval == DELETE, startTs, commitTs, observedColumns, delLockMutation); Status mutationStatus = cd.cw.write(delLockMutation).getStatus(); while (mutationStatus == Status.UNKNOWN) { MutableLong mcts = new MutableLong(-1); TxStatus txStatus = TxStatus.getTransactionStatus(config, cd.prow, cd.pcol, startTs, mcts, null); switch (txStatus) { case COMMITTED: if (mcts.longValue() != commitTs) throw new IllegalStateException(cd.prow + " " + cd.pcol + " " + mcts.longValue() + "!=" + commitTs); mutationStatus = Status.ACCEPTED; break; case LOCKED: mutationStatus = cd.cw.write(delLockMutation).getStatus(); break; default: mutationStatus = Status.REJECTED; } } if (mutationStatus != Status.ACCEPTED) { return false; } return true; }