本文整理汇总了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);
}
示例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;
}
}
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}