Ejemplo n.º 1
0
        public async Task Start()
        {
            var cq = LoadFilesInQueue();

            var session = CreateConnectedSession();

            Console.WriteLine("(Re)Create database? 'y' or 'n'");
            var readLine = Console.ReadLine();

            if (readLine.ToLower() == "y")
            {
                PrepareDatabase(session);
            }

            _counterReader.StartStopWatch();
            await ConcurrentUtils.ConcurrentUtils.Times(_numberOfFilesToLoad, _numberOfFilesToLoad, index => ImportFile(session, cq));
        }
Ejemplo n.º 2
0
        public async Task Start()
        {
            Console.WriteLine("Creating session...");
            var session = CreateConnectedSession();

            ReadAllData(session);

            _ps = session.Prepare("SELECT * FROM nameslist.names WHERE name = ?");
            _ps.SetConsistencyLevel(ConsistencyLevel.Three);

            Console.WriteLine("Loading...");
            Console.WriteLine("Number of threads?");
            var readLine    = Console.ReadLine();
            var nrOfThreads = Parse(readLine);

            _counterReader.StartStopWatch();

            await ConcurrentUtils.ConcurrentUtils.Times(nrOfThreads, nrOfThreads, index => LoadItemPerKey(session));
        }