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


Java Code.NONODE屬性代碼示例

本文整理匯總了Java中org.apache.zookeeper.KeeperException.Code.NONODE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Code.NONODE屬性的具體用法?Java Code.NONODE怎麽用?Java Code.NONODE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.zookeeper.KeeperException.Code的用法示例。


在下文中一共展示了Code.NONODE屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: verifyCreateFailure_NoNode

public void verifyCreateFailure_NoNode() {

            rc = Code.NONODE;
            name = null;
            path = path + "/bar";
            zk.create(path, data, acl, flags, this, toString());

            verify();
        }
 
開發者ID:maoling,項目名稱:fuck_zookeeper,代碼行數:9,代碼來源:AsyncOps.java

示例2: verifyGetACLFailure_NoNode

public void verifyGetACLFailure_NoNode(){
    rc = Code.NONODE;
    stat = null;
    acl = null;
    zk.getACL(path, stat, this, toString());

    verify();
}
 
開發者ID:maoling,項目名稱:fuck_zookeeper,代碼行數:8,代碼來源:AsyncOps.java

示例3: runWithRetries

T runWithRetries() throws Exception {
  int retry = 0;
  while (true) {
    try {
      return runWithCheck();
    } catch (KeeperException.NoAuthException nae) {
      if (HAUtil.isHAEnabled(getConfig())) {
        // NoAuthException possibly means that this store is fenced due to
        // another RM becoming active. Even if not,
        // it is safer to assume we have been fenced
        throw new StoreFencedException();
      }
    } catch (KeeperException ke) {
      if (ke.code() == Code.NODEEXISTS) {
        LOG.info("znode already exists!");
        return null;
      }
      if (hasDeleteNodeOp && ke.code() == Code.NONODE) {
        LOG.info("znode has already been deleted!");
        return null;
      }

      LOG.info("Exception while executing a ZK operation.", ke);
      if (shouldRetry(ke.code()) && ++retry < numRetries) {
        LOG.info("Retrying operation on ZK. Retry no. " + retry);
        Thread.sleep(zkRetryInterval);
        createConnection();
        continue;
      }
      LOG.info("Maxed out ZK retries. Giving up!");
      throw ke;
    }
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:34,代碼來源:ZKRMStateStore.java

示例4: isNodeDoesNotExist

private static boolean isNodeDoesNotExist(Code code) {
  return (code == Code.NONODE);
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:3,代碼來源:ActiveStandbyElector.java

示例5: processTxn

@SuppressWarnings("unchecked")
public ProcessTxnResult processTxn(TxnHeader header, Record txn) {
    ProcessTxnResult rc = new ProcessTxnResult();

    String debug = "";
    try {
        rc.clientId = header.getClientId();
        rc.cxid = header.getCxid();
        rc.zxid = header.getZxid();
        rc.type = header.getType();
        rc.err = 0;
        if (rc.zxid > lastProcessedZxid) {
            lastProcessedZxid = rc.zxid;
        }
        switch (header.getType()) {
        case OpCode.create:
            CreateTxn createTxn = (CreateTxn) txn;
            debug = "Create transaction for " + createTxn.getPath();
            createNode(createTxn.getPath(), createTxn.getData(), createTxn
                    .getAcl(), createTxn.getEphemeral() ? header
                    .getClientId() : 0, header.getZxid(), header.getTime());
            rc.path = createTxn.getPath();
            break;
        case OpCode.delete:
            DeleteTxn deleteTxn = (DeleteTxn) txn;
            debug = "Delete transaction for " + deleteTxn.getPath();
            deleteNode(deleteTxn.getPath());
            break;
        case OpCode.setData:
            SetDataTxn setDataTxn = (SetDataTxn) txn;
            debug = "Set data for  transaction for " + setDataTxn.getPath();
            rc.stat = setData(setDataTxn.getPath(), setDataTxn.getData(),
                    setDataTxn.getVersion(), header.getZxid(), header
                            .getTime());
            break;
        case OpCode.setACL:
            SetACLTxn setACLTxn = (SetACLTxn) txn;
            debug = "Set ACL for  transaction for " + setACLTxn.getPath();
            rc.stat = setACL(setACLTxn.getPath(), setACLTxn.getAcl(),
                    setACLTxn.getVersion());
            break;
        case OpCode.closeSession:
            killSession(header.getClientId());
            break;
        case OpCode.error:
            ErrorTxn errTxn = (ErrorTxn) txn;
            rc.err = errTxn.getErr();
            break;
        }
    } catch (KeeperException e) {
        // These are expected errors since we take a lazy snapshot
        if (initialized
                || (e.code() != Code.NONODE 
                        && e.code() != Code.NODEEXISTS)) {
            LOG.warn("Failed:" + debug, e);
        }
    }
    return rc;
}
 
開發者ID:maoling,項目名稱:fuck_zookeeper,代碼行數:59,代碼來源:DataTreeV1.java

示例6: verifyDeleteFailure_NoNode

public void verifyDeleteFailure_NoNode() {
    rc = Code.NONODE;
    zk.delete(path, version, this, toString());
    verify();
}
 
開發者ID:maoling,項目名稱:fuck_zookeeper,代碼行數:5,代碼來源:AsyncOps.java


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