Java 类org.apache.zookeeper.proto.ErrorResponse 实例源码

项目:fuck_zookeeper    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:https-github.com-apache-zookeeper    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.create2:
                OpResult.CreateResult createResult = (OpResult.CreateResult) result;
                new Create2Response(createResult.getPath(),
                        createResult.getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:ZooKeeper    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:StreamProcessingInfrastructure    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:bigstreams    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:zookeeper-src-learning    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:zookeeper    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:SecureKeeper    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.create2:
                OpResult.CreateResult createResult = (OpResult.CreateResult) result;
                new Create2Response(createResult.getPath(),
                        createResult.getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:SecureKeeper    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.create2:
                OpResult.CreateResult createResult = (OpResult.CreateResult) result;
                new Create2Response(createResult.getPath(),
                        createResult.getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:StreamBench    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:ACaZoo    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:LoadBalanced_zk    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:LoadBalanced_zk    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:zookeeper-pkg    文件:MultiResponse.java   
@Override
public void serialize(OutputArchive archive, String tag) throws IOException {
    archive.startRecord(this, tag);

    int index = 0;
    for (OpResult result : results) {
        int err = result.getType() == ZooDefs.OpCode.error ? ((OpResult.ErrorResult)result).getErr() : 0;

        new MultiHeader(result.getType(), false, err).serialize(archive, tag);

        switch (result.getType()) {
            case ZooDefs.OpCode.create:
                new CreateResponse(((OpResult.CreateResult) result).getPath()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.delete:
            case ZooDefs.OpCode.check:
                break;
            case ZooDefs.OpCode.setData:
                new SetDataResponse(((OpResult.SetDataResult) result).getStat()).serialize(archive, tag);
                break;
            case ZooDefs.OpCode.error:
                new ErrorResponse(((OpResult.ErrorResult) result).getErr()).serialize(archive, tag);
                break;
            default:
                throw new IOException("Invalid type " + result.getType() + " in MultiResponse");
        }
    }
    new MultiHeader(-1, true, -1).serialize(archive, tag);
    archive.endRecord(this, tag);
}
项目:fuck_zookeeper    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:https-github.com-apache-zookeeper    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.create2:
                Create2Response cr2 = new Create2Response();
                cr2.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr2.getPath(), cr2.getStat()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:ZooKeeper    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:StreamProcessingInfrastructure    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:bigstreams    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:zookeeper-src-learning    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:zookeeper    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:SecureKeeper    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.create2:
                Create2Response cr2 = new Create2Response();
                cr2.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr2.getPath(), cr2.getStat()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:SecureKeeper    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.create2:
                Create2Response cr2 = new Create2Response();
                cr2.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr2.getPath(), cr2.getStat()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:StreamBench    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:ACaZoo    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:LoadBalanced_zk    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:LoadBalanced_zk    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
项目:zookeeper-lite    文件:IErrorResponse.java   
public IErrorResponse() {
    this(new ErrorResponse());
}
项目:zookeeper-lite    文件:IErrorResponse.java   
public IErrorResponse(int err) {
    this(new ErrorResponse(err));
}
项目:zookeeper-lite    文件:IErrorResponse.java   
public IErrorResponse(ErrorResponse record) {
    super(record);
}
项目:zookeeper-pkg    文件:MultiResponse.java   
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    results = new ArrayList<OpResult>();

    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);
    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
                CreateResponse cr = new CreateResponse();
                cr.deserialize(archive, tag);
                results.add(new OpResult.CreateResult(cr.getPath()));
                break;

            case ZooDefs.OpCode.delete:
                results.add(new OpResult.DeleteResult());
                break;

            case ZooDefs.OpCode.setData:
                SetDataResponse sdr = new SetDataResponse();
                sdr.deserialize(archive, tag);
                results.add(new OpResult.SetDataResult(sdr.getStat()));
                break;

            case ZooDefs.OpCode.check:
                results.add(new OpResult.CheckResult());
                break;

            case ZooDefs.OpCode.error:
                //FIXME: need way to more cleanly serialize/deserialize exceptions
                ErrorResponse er = new ErrorResponse();
                er.deserialize(archive, tag);
                results.add(new OpResult.ErrorResult(er.getErr()));
                break;

            default:
                throw new IOException("Invalid type " + h.getType() + " in MultiResponse");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}