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


Java Stat.setDataLength方法代码示例

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


在下文中一共展示了Stat.setDataLength方法的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);
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:21,代码来源:DataNode.java

示例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;
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:24,代码来源:StatTest.java

示例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);
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:21,代码来源:DataNode.java

示例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());
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:13,代码来源:DataNodeV1.java

示例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());
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:13,代码来源:DataTreeV1.java

示例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());
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:14,代码来源:DataTree.java


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