Ejemplo n.º 1
0
        public MongoProcessStore(ProcessControllerService director, IConfigSectionNode node) : base(director, node)
        {
            var cstring = ConfigStringBuilder.Build(node, CONFIG_MONGO_SECTION);

            m_Database  = App.GetMongoDatabaseFromConnectString(cstring);
            m_Converter = FactoryUtils.MakeAndConfigure <DataDocConverter>(node[CONFIG_CONVERTER_SECTION], typeof(DataDocConverter));
        }
Ejemplo n.º 2
0
        public MongoTodoQueueStore(TodoQueueService director, IConfigSectionNode node) : base(director, node)
        {
            var cstring = ConfigStringBuilder.Build(node, CONFIG_MONGO_SECTION);

            m_Database  = MongoClient.DatabaseFromConnectString(cstring);
            m_Converter = FactoryUtils.MakeAndConfigure <RowConverter>(node[CONFIG_CONVERTER_SECTION], typeof(RowConverter));
        }
Ejemplo n.º 3
0
        public MongoLogArchiveStore(LogReceiverService director, LogArchiveDimensionsMapper mapper, IConfigSectionNode node) : base(director, mapper, node)
        {
            var cstring = ConfigStringBuilder.Build(node, CONFIG_MONGO_SECTION);

            m_Database               = App.GetMongoDatabaseFromConnectString(cstring);
            m_DefaultChannel         = node.AttrByName(CONFIG_DEFAULT_CHANNEL_ATTR).ValueAsAtom(DEFAULT_CHANNEL);
            m_Serializer             = new BSONSerializer(node);
            m_Serializer.PKFieldName = Query._ID;
        }
Ejemplo n.º 4
0
        public MongoTelemetryArchiveStore(TelemetryReceiverService director, IConfigSectionNode node) : base(director, node)
        {
            var cstring = ConfigStringBuilder.Build(node, CONFIG_MONGO_SECTION);

            m_Database               = MongoClient.DatabaseFromConnectString(cstring);
            m_DefaultChannel         = node.AttrByName(CONFIG_DEFAULT_CHANNEL_ATTR).ValueAsString(DEFAULT_CHANNEL);
            m_Serializer             = new BSONSerializer(node);
            m_Serializer.PKFieldName = Query._ID;
        }
Ejemplo n.º 5
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));
                                     }
                                 }
Ejemplo n.º 6
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));
                    }
                }
Ejemplo n.º 7
0
 protected override void DoConfigure(IConfigSectionNode node)
 {
     base.DoConfigure(node);
     m_ConnectionString = ConfigStringBuilder.Build(node, CONFIG_MONGO_SECTION);
 }