private static void Dfs(ISettingsNode node, string path, List <Topology> result, ClusterConfigReplicasParser parser) { #if DEBUG if (result.Count > 100) { return; } #endif if (node.Flatten().ContainsKey(string.Empty)) { var urls = parser.Parse(node, path); if (urls != null) { result.Add(new Topology(new TopologyKey(TopologyKey.DefaultEnvironment, path), urls.Select(u => new TopologyReplica(u)).ToList())); } } foreach (var child in node.Children.Where(c => c is ObjectNode)) { var childName = path == string.Empty ? child.Name : $"{path}.{child.Name}"; Dfs(child, childName, result, parser); } }
public CcTopologiesProvider(IClusterConfigClient client, ILog log) { this.client = client; parser = new ClusterConfigReplicasParser(log.WithMinimumLevel(LogLevel.Warn)); }