本文整理匯總了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();
}