Пример #1
0
        private static void AddChildrenToStringBuilder(ZkClient zkClient, Func<string, bool> pathFilter, int level, StringBuilder builder, string startPath)
        {
            var children = zkClient.GetChildren(startPath);
            foreach (var node in children) 
            {
                string nestedPath;
                if (startPath.EndsWith("/")) 
                {
                    nestedPath = startPath + node;
                } 
                else
                {
                    nestedPath = startPath + "/" + node;
                }

                if (pathFilter(nestedPath)) 
                {
                    builder.Append(GetSpaces(level - 1) + "'-" + "+" + node + "\n");
                    AddChildrenToStringBuilder(zkClient, pathFilter, level + 1, builder, nestedPath);
                }
                else
                {
                    builder.Append(GetSpaces(level - 1) + "'-" + "-" + node + " (contents hidden)\n");
                }
            }
        }
        public List <Tuple <string, string> > GetZKChildrenValues(string path)
        {
            var children = ZkClient.GetChildren(path).OrderBy(x => x).ToList();

            return
                (children.Select(partition => Tuple.Create(partition, ZkClient.ReadData <string>(path + "/" + partition)))
                 .ToList());
        }
 public static IList <string> GetChildrenParentMayNotExist(ZkClient client, string path)
 {
     try
     {
         return(client.GetChildren(path));
     }
     catch (ZkNoNodeException)
     {
         return(null);
     }
 }
Пример #4
0
 public static IList<string> GetChildrenParentMayNotExist(ZkClient client, string path)
 {
     try
     {
         return client.GetChildren(path);
     }
     catch (ZkNoNodeException)
     {
         return null;
     }
 }
Пример #5
0
 public static List<string> GetChildren(ZkClient zkClient, string path)
 {
     return zkClient.GetChildren(path);
 } 
Пример #6
0
		public static IEnumerable<string> GetChildren(ZkClient zkClient, string path)
		{
			return zkClient.GetChildren(path);
		}
 public static List <string> GetChildren(ZkClient zkClient, string path)
 {
     return(zkClient.GetChildren(path));
 }