本文整理汇总了Java中org.apache.accumulo.core.client.ConditionalWriter.Status.ACCEPTED属性的典型用法代码示例。如果您正苦于以下问题:Java Status.ACCEPTED属性的具体用法?Java Status.ACCEPTED怎么用?Java Status.ACCEPTED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.accumulo.core.client.ConditionalWriter.Status
的用法示例。
在下文中一共展示了Status.ACCEPTED属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processResults
@Override
public boolean processResults(CommitData cd, Iterator<Result> results) throws Exception {
while (results.hasNext()) {
Result result = results.next();
// TODO handle unknown?
Bytes row = Bytes.of(result.getMutation().getRow());
if (result.getStatus() == Status.ACCEPTED) {
cd.acceptedRows.add(row);
} else {
cd.addToRejected(row, updates.get(row).keySet());
}
}
return cd.getRejected().size() == 0;
}
示例2: handleUnknown
@Override
public Iterator<Result> handleUnknown(CommitData cd, Iterator<Result> results)
throws Exception {
// the code for handing this is synchronous and needs to be handled in another thread pool
// TODO - how do we do the above without return a CF?
long commitTs = getStats().getCommitTs();
Result result = Iterators.getOnlyElement(results);
Status ms = result.getStatus();
while (ms == Status.UNKNOWN) {
// TODO async
TxInfo txInfo = TxInfo.getTransactionInfo(env, cd.prow, cd.pcol, startTs);
switch (txInfo.status) {
case COMMITTED:
if (txInfo.commitTs != commitTs) {
throw new IllegalStateException(
cd.prow + " " + cd.pcol + " " + txInfo.commitTs + "!=" + commitTs);
}
ms = Status.ACCEPTED;
break;
case LOCKED:
// TODO async
ConditionalMutation delLockMutation = result.getMutation();
ms = cd.cw.write(delLockMutation).getStatus();
break;
default:
ms = Status.REJECTED;
}
}
Result newResult = new Result(ms, result.getMutation(), result.getTabletServer());
return Collections.singletonList(newResult).iterator();
}