Exemplo n.º 1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("Usage: SumStore.exe [single|concurrent|test] [populate|recover|continue] [guid]");
                return;
            }
            if (!Directory.Exists("logs"))
            {
                Directory.CreateDirectory("logs");
            }

            int nextArg = 0;
            var test    = default(IFasterRecoveryTest);
            var type    = args[nextArg++];

            if (type == "single")
            {
                test = new SingleThreadedRecoveryTest();
            }
            else if (type == "concurrent")
            {
                int threadCount = int.Parse(args[nextArg++]);
                test = new ConcurrentRecoveryTest(threadCount);
            }
            else if (type == "test")
            {
                int threadCount = int.Parse(args[nextArg++]);
                test = new ConcurrentTest(threadCount);
            }
            else
            {
                Debug.Assert(false);
            }

            var task = args[nextArg++];

            if (task == "populate")
            {
                test.Populate();
            }
            else if (task == "recover")
            {
                Guid version = Guid.Parse(args[nextArg++]);
                test.RecoverAndTest(version, version);
            }
            else if (task == "continue")
            {
                test.Continue();
            }
            else
            {
                Debug.Assert(false);
            }
        }
Exemplo n.º 2
0
        static unsafe void Main(string[] args)
        {
            int nextArg = 0;
            var test    = default(IFasterRecoveryTest);
            var type    = args[nextArg++];

            if (type == "single")
            {
                test = new SingleThreadedRecoveryTest();
            }
            else if (type == "concurrent")
            {
                int threadCount = int.Parse(args[nextArg++]);
                test = new ConcurrentRecoveryTest(threadCount);
            }
            else if (type == "test")
            {
                int threadCount = int.Parse(args[nextArg++]);
                test = new ConcurrentTest(threadCount);
            }
            else
            {
                Debug.Assert(false);
            }

            var task = args[nextArg++];

            if (task == "populate")
            {
                test.Populate();
            }
            else if (task == "recover")
            {
                Guid version = Guid.Parse(args[nextArg++]);
                test.RecoverAndTest(version, version);
            }
            else if (task == "continue")
            {
                test.Continue();
            }
            else
            {
                Debug.Assert(false);
            }
        }