Ejemplo n.º 1
0
        static void ZooKeeperConfigLoader_Test()
        {
            string connStr = "192.168.31.103:2181";//192.168.31.103:2181 192.168.1.5:2181,192.168.1.5:2182,192.168.1.5:2183

            string configPath   = "/Config/App1/SmartSqlMapConfig.xml";
            var    configLoader = new ZooKeeperConfigLoader(configPath, connStr);

            var SqlMapper = new SmartSqlMapper(new SmartSqlOptions
            {
                ConfigPath   = configPath,
                ConfigLoader = configLoader
            });

            int i = 0;

            for (i = 0; i < 10; i++)
            {
                Console.ReadLine();
                var list = SqlMapper.Query <T_Entity>(new RequestContext
                {
                    Scope   = "Entity",
                    SqlId   = "Query",
                    Request = new { Ids = new long[] { 1, 2, 3, 4 } }
                });
                Console.WriteLine($"{list.Count()}");
            }
        }
Ejemplo n.º 2
0
        public ZooKeeperConfigLoader_Tests()
        {
            string connStr      = "192.168.1.5:2181";//192.168.1.5:2181,192.168.1.5:2182,192.168.1.5:2183 192.168.31.103:2181
            var    configLoader = new ZooKeeperConfigLoader(connStr);
            string configPath   = "/Config/App1/SmartSqlMapConfig.xml";

            SqlMapper = new SmartSqlMapper(configPath, configLoader);
        }
Ejemplo n.º 3
0
        public ZooKeeperConfigLoader_Tests()
        {
            string connStr      = "192.168.31.103:2181";//192.168.1.5:2181,192.168.1.5:2182,192.168.1.5:2183 192.168.31.103:2181
            string configPath   = "/Config/App1/SmartSqlMapConfig.xml";
            var    configLoader = new ZooKeeperConfigLoader(configPath, connStr);

            SqlMapper = new SmartSqlMapper(NullLoggerFactory.Instance, configPath, configLoader);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            string connStr      = "192.168.1.5:2181,192.168.1.5:2182,192.168.1.5:2183";
            var    configLoader = new ZooKeeperConfigLoader(connStr);
            string configPath   = "/Config/App1/SmartSqlMapConfig.xml";
            var    SqlMapper    = new SmartSqlMapper(configPath, configLoader);

            int i = 0;

            for (i = 0; i < 10; i++)
            {
                Console.ReadLine();
                var list = SqlMapper.Query <T_Test>(new RequestContext
                {
                    Scope   = "T_Test",
                    SqlId   = "GetList",
                    Request = new { Ids = new long[] { 1, 2, 3, 4 } }
                });
                Console.WriteLine($"{list.Count()}");
            }

            Console.WriteLine("Hello World!");
        }