当前位置: 首页>>代码示例>>Java>>正文


Java OpCode.error方法代码示例

本文整理汇总了Java中org.apache.zookeeper.ZooDefs.OpCode.error方法的典型用法代码示例。如果您正苦于以下问题:Java OpCode.error方法的具体用法?Java OpCode.error怎么用?Java OpCode.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.zookeeper.ZooDefs.OpCode的用法示例。


在下文中一共展示了OpCode.error方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isQuorum

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
static boolean isQuorum(int type) {
    switch (type) {
    case OpCode.exists:
    case OpCode.getACL:
    case OpCode.getChildren:
    case OpCode.getChildren2:
    case OpCode.getData:
        return false;
    case OpCode.error:
    case OpCode.closeSession:
    case OpCode.create:
    case OpCode.createSession:
    case OpCode.delete:
    case OpCode.setACL:
    case OpCode.setData:
    case OpCode.check:
    case OpCode.multi:
        return true;
    default:
        return false;
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:23,代码来源:Request.java

示例2: op2String

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
static String op2String(int op) {
    switch (op) {
    case OpCode.notification:
        return "notification";
    case OpCode.create:
        return "create";
    case OpCode.delete:
        return "delete";
    case OpCode.exists:
        return "exists";
    case OpCode.getData:
        return "getDate";
    case OpCode.setData:
        return "setData";
    case OpCode.multi:
        return "multi";
    case OpCode.getACL:
        return "getACL";
    case OpCode.setACL:
        return "setACL";
    case OpCode.getChildren:
        return "getChildren";
    case OpCode.getChildren2:
        return "getChildren2";
    case OpCode.ping:
        return "ping";
    case OpCode.createSession:
        return "createSession";
    case OpCode.closeSession:
        return "closeSession";
    case OpCode.error:
        return "error";
    default:
        return "unknown " + op;
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:37,代码来源:TraceFormatter.java

示例3: isQuorum

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
public boolean isQuorum() {
    switch (this.type) {
    case OpCode.exists:
    case OpCode.getACL:
    case OpCode.getChildren:
    case OpCode.getChildren2:
    case OpCode.getData:
        return false;
    case OpCode.create:
    case OpCode.create2:
    case OpCode.createTTL:
    case OpCode.createContainer:
    case OpCode.error:
    case OpCode.delete:
    case OpCode.deleteContainer:
    case OpCode.setACL:
    case OpCode.setData:
    case OpCode.check:
    case OpCode.multi:
    case OpCode.reconfig:
        return true;
    case OpCode.closeSession:
    case OpCode.createSession:
        return !this.isLocalSession;
    default:
        return false;
    }
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:29,代码来源:Request.java

示例4: isWriteRequest

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
private static boolean isWriteRequest(int opCode) {
    switch (opCode) {
    case OpCode.create:
    case OpCode.delete:
    case OpCode.setData:
    case OpCode.setACL:
    case OpCode.sync:
    case OpCode.createSession:
    case OpCode.closeSession:
        return true;

    case OpCode.notification:
    case OpCode.exists:
    case OpCode.getData:
    case OpCode.getACL:
    case OpCode.getChildren:
    case OpCode.ping:
    case OpCode.getChildren2:
    case OpCode.check:
    case OpCode.multi:
    case OpCode.auth:
    case OpCode.setWatches:
    case OpCode.sasl:
    case OpCode.error:
    default:
        return false;
    }
}
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:29,代码来源:FinalRequestProcessorAspect.java

示例5: op2String

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
static String op2String(int op) {
    switch (op) {
    case OpCode.notification:
        return "notification";
    case OpCode.create:
        return "create";
    case OpCode.delete:
        return "delete";
    case OpCode.exists:
        return "exists";
    case OpCode.getData:
        return "getDate";
    case OpCode.setData:
        return "setData";
    case OpCode.getACL:
        return "getACL";
    case OpCode.setACL:
        return "setACL";
    case OpCode.getChildren:
        return "getChildren";
    case OpCode.getChildren2:
        return "getChildren2";
    case OpCode.ping:
        return "ping";
    case OpCode.createSession:
        return "createSession";
    case OpCode.closeSession:
        return "closeSession";
    case OpCode.error:
        return "error";
    default:
        return "unknown " + op;
    }
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:35,代码来源:TraceFormatter.java

示例6: isQuorum

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
public boolean isQuorum() {
    switch (this.type) {
    case OpCode.exists:
    case OpCode.getACL:
    case OpCode.getChildren:
    case OpCode.getChildren2:
    case OpCode.getData:
        return false;
    case OpCode.create:
    case OpCode.create2:
    case OpCode.createContainer:
    case OpCode.error:
    case OpCode.delete:
    case OpCode.deleteContainer:
    case OpCode.setACL:
    case OpCode.setData:
    case OpCode.check:
    case OpCode.multi:
    case OpCode.reconfig:
        return true;
    case OpCode.closeSession:
    case OpCode.createSession:
        return !this.isLocalSession;
    default:
        return false;
    }
}
 
开发者ID:sereca,项目名称:SecureKeeper,代码行数:28,代码来源:Request.java

示例7: processTxn

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
@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,代码行数:60,代码来源:DataTreeV1.java

示例8: op2String

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
static String op2String(int op) {
    switch (op) {
    case OpCode.notification:
        return "notification";
    case OpCode.create:
        return "create";
    case OpCode.setWatches:
        return "setWatches";
    case OpCode.delete:
        return "delete";
    case OpCode.exists:
        return "exists";
    case OpCode.getData:
        return "getData";
    case OpCode.check:
        return "check";
    case OpCode.multi:
        return "multi";
    case OpCode.setData:
        return "setData";
    case OpCode.sync:
          return "sync:";
    case OpCode.getACL:
        return "getACL";
    case OpCode.setACL:
        return "setACL";
    case OpCode.getChildren:
        return "getChildren";
    case OpCode.getChildren2:
        return "getChildren2";
    case OpCode.ping:
        return "ping";
    case OpCode.createSession:
        return "createSession";
    case OpCode.closeSession:
        return "closeSession";
    case OpCode.error:
        return "error";
    default:
        return "unknown " + op;
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:43,代码来源:Request.java

示例9: op2String

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
public static String op2String(int op) {
    switch (op) {
    case OpCode.notification:
        return "notification";
    case OpCode.create:
        return "create";
    case OpCode.create2:
        return "create2";
    case OpCode.createTTL:
        return "createTtl";
    case OpCode.createContainer:
        return "createContainer";
    case OpCode.delete:
        return "delete";
    case OpCode.deleteContainer:
        return "deleteContainer";
    case OpCode.exists:
        return "exists";
    case OpCode.getData:
        return "getDate";
    case OpCode.setData:
        return "setData";
    case OpCode.multi:
        return "multi";
    case OpCode.getACL:
        return "getACL";
    case OpCode.setACL:
        return "setACL";
    case OpCode.getChildren:
        return "getChildren";
    case OpCode.getChildren2:
        return "getChildren2";
    case OpCode.ping:
        return "ping";
    case OpCode.createSession:
        return "createSession";
    case OpCode.closeSession:
        return "closeSession";
    case OpCode.error:
        return "error";
    case OpCode.reconfig:
       return "reconfig";
    default:
        return "unknown " + op;
    }
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:47,代码来源:TraceFormatter.java

示例10: op2String

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
static String op2String(int op) {
    switch (op) {
    case OpCode.notification:
        return "notification";
    case OpCode.create:
        return "create";
    case OpCode.create2:
        return "create2";
    case OpCode.createTTL:
        return "createTtl";
    case OpCode.createContainer:
        return "createContainer";
    case OpCode.setWatches:
        return "setWatches";
    case OpCode.delete:
        return "delete";
    case OpCode.deleteContainer:
        return "deleteContainer";
    case OpCode.exists:
        return "exists";
    case OpCode.getData:
        return "getData";
    case OpCode.check:
        return "check";
    case OpCode.multi:
        return "multi";
    case OpCode.setData:
        return "setData";
    case OpCode.sync:
          return "sync:";
    case OpCode.getACL:
        return "getACL";
    case OpCode.setACL:
        return "setACL";
    case OpCode.getChildren:
        return "getChildren";
    case OpCode.getChildren2:
        return "getChildren2";
    case OpCode.ping:
        return "ping";
    case OpCode.createSession:
        return "createSession";
    case OpCode.closeSession:
        return "closeSession";
    case OpCode.error:
        return "error";
    case OpCode.reconfig:
       return "reconfig";
    case OpCode.checkWatches:
        return "checkWatches";
    case OpCode.removeWatches:
        return "removeWatches";
    default:
        return "unknown " + op;
    }
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:57,代码来源:Request.java

示例11: op2String

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
public static String op2String(int op) {
    switch (op) {
    case OpCode.notification:
        return "notification";
    case OpCode.create:
        return "create";
    case OpCode.create2:
        return "create2";
    case OpCode.createContainer:
        return "createContainer";
    case OpCode.delete:
        return "delete";
    case OpCode.deleteContainer:
        return "deleteContainer";
    case OpCode.exists:
        return "exists";
    case OpCode.getData:
        return "getDate";
    case OpCode.setData:
        return "setData";
    case OpCode.multi:
        return "multi";
    case OpCode.getACL:
        return "getACL";
    case OpCode.setACL:
        return "setACL";
    case OpCode.getChildren:
        return "getChildren";
    case OpCode.getChildren2:
        return "getChildren2";
    case OpCode.ping:
        return "ping";
    case OpCode.createSession:
        return "createSession";
    case OpCode.closeSession:
        return "closeSession";
    case OpCode.error:
        return "error";
    case OpCode.reconfig:
       return "reconfig";
    default:
        return "unknown " + op;
    }
}
 
开发者ID:sereca,项目名称:SecureKeeper,代码行数:45,代码来源:TraceFormatter.java

示例12: processTxn

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
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();
                rc.path = createTxn.getPath();
                createNode(
                        createTxn.getPath(),
                        createTxn.getData(),
                        createTxn.getAcl(),
                        createTxn.getEphemeral() ? header.getClientId() : 0,
                        createTxn.getParentCVersion(),
                        header.getZxid(), header.getTime());
                break;
            case OpCode.delete:
                DeleteTxn deleteTxn = (DeleteTxn) txn;
                debug = "Delete transaction for " + deleteTxn.getPath();
                rc.path = deleteTxn.getPath();
                deleteNode(deleteTxn.getPath(), header.getZxid());
                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(), header.getZxid());
                break;
            case OpCode.error:
                ErrorTxn errTxn = (ErrorTxn) txn;
                rc.err = errTxn.getErr();
                break;
        }
    } catch (KeeperException e) {
         LOG.debug("Failed: " + debug, e);
         rc.err = e.code().intValue();
    }
    return rc;
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:62,代码来源:DataTree.java

示例13: op2String

import org.apache.zookeeper.ZooDefs.OpCode; //导入方法依赖的package包/类
static String op2String(int op) {
    switch (op) {
    case OpCode.notification:
        return "notification";
    case OpCode.create:
        return "create";
    case OpCode.create2:
        return "create2";
    case OpCode.createContainer:
        return "createContainer";
    case OpCode.setWatches:
        return "setWatches";
    case OpCode.delete:
        return "delete";
    case OpCode.deleteContainer:
        return "deleteContainer";
    case OpCode.exists:
        return "exists";
    case OpCode.getData:
        return "getData";
    case OpCode.check:
        return "check";
    case OpCode.multi:
        return "multi";
    case OpCode.setData:
        return "setData";
    case OpCode.sync:
          return "sync:";
    case OpCode.getACL:
        return "getACL";
    case OpCode.setACL:
        return "setACL";
    case OpCode.getChildren:
        return "getChildren";
    case OpCode.getChildren2:
        return "getChildren2";
    case OpCode.ping:
        return "ping";
    case OpCode.createSession:
        return "createSession";
    case OpCode.closeSession:
        return "closeSession";
    case OpCode.error:
        return "error";
    case OpCode.reconfig:
       return "reconfig";
    case OpCode.checkWatches:
        return "checkWatches";
    case OpCode.removeWatches:
        return "removeWatches";
    default:
        return "unknown " + op;
    }
}
 
开发者ID:sereca,项目名称:SecureKeeper,代码行数:55,代码来源:Request.java


注:本文中的org.apache.zookeeper.ZooDefs.OpCode.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。