コード例 #1
0
        protected static void CreateNode(string path, org.apache.zookeeper.CreateMode createMode, org.apache.zookeeper.ZooKeeper client)
        {
            var parts       = path.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
            var currentPart = string.Empty;

            foreach (var part in parts)
            {
                currentPart = $"{currentPart}/{part}";
                var createResult = client.createAsync(currentPart, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, createMode).Result;
                createResult.Should().NotBeNull();
            }
        }
コード例 #2
0
 /// <summary>
 ///     Constructs a create operation.  Arguments are as for the ZooKeeper method of the same name.
 /// </summary>
 /// <param name="path">
 ///     the path for the node
 /// </param>
 /// <param name="data">
 ///     the initial data for the node
 /// </param>
 /// <param name="acl">
 ///     the acl for the node
 /// </param>
 /// <param name="createMode">
 ///     specifying whether the node to be created is ephemeral
 ///     and/or sequential
 /// </param>
 public static Op create(string path, byte[] data, List <ACL> acl, CreateMode createMode)
 {
     return(new Create(path, data, acl, createMode));
 }
コード例 #3
0
            internal override void validate()
            {
                CreateMode createMode = CreateMode.fromFlag(flags);

                PathUtils.validatePath(getPath(), createMode.isSequential());
            }