當前位置: 首頁>>代碼示例>>Java>>正文


Java Stat.setCzxid方法代碼示例

本文整理匯總了Java中org.apache.zookeeper.data.Stat.setCzxid方法的典型用法代碼示例。如果您正苦於以下問題:Java Stat.setCzxid方法的具體用法?Java Stat.setCzxid怎麽用?Java Stat.setCzxid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.zookeeper.data.Stat的用法示例。


在下文中一共展示了Stat.setCzxid方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: testRoundTrip

import org.apache.zookeeper.data.Stat; //導入方法依賴的package包/類
public void testRoundTrip() throws IOException {
    MultiResponse response = new MultiResponse();

    response.add(new OpResult.CheckResult());
    response.add(new OpResult.CreateResult("foo-bar"));
    response.add(new OpResult.DeleteResult());

    Stat s = new Stat();
    s.setCzxid(546);
    response.add(new OpResult.SetDataResult(s));

    MultiResponse decodedResponse = codeDecode(response);

    assertEquals(response, decodedResponse);
    assertEquals(response.hashCode(), decodedResponse.hashCode());
}
 
開發者ID:maoling,項目名稱:fuck_zookeeper,代碼行數:17,代碼來源:MultiResponseTest.java

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

示例5: testRoundTrip

import org.apache.zookeeper.data.Stat; //導入方法依賴的package包/類
public void testRoundTrip() throws IOException {
    MultiResponse response = new MultiResponse();

    response.add(new OpResult.CheckResult());
    response.add(new OpResult.CreateResult("foo-bar"));
    response.add(new OpResult.DeleteResult());

    Stat s = new Stat();
    s.setCzxid(546);
    response.add(new OpResult.SetDataResult(s));

    MultiResponse decodedResponse = codeDecode(response);

    Assert.assertEquals(response, decodedResponse);
    Assert.assertEquals(response.hashCode(), decodedResponse.hashCode());
}
 
開發者ID:didichuxing2,項目名稱:https-github.com-apache-zookeeper,代碼行數:17,代碼來源:MultiResponseTest.java

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

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

示例8: 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.setCzxid方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。