Esempio n. 1
0
        static void LoadDataWithSyncForCassandra(string filename, int nThread, VersionDb vdb)
        {
            List <VersionDb> vdbList = new List <VersionDb>();

            for (int i = 0; i < nThread; i++)
            {
                vdbList.Add(vdb);
            }

            YCSBBenchmarkTest sync_test = new YCSBBenchmarkTest(0, 0, vdb);

            sync_test.LoadDataWithMultiThreads(filename, vdbList, nThread);
        }
Esempio n. 2
0
        /// <summary>
        /// For YCSB sync benchmark test
        /// </summary>
        static void YCSBTest()
        {
            const int    workerCount        = 4;       // 4;
            const int    taskCountPerWorker = 2000000; // 50000;
            const string dataFile           = "ycsb_data_lg_r.in";
            const string operationFile      = "ycsb_ops_lg_r.in";

            // REDIS VERSION DB
            // VersionDb versionDb = RedisVersionDb.Instance;
            // SINGLETON VERSION DB
            VersionDb versionDb = SingletonVersionDb.Instance();

            YCSBBenchmarkTest test = new YCSBBenchmarkTest(workerCount, taskCountPerWorker, versionDb);

            test.Setup(dataFile, operationFile);
            test.Run();
            test.Stats();
        }
Esempio n. 3
0
        public static void YCSBSyncTestWithCassandra(string[] args)
        {
            string[] contactPoints      = { "127.0.0.1" };
            int      replicationFactor  = 1;
            int      workerCount        = 1;
            int      taskCountPerWorker = 1000;
            string   dataFile           = "ycsb_data_r.in";
            string   operationFile      = "ycsb_ops_r.in";

            int i = 1;

            while (i < args.Length)
            {
                switch (args[i++])
                {
                case "--contacts":
                    contactPoints = args[i++].Split(',');
                    break;

                case "--repfactor":
                    replicationFactor = int.Parse(args[i++]);
                    break;

                case "--workers":
                    workerCount = int.Parse(args[i++]);
                    break;

                case "--tasks":
                    taskCountPerWorker = int.Parse(args[i++]);
                    break;

                case "--data":
                    dataFile = args[i++];
                    break;

                case "--ops":
                    operationFile = args[i++];
                    break;

                default:
                    break;
                }
            }

            //Console.WriteLine("contact points: " + contactPoints.Length);
            //Console.WriteLine("replica: " + replicationFactor);
            //Console.WriteLine("worker: " + workerCount);
            //Console.WriteLine("taskPerWorker: " + taskCountPerWorker);
            //Console.WriteLine("data: " + dataFile);
            //Console.WriteLine("ops: " + operationFile);
            //return;


            // Cassandra version db
            int maxVdbCnt            = 8192;
            List <VersionDb> vdbList = new List <VersionDb>();

            for (int j = 0; j < maxVdbCnt; j++)
            {
                vdbList.Add(CassandraVersionDb.Instance(1, j));
            }
            YCSBBenchmarkTest test = new YCSBBenchmarkTest(0, 0, vdbList[0]);

            test.LoadDataWithMultiThreads(dataFile, vdbList, 1);


            // run
            //test.rerun(1, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(2, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(4, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(8, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(16, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(32, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(64, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(128, 2000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(64, 2000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(256, 1000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(512, 500, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(1024, 250, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            test.rerun(2048, 125, operationFile, vdbList);
            Console.WriteLine("*****************************************************");

            test.rerun(4096, 50, operationFile, vdbList);
            Console.WriteLine("*****************************************************");

            test.rerun(8192, 25, operationFile, vdbList);
            Console.WriteLine("*****************************************************");

            //Console.WriteLine("done");
            //Console.ReadLine();
        }
Esempio n. 4
0
        public static void YCSBSyncTestWithPartitionedCassandra(string[] args)
        {
            int    workerCount        = 1;
            int    taskCountPerWorker = 1000;
            string dataFile           = "ycsb_data_r.in";
            string operationFile      = "ycsb_ops_r.in";

            // Cassandra version db
            int maxVdbCnt            = 8192;
            List <VersionDb> vdbList = new List <VersionDb>();

            for (int j = 0; j < maxVdbCnt; j++)
            {
                vdbList.Add(PartitionedCassandraVersionDb.Instance(1, "127.0.0.1", 1, ConsistencyLevel.One));
            }
            YCSBBenchmarkTest test = new YCSBBenchmarkTest(0, 0, vdbList[0]);

            test.LoadDataWithMultiThreads(dataFile, vdbList, 10);


            // run
            //test.rerun(1, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(2, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(4, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(8, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(16, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(32, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(64, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(128, 2000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(64, 2000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(256, 1000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(512, 500, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(1024, 250, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(2048, 125, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(4096, 50, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(8192, 25, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //Console.WriteLine("done");
            //Console.ReadLine();
        }