コード例 #1
0
        /// <summary>
        /// 创建数据库元数据信息
        /// </summary>
        /// <param name="dataSourceMap"></param>
        /// <param name="databaseType"></param>
        /// <returns></returns>
        private ShardingConnectorMetaData CreateMetaData(IDictionary <string, IDataSource> dataSourceMap,
                                                         IDatabaseType databaseType)
        {
            long            start           = UtcTime.CurrentTimeMillis();
            DataSourceMetas dataSourceMetas =
                new DataSourceMetas(databaseType, GetDatabaseAccessConfigurationMap(dataSourceMap));
            SchemaMetaData            schemaMetaData = LoadSchemaMetaData(dataSourceMap);
            ShardingConnectorMetaData result         = new ShardingConnectorMetaData(dataSourceMetas, schemaMetaData);
            var costMillis = UtcTime.CurrentTimeMillis() - start;

            _logger.LogInformation($"Meta data load finished, cost {costMillis} milliseconds.");
            return(result);
        }
コード例 #2
0
 public ShardingMasterInstanceBroadcastRoutingEngine(DataSourceMetas dataSourceMetas)
 {
     this._dataSourceMetas = dataSourceMetas;
 }
コード例 #3
0
 public ShardingConnectorMetaData(DataSourceMetas dataSources, SchemaMetaData schema)
 {
     DataSources = dataSources;
     Schema      = schema;
 }