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


Java InputArchive.readRecord方法代码示例

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


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

示例1: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
public void deserialize(InputArchive ia, String tag) throws IOException {
    nodes.clear();
    String path = ia.readString("path");
    while (!path.equals("/")) {
        DataNodeV1 node = new DataNodeV1();
        ia.readRecord(node, "node");
        nodes.put(path, node);
        int lastSlash = path.lastIndexOf('/');
        if (lastSlash == -1) {
            root = node;
        } else {
            String parentPath = path.substring(0, lastSlash);
            node.parent = nodes.get(parentPath);
            node.parent.children.add(path.substring(lastSlash + 1));
            long eowner = node.stat.getEphemeralOwner();
            if (eowner != 0) {
                HashSet<String> list = ephemerals.get(eowner);
                if (list == null) {
                    list = new HashSet<String>();
                    ephemerals.put(eowner, list);
                }
                list.add(path);
            }
        }
        path = ia.readString("path");
    }
    nodes.put("/", root);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:29,代码来源:DataTreeV1.java

示例2: readPacketSkippingPing

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
static void readPacketSkippingPing(InputArchive ia, QuorumPacket qp) throws IOException {
    while(true) {
        ia.readRecord(qp, null);
        if (qp.getType() != Leader.PING) {
            return;
        }
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:9,代码来源:Zab1_0Test.java

示例3: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
public void deserialize(InputArchive ia, String tag) throws IOException {
    deserializeList(longKeyMap, ia);
    nodes.clear();
    String path = ia.readString("path");
    while (!path.equals("/")) {
        DataNode node = new DataNode();
        ia.readRecord(node, "node");
        nodes.put(path, node);
        int lastSlash = path.lastIndexOf('/');
        if (lastSlash == -1) {
            root = node;
        } else {
            String parentPath = path.substring(0, lastSlash);
            node.parent = nodes.get(parentPath);
            if (node.parent == null) {
                throw new IOException("Invalid Datatree, unable to find " +
                        "parent " + parentPath + " of path " + path);
            }
            node.parent.addChild(path.substring(lastSlash + 1));
            long eowner = node.stat.getEphemeralOwner();
            if (eowner != 0) {
                HashSet<String> list = ephemerals.get(eowner);
                if (list == null) {
                    list = new HashSet<String>();
                    ephemerals.put(eowner, list);
                }
                list.add(path);
            }
        }
        path = ia.readString("path");
    }
    nodes.put("/", root);
    // we are done with deserializing the
    // the datatree
    // update the quotas - create path trie
    // and also update the stat nodes
    setupQuota();
}
 
开发者ID:gerritjvv,项目名称:bigstreams,代码行数:39,代码来源:DataTree.java

示例4: 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

示例5: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
public void deserialize(InputArchive ia, String tag) throws IOException {
    aclCache.deserialize(ia);
    nodes.clear();
    pTrie.clear();
    String path = ia.readString("path");
    while (!path.equals("/")) {
        DataNode node = new DataNode();
        ia.readRecord(node, "node");
        nodes.put(path, node);
        synchronized (node) {
            aclCache.addUsage(node.acl);
        }
        int lastSlash = path.lastIndexOf('/');
        if (lastSlash == -1) {
            root = node;
        } else {
            String parentPath = path.substring(0, lastSlash);
            node.parent = nodes.get(parentPath);
            if (node.parent == null) {
                throw new IOException("Invalid Datatree, unable to find " +
                        "parent " + parentPath + " of path " + path);
            }
            node.parent.addChild(path.substring(lastSlash + 1));
            long eowner = node.stat.getEphemeralOwner();
            if (eowner != 0) {
                HashSet<String> list = ephemerals.get(eowner);
                if (list == null) {
                    list = new HashSet<String>();
                    ephemerals.put(eowner, list);
                }
                list.add(path);
            }
        }
        path = ia.readString("path");
    }
    nodes.put("/", root);
    // we are done with deserializing the
    // the datatree
    // update the quotas - create path trie
    // and also update the stat nodes
    setupQuota();

    aclCache.purgeUnused();
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:45,代码来源:DataTree.java

示例6: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
public void deserialize(InputArchive ia, String tag) throws IOException {
    aclCache.deserialize(ia);
    nodes.clear();
    pTrie.clear();
    String path = ia.readString("path");
    while (!"/".equals(path)) {
        DataNode node = new DataNode();
        ia.readRecord(node, "node");
        nodes.put(path, node);
        synchronized (node) {
            aclCache.addUsage(node.acl);
        }
        int lastSlash = path.lastIndexOf('/');
        if (lastSlash == -1) {
            root = node;
        } else {
            String parentPath = path.substring(0, lastSlash);
            DataNode parent = nodes.get(parentPath);
            if (parent == null) {
                throw new IOException("Invalid Datatree, unable to find " +
                        "parent " + parentPath + " of path " + path);
            }
            parent.addChild(path.substring(lastSlash + 1));
            long eowner = node.stat.getEphemeralOwner();
            EphemeralType ephemeralType = EphemeralType.get(eowner);
            if (ephemeralType == EphemeralType.CONTAINER) {
                containers.add(path);
            } else if (ephemeralType == EphemeralType.TTL) {
                ttls.add(path);
            } else if (eowner != 0) {
                HashSet<String> list = ephemerals.get(eowner);
                if (list == null) {
                    list = new HashSet<String>();
                    ephemerals.put(eowner, list);
                }
                list.add(path);
            }
        }
        path = ia.readString("path");
    }
    nodes.put("/", root);
    // we are done with deserializing the
    // the datatree
    // update the quotas - create path trie
    // and also update the stat nodes
    setupQuota();

    aclCache.purgeUnused();
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:50,代码来源:DataTree.java

示例7: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
public void deserialize(InputArchive ia, String tag) throws IOException {
    // 反序列化longKey集合
    deserializeList(longKeyMap, ia);
    nodes.clear();
    pTrie.clear();
    // 读取节点path
    String path = ia.readString("path");
    while (!path.equals("/")) {
        DataNode node = new DataNode();
        // 反序列化节点
        ia.readRecord(node, "node");
        // 节点添加到DataTree
        nodes.put(path, node);
        int lastSlash = path.lastIndexOf('/');
        if (lastSlash == -1) {
            // 根节点
            root = node;
        } else {
            String parentPath = path.substring(0, lastSlash);
            // 父节点
            node.parent = nodes.get(parentPath);
            if (node.parent == null) {
                throw new IOException("Invalid Datatree, unable to find " +
                        "parent " + parentPath + " of path " + path);
            }
            // 父节点的子节点列表添加当前节点的节点名称
            node.parent.addChild(path.substring(lastSlash + 1));
            long eowner = node.stat.getEphemeralOwner();
            if (eowner != 0) {
                // 临时节点处理
                HashSet<String> list = ephemerals.get(eowner);
                if (list == null) {
                    list = new HashSet<String>();
                    ephemerals.put(eowner, list);
                }
                list.add(path);
            }
        }
        path = ia.readString("path");
    }
    nodes.put("/", root);
    // we are done with deserializing the
    // the datatree
    // update the quotas - create path trie
    // and also update the stat nodes
    setupQuota();
}
 
开发者ID:txazo,项目名称:zookeeper,代码行数:48,代码来源:DataTree.java

示例8: deserialize

import org.apache.jute.InputArchive; //导入方法依赖的package包/类
public void deserialize(InputArchive ia, String tag) throws IOException {
    deserializeList(longKeyMap, ia);
    nodes.clear();
    pTrie.clear();
    String path = ia.readString("path");
    while (!"/".equals(path)) {
        DataNode node = new DataNode();
        ia.readRecord(node, "node");
        nodes.put(path, node);
        int lastSlash = path.lastIndexOf('/');
        if (lastSlash == -1) {
            root = node;
        } else {
            String parentPath = path.substring(0, lastSlash);
            DataNode parent = nodes.get(parentPath);
            if (parent == null) {
                throw new IOException("Invalid Datatree, unable to find " +
                        "parent " + parentPath + " of path " + path);
            }
            parent.addChild(path.substring(lastSlash + 1));
            long eowner = node.stat.getEphemeralOwner();
            if (eowner == CONTAINER_EPHEMERAL_OWNER) {
                containers.add(path);
            } else if (eowner != 0) {
                HashSet<String> list = ephemerals.get(eowner);
                if (list == null) {
                    list = new HashSet<String>();
                    ephemerals.put(eowner, list);
                }
                list.add(path);
            }
        }
        path = ia.readString("path");
    }
    nodes.put("/", root);
    // we are done with deserializing the
    // the datatree
    // update the quotas - create path trie
    // and also update the stat nodes
    setupQuota();
}
 
开发者ID:sereca,项目名称:SecureKeeper,代码行数:42,代码来源:DataTree.java


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