當前位置: 首頁>>代碼示例>>Java>>正文


Java Status.ACCEPTED屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:fluo,代碼行數:16,代碼來源:TransactionImpl.java

示例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();
}
 
開發者ID:apache,項目名稱:fluo,代碼行數:34,代碼來源:TransactionImpl.java


注:本文中的org.apache.accumulo.core.client.ConditionalWriter.Status.ACCEPTED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。