curator icon indicating copy to clipboard operation
curator copied to clipboard

The result of event.getPath() in BackgroundCallback confused me

Open zspmaomao opened this issue 8 years ago • 0 comments

What I do as follows: BackgroundCallback bc = new BackgroundCallback() { @Override public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { System.out.println (" type : " + event.getType()+ " ResultCode:"+event.getResultCode()+" path:"+event.getPath()); } }; client.create() .creatingParentContainersIfNeeded() .withProtection() .withMode(CreateMode.EPHEMERAL_SEQUENTIAL) .withACL(ZooDefs.Ids.OPEN_ACL_UNSAFE) .inBackground(bc) .forPath("/ephemeral/ephemeral_sequentialtest", datas.getBytes()); I Then I got : type : CREATE ResultCode:0 path:/ephemeral/_c_626fca12-0115-45e8-99fa-0a32184e5ab3-ephemeral_sequentialtest Actually I saw the created path in zookeeper is
/ephemeral/_c_626fca12-0115-45e8-99fa-0a32184e5ab3-ephemeral_sequentialtest0000000000 Then I confused , Program execution is wrong, or am I wrong?

zspmaomao avatar Jan 26 '17 05:01 zspmaomao