本文整理匯總了Java中org.apache.zookeeper.data.Stat.setNumChildren方法的典型用法代碼示例。如果您正苦於以下問題:Java Stat.setNumChildren方法的具體用法?Java Stat.setNumChildren怎麽用?Java Stat.setNumChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.zookeeper.data.Stat
的用法示例。
在下文中一共展示了Stat.setNumChildren方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: copyStat
import org.apache.zookeeper.data.Stat; //導入方法依賴的package包/類
synchronized public void copyStat(Stat to) {
to.setAversion(stat.getAversion());
to.setCtime(stat.getCtime());
to.setCzxid(stat.getCzxid());
to.setMtime(stat.getMtime());
to.setMzxid(stat.getMzxid());
to.setPzxid(stat.getPzxid());
to.setVersion(stat.getVersion());
to.setEphemeralOwner(stat.getEphemeralOwner());
to.setDataLength(data == null ? 0 : data.length);
int numChildren = 0;
if (this.children != null) {
numChildren = children.size();
}
// when we do the Cversion we need to translate from the count of the creates
// to the count of the changes (v3 semantics)
// for every create there is a delete except for the children still present
to.setCversion(stat.getCversion()*2 - numChildren);
to.setNumChildren(numChildren);
}
示例2: newStat
import org.apache.zookeeper.data.Stat; //導入方法依賴的package包/類
/**
* Create a new Stat, fill in dummy values trying to catch Assert.failure
* to copy in client or server code.
*
* @return a new stat with dummy values
*/
private Stat newStat() {
Stat stat = new Stat();
stat.setAversion(100);
stat.setCtime(100);
stat.setCversion(100);
stat.setCzxid(100);
stat.setDataLength(100);
stat.setEphemeralOwner(100);
stat.setMtime(100);
stat.setMzxid(100);
stat.setNumChildren(100);
stat.setPzxid(100);
stat.setVersion(100);
return stat;
}
示例3: copyStat
import org.apache.zookeeper.data.Stat; //導入方法依賴的package包/類
synchronized public void copyStat(Stat to) {
to.setAversion(stat.getAversion());
to.setCtime(stat.getCtime());
to.setCzxid(stat.getCzxid());
to.setMtime(stat.getMtime());
to.setMzxid(stat.getMzxid());
to.setPzxid(stat.getPzxid());
to.setVersion(stat.getVersion());
to.setEphemeralOwner(getClientEphemeralOwner(stat));
to.setDataLength(data == null ? 0 : data.length);
int numChildren = 0;
if (this.children != null) {
numChildren = children.size();
}
// when we do the Cversion we need to translate from the count of the creates
// to the count of the changes (v3 semantics)
// for every create there is a delete except for the children still present
to.setCversion(stat.getCversion()*2 - numChildren);
to.setNumChildren(numChildren);
}
示例4: copyStat
import org.apache.zookeeper.data.Stat; //導入方法依賴的package包/類
public void copyStat(Stat to) {
to.setAversion(stat.getAversion());
to.setCtime(stat.getCtime());
to.setCversion(stat.getCversion());
to.setCzxid(stat.getCzxid());
to.setMtime(stat.getMtime());
to.setMzxid(stat.getMzxid());
to.setVersion(stat.getVersion());
to.setEphemeralOwner(stat.getEphemeralOwner());
to.setDataLength(data.length);
to.setNumChildren(children.size());
}
示例5: copyStat
import org.apache.zookeeper.data.Stat; //導入方法依賴的package包/類
static public void copyStat(Stat from, Stat to) {
to.setAversion(from.getAversion());
to.setCtime(from.getCtime());
to.setCversion(from.getCversion());
to.setCzxid(from.getCzxid());
to.setMtime(from.getMtime());
to.setMzxid(from.getMzxid());
to.setVersion(from.getVersion());
to.setEphemeralOwner(from.getEphemeralOwner());
to.setDataLength(from.getDataLength());
to.setNumChildren(from.getNumChildren());
}
示例6: copyStat
import org.apache.zookeeper.data.Stat; //導入方法依賴的package包/類
static public void copyStat(Stat from, Stat to) {
to.setAversion(from.getAversion());
to.setCtime(from.getCtime());
to.setCversion(from.getCversion());
to.setCzxid(from.getCzxid());
to.setMtime(from.getMtime());
to.setMzxid(from.getMzxid());
to.setPzxid(from.getPzxid());
to.setVersion(from.getVersion());
to.setEphemeralOwner(from.getEphemeralOwner());
to.setDataLength(from.getDataLength());
to.setNumChildren(from.getNumChildren());
}