Exemplo n.º 1
0
                                 internal Shard(ShardSet set, IConfigSectionNode config) : base(set)
                                 {
                                     m_Order = config.AttrByName(CONFIG_ORDER_ATTR).ValueAsInt(0);

                                     PrimaryHostConnectString   = ConfigStringBuilder.Build(config, CONFIG_PRIMARY_CONNECT_STRING_ATTR);
                                     SecondaryHostConnectString = ConfigStringBuilder.Build(config, CONFIG_SECONDARY_CONNECT_STRING_ATTR);

                                     if (PrimaryHostConnectString.IsNullOrWhiteSpace())
                                     {
                                         throw new KdbException(StringConsts.KDB_SHARDSET_CONFIG_SHARD_CSTR_ERROR.Args(CONFIG_PRIMARY_CONNECT_STRING_ATTR, config.RootPath));
                                     }

                                     if (SecondaryHostConnectString.IsNullOrWhiteSpace())
                                     {
                                         throw new KdbException(StringConsts.KDB_SHARDSET_CONFIG_SHARD_CSTR_ERROR.Args(CONFIG_SECONDARY_CONNECT_STRING_ATTR, config.RootPath));
                                     }
                                 }
Exemplo n.º 2
0
                internal Shard(Partition part, IConfigSectionNode config) : base(part)
                {
                    m_Partition = part;
                    m_Order     = config.AttrByName(CONFIG_ORDER_ATTR).ValueAsInt(0);

                    PrimaryHostConnectString   = ConfigStringBuilder.Build(config, CONFIG_PRIMARY_CONNECT_STRING_ATTR);
                    SecondaryHostConnectString = ConfigStringBuilder.Build(config, CONFIG_SECONDARY_CONNECT_STRING_ATTR);

                    if (PrimaryHostConnectString.IsNullOrWhiteSpace())
                    {
                        throw new MdbException(StringConsts.MDB_AREA_CONFIG_SHARD_CSTR_ERROR.Args(part.Area.Name, part.Order, CONFIG_PRIMARY_CONNECT_STRING_ATTR));
                    }

                    if (SecondaryHostConnectString.IsNullOrWhiteSpace())
                    {
                        throw new MdbException(StringConsts.MDB_AREA_CONFIG_SHARD_CSTR_ERROR.Args(part.Area.Name, part.Order, CONFIG_SECONDARY_CONNECT_STRING_ATTR));
                    }
                }