public DatabaseValueDetail(string nodeName, DatabaseConfiguration configuration, string[] pathChunks) { NodeName = nodeName; NodeType = PathType.Database; IsContainer = true; IsValid = true; Configuration = configuration; PathChunks = pathChunks; ChilderanTable = new PrintableTable(); ChilderanName = new List <string>(); ChilderanTable.AddRow(ProviderUtil.COLLECTIONS); ChilderanName.Add(ProviderUtil.COLLECTIONS); ChilderanTable.AddRow(ProviderUtil.FUNCTIONS); ChilderanName.Add(ProviderUtil.FUNCTIONS); }
public ServerValueDetail(string nodeName, PathType nodeType, ServerDetail configuration, string[] pathChunks) { NodeName = nodeName; NodeType = nodeType; IsContainer = true; IsValid = true; Configuration = configuration; PathChunks = pathChunks; ChilderanTable = new PrintableTable(); ChilderanTable.AddHeader("Priority"); ChilderanTable.AddRow(((ServerDetail)configuration).Priority.ToString()); }
internal ConfigManagerDetail(string nodeName, bool isContainer, bool isValid, ClusterConfiguration configuration, string[] pathChunks) { NodeName = nodeName; NodeType = PathType.ConfigurationManager; IsContainer = isContainer; IsValid = isValid; Configuration = configuration; ChilderanTable = new PrintableTable(" "); ChilderanName = new List <string>(); ChilderanTable.AddRow(ProviderUtil.DATABASES); ChilderanName.Add(ProviderUtil.DATABASES); if (!ConfigurationConnection.ClusterConfiguration.DisplayName.Equals(MiscUtil.STAND_ALONE)) { ChilderanTable.AddRow(ProviderUtil.SHARDS); ChilderanName.Add(ProviderUtil.SHARDS); ChilderanTable.AddRow(ProviderUtil.CONFIGCLUSTER); ChilderanName.Add(ProviderUtil.CONFIGCLUSTER); } ChilderanTable.GetTableRows(); PathChunks = pathChunks; }
internal CollectionValueDetail(string databaseName, string nodeName, CollectionConfiguration configuration, string[] pathChunks) { _databaseName = databaseName; NodeName = nodeName; NodeType = PathType.Collection; IsContainer = true; IsValid = true; Configuration = configuration; PathChunks = pathChunks; ChilderanTable = new PrintableTable(); ChilderanName = new List <string>(); ChilderanTable.AddRow(ProviderUtil.INDICES); ChilderanName.Add(ProviderUtil.INDICES); }
public ShardValueDetail(string nodeName, ShardConfiguration configuration, string[] pathChunks) { NodeName = nodeName; NodeType = PathType.Shard; IsContainer = true; IsValid = true; Configuration = configuration; PathChunks = pathChunks; ChilderanTable = new PrintableTable(); ChilderanName = new List <string>(); ClusterInfo clusterInfo = ConfigurationConnection.ClusterInfo; ShardInfo shardInfo = clusterInfo.GetShard(nodeName); List <ServerInfo> running = new List <ServerInfo>(); if (shardInfo != null) { if (shardInfo.RunningNodes != null) { running = shardInfo.RunningNodes.Values.ToList(); } } ChilderanTable.AddHeader("Node IP Address", "Running Status", "Primary Status", "Priority"); foreach (ServerNode node in configuration.Servers.Nodes.Values) { ServerInfo serverInfo = null; string isPrimery = ProviderUtil.NOT_PRIMARY; string isRunning = ProviderUtil.NOT_RUNNING; if (running != null) { serverInfo = running.Find(x => x.Address.ip.Equals(node.Name)); } if (serverInfo != null) { if (running.Contains(serverInfo)) { isRunning = ProviderUtil.RUNNING; } if (shardInfo.Primary != null && serverInfo.Equals(shardInfo.Primary)) { isPrimery = ProviderUtil.PRIMARY; } } ChilderanTable.AddRow(node.Name, isRunning, isPrimery, node.Priority.ToString()); ChilderanName.Add(node.Name); } }
internal LocalDatabaseDetail(string nodeName, bool isContainer, bool isValid, ClusterConfiguration configuration, string[] pathChunks) { NodeName = nodeName; NodeType = PathType.LocalDB; IsContainer = isContainer; IsValid = isValid; Configuration = configuration; ChilderanTable = new PrintableTable(); ChilderanTable.AddRow(ProviderUtil.DATABASES); ChilderanName = new List <string>(); ChilderanName.Add(ProviderUtil.DATABASES); string tableString = ChilderanTable.GetTableRows(); PathChunks = pathChunks; }
internal DatabasesDetail(string nodeName, DatabaseConfigurations configuration, string[] pathChunks) { NodeName = nodeName; NodeType = PathType.Databases; IsContainer = true; IsValid = true; Configuration = configuration; PathChunks = pathChunks; ChilderanTable = new PrintableTable(); ChilderanTable.AddHeader("Database name", "Provider"); ChilderanName = new List <string>(); foreach (var db in configuration.Configurations.Values) { ChilderanName.Add(db.Name); ChilderanTable.AddRow(db.Name, db.Storage.StorageProvider.StorageProviderType.ToString()); } }
internal CollectionsDetail(string databaseName, string nodeName, CollectionConfigurations configuration, string[] pathChunks) { _databaseName = databaseName; NodeName = nodeName; NodeType = PathType.Collections; IsContainer = true; IsValid = true; ChilderanTable = new PrintableTable(); Configuration = configuration; ChilderanTable = new PrintableTable(); ChilderanTable.AddHeader("Name", "Type", "Detail"); ChilderanName = new List <string>(); foreach (CollectionConfiguration cConfig in configuration.Configuration.Values) { ChilderanTable.AddRow(cConfig.CollectionName, "Non Sharded", cConfig.Shard); } PathChunks = pathChunks; }
internal NoSDbDetail(string[] pathChunks, PSDriveInfo drive) { if (ConfigurationConnection.ClusterConfiguration != null) { PathChunks = pathChunks; Drive = (NosDBPSDriveInfo)drive; ClusterConfiguration configuration = ConfigurationConnection.ClusterConfiguration; new ConfigClusterInfo(ConfigurationConnection.ConfigCluster); Configuration = configuration; IsContainer = true; IsValid = true; NodeType = PathType.NoSDB; ChilderanName = new List <string>(); ChilderanTable = new PrintableTable(); ChilderanTable.AddHeader("Database Cluster"); ChilderanTable.AddRow(ConfigurationConnection.ClusterConfiguration.DisplayName); ChilderanName.Add(ConfigurationConnection.ClusterConfiguration.DisplayName); } }
internal IndexValueDetail(string nodeName, IndexConfiguration configuration, string[] pathChunks, string databaseName) { _databaseName = databaseName; NodeName = nodeName; NodeType = PathType.Index; IsContainer = true; IsValid = true; Configuration = configuration; PathChunks = pathChunks; ChilderanTable = new PrintableTable(); ChilderanName = new List <string>(); ChilderanTable.AddHeader("Attribute Name", "Order"); if (configuration.Attributes != null) { ChilderanTable.AddRow(configuration.Attributes.Name, configuration.Attributes.Order); ChilderanName.Add(configuration.Attributes.Name); } }
internal IndicesValueDetail(string nodeName, Indices configuration, string[] pathChunks, string databaseName) { NodeName = nodeName; NodeType = PathType.Indexes; IsContainer = true; IsValid = true; Configuration = configuration; PathChunks = pathChunks; ChilderanTable = new PrintableTable(); ChilderanTable.AddHeader("Indices"); ChilderanName = new List <string>(); if (configuration.IndexConfigurations != null) { foreach (IndexConfiguration index in configuration.IndexConfigurations.Values) { ChilderanName.Add(index.IndexName); ChilderanTable.AddRow(index.IndexName); } } }
public ConfigurationNodesDetail(string nodeName, bool isContainer, bool isValid, ConfigClusterInfo configCluster, string[] pathChunks) { NodeName = nodeName; NodeType = PathType.ConfigurationNodes; IsContainer = isContainer; IsValid = isValid; Configuration = configCluster; PathChunks = pathChunks; ChilderanTable = new PrintableTable(); ChilderanTable.AddHeader("Node IP Address", "Status"); ChilderanName = new List <string>(); foreach (ServerDetail server in ((ConfigClusterInfo)this.Configuration).Servers) { ChilderanName.Add(server.IPAddress); string statusString = ConfigurationConnection.Current.ConfigServerIP.Equals(server.IPAddress) ? ProviderUtil.ACTIVE : ""; ChilderanTable.AddRow(server.IPAddress, statusString); } }