Exemplo n.º 1
0
        public IDBTable getPersistDBTable(string name)
        {
            AEDBPersistTable obj = null;

            _persisttables.TryGetValue(name, out obj);
            return((IDBTable)obj);
        }
Exemplo n.º 2
0
        public bool init(object config)
        {
            Debug.logger.log(LogType.LOG_SYSTEM, "AEServer Start Initialize DBManager ...");

            dynamic conf = config;

            // initialize DB
            DBMySqlManager.manager.init(conf.mysql);
            DBRedisManager.manager.init(conf.redis);

            // initialize tables
            foreach (var item in conf.memtables)
            {
                AEDBMemTable tab = new AEDBMemTable();
                if (!tab.init(item))
                {
                    // error
                    continue;
                }

                _memtables[item.name] = tab;
            }

            foreach (var item in conf.persisttables)
            {
                AEDBPersistTable tab = new AEDBPersistTable();
                if (!tab.init(item))
                {
                    // error
                    continue;
                }

                _persisttables[item.name] = tab;
            }

            Debug.logger.log(LogType.LOG_SYSTEM, "AEServer Initialize DBManager redis OK!");
            return(true);
        }