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


Java InputArchive.endRecord方法代码示例

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


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

示例1: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
public void deserialize(InputArchive archive, String tag)
        throws IOException {
    archive.startRecord("node");
    data = archive.readBuffer("data");
    Index i = archive.startVector("acl");
    if (i != null) {
        acl = new ArrayList<ACL>();
        while (!i.done()) {
            ACL a = new ACL();
            a.deserialize(archive, "aclEntry");
            acl.add(a);
            i.incr();
        }
    }
    archive.endVector("acl");
    stat = new StatPersistedV1();
    stat.deserialize(archive, "stat");
    archive.endRecord("node");
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:20,代码来源:DataNodeV1.java

示例2: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
synchronized public void deserialize(InputArchive archive, String tag)
        throws IOException {
    archive.startRecord("node");
    data = archive.readBuffer("data");
    acl = archive.readLong("acl");
    stat = new StatPersisted();
    stat.deserialize(archive, "statpersisted");
    archive.endRecord("node");
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:10,代码来源:DataNode.java

示例3: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);

    while (!h.getDone()) {
        switch (h.getType()) {
           case ZooDefs.OpCode.create:
                CreateRequest cr = new CreateRequest();
                cr.deserialize(archive, tag);
                add(Op.create(cr.getPath(), cr.getData(), cr.getAcl(), cr.getFlags()));
                break;
            case ZooDefs.OpCode.delete:
                DeleteRequest dr = new DeleteRequest();
                dr.deserialize(archive, tag);
                add(Op.delete(dr.getPath(), dr.getVersion()));
                break;
            case ZooDefs.OpCode.setData:
                SetDataRequest sdr = new SetDataRequest();
                sdr.deserialize(archive, tag);
                add(Op.setData(sdr.getPath(), sdr.getData(), sdr.getVersion()));
                break;
            case ZooDefs.OpCode.check:
                CheckVersionRequest cvr = new CheckVersionRequest();
                cvr.deserialize(archive, tag);
                add(Op.check(cvr.getPath(), cvr.getVersion()));
                break;
            default:
                throw new IOException("Invalid type of op");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:36,代码来源:MultiTransactionRecord.java

示例4: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);

    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
            case ZooDefs.OpCode.create2:
            case ZooDefs.OpCode.createContainer:
                CreateRequest cr = new CreateRequest();
                cr.deserialize(archive, tag);
                add(Op.create(cr.getPath(), cr.getData(), cr.getAcl(), cr.getFlags()));
                break;
            case ZooDefs.OpCode.delete:
                DeleteRequest dr = new DeleteRequest();
                dr.deserialize(archive, tag);
                add(Op.delete(dr.getPath(), dr.getVersion()));
                break;
            case ZooDefs.OpCode.setData:
                SetDataRequest sdr = new SetDataRequest();
                sdr.deserialize(archive, tag);
                add(Op.setData(sdr.getPath(), sdr.getData(), sdr.getVersion()));
                break;
            case ZooDefs.OpCode.check:
                CheckVersionRequest cvr = new CheckVersionRequest();
                cvr.deserialize(archive, tag);
                add(Op.check(cvr.getPath(), cvr.getVersion()));
                break;
            default:
                throw new IOException("Invalid type of op");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
 
开发者ID:sereca,项目名称:SecureKeeper,代码行数:38,代码来源:MultiTransactionRecord.java

示例5: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
public void deserialize(InputArchive a_, String tag) throws java.io.IOException {
    a_.startRecord(tag);
    perms = a_.readInt("perms");
    id = new org.apache.zookeeper.data.Id();
    a_.readRecord(id, "id");
    a_.endRecord(tag);
}
 
开发者ID:blentle,项目名称:zookeeper-src-learning,代码行数:8,代码来源:ACL.java

示例6: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
synchronized public void deserialize(InputArchive archive, String tag)
        throws IOException {
    archive.startRecord("node");
    // 节点数据
    data = archive.readBuffer("data");
    // 节点acl
    acl = archive.readLong("acl");
    stat = new StatPersisted();
    // 反序列化节点stat
    stat.deserialize(archive, "statpersisted");
    archive.endRecord("node");
}
 
开发者ID:txazo,项目名称:zookeeper,代码行数:13,代码来源:DataNode.java

示例7: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
@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);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:44,代码来源:MultiResponse.java

示例8: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
@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);
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:50,代码来源:MultiResponse.java

示例9: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
@Override
public void deserialize(InputArchive archive, String tag) throws IOException {
    archive.startRecord(tag);
    MultiHeader h = new MultiHeader();
    h.deserialize(archive, tag);

    while (!h.getDone()) {
        switch (h.getType()) {
            case ZooDefs.OpCode.create:
            case ZooDefs.OpCode.create2:
            case ZooDefs.OpCode.createContainer:
                CreateRequest cr = new CreateRequest();
                cr.deserialize(archive, tag);
                add(Op.create(cr.getPath(), cr.getData(), cr.getAcl(), cr.getFlags()));
                break;
            case ZooDefs.OpCode.createTTL:
                CreateTTLRequest crTtl = new CreateTTLRequest();
                crTtl.deserialize(archive, tag);
                add(Op.create(crTtl.getPath(), crTtl.getData(), crTtl.getAcl(), crTtl.getFlags(), crTtl.getTtl()));
                break;
            case ZooDefs.OpCode.delete:
                DeleteRequest dr = new DeleteRequest();
                dr.deserialize(archive, tag);
                add(Op.delete(dr.getPath(), dr.getVersion()));
                break;
            case ZooDefs.OpCode.setData:
                SetDataRequest sdr = new SetDataRequest();
                sdr.deserialize(archive, tag);
                add(Op.setData(sdr.getPath(), sdr.getData(), sdr.getVersion()));
                break;
            case ZooDefs.OpCode.check:
                CheckVersionRequest cvr = new CheckVersionRequest();
                cvr.deserialize(archive, tag);
                add(Op.check(cvr.getPath(), cvr.getVersion()));
                break;
            default:
                throw new IOException("Invalid type of op");
        }
        h.deserialize(archive, tag);
    }
    archive.endRecord(tag);
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:43,代码来源:MultiTransactionRecord.java


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