//The same Exe is shared for the work item submitter, job manager task, mapper task, reducer task
        //Decide which one to start based on the command line parameters.
        public static void Main(string[] args)
        {
            if (args != null && args.Length > 0)
            {
                if (args[0] == "/?" || args[0] == "-help")
                {
                    DisplayUsage();
                    return;
                }

                if (args[0] == "-JobManagerTask")
                {
                    JobManagerTask jobManager = new JobManagerTask();
                    jobManager.RunAsync().Wait();
                }
                else if (args[0] == "-MapperTask")
                {
                    if (args.Length != 2)
                    {
                        DisplayUsage();
                        throw new ArgumentException("Incorrect number of arguments");
                    }

                    string blobSas = args[1];

                    MapperTask mapperTask = new MapperTask(blobSas);
                    mapperTask.RunAsync().Wait();
                }
                else if (args[0] == "-ReducerTask")
                {
                    ReducerTask reducerTask = new ReducerTask();
                    reducerTask.RunAsync().Wait();
                }
                else if (args[0] == "-SubmitWorkItem")
                {
                    WorkItemSubmitter submitter = new WorkItemSubmitter();
                    submitter.RunAsync().Wait();
                }
                else
                {
                    DisplayUsage();
                    throw new ArgumentException("Invalid option " + args[0]);
                }
            }
            else
            {
                DisplayUsage();
                return;
            }
        }
Exemple #2
0
        //The same Exe is shared for the work item submitter, job manager task, mapper task, reducer task
        //Decide which one to start based on the command line parameters.
        public static void Main(string[] args)
        {
            if (args != null && args.Length > 0)
            {
                if (args[0] == "/?" || args[0] == "-help")
                {
                    DisplayUsage();
                    return;
                }

                if (args[0] == "-JobManagerTask")
                {
                    JobManagerTask jobManager = new JobManagerTask();
                    jobManager.RunAsync().Wait();
                }
                else if (args[0] == "-MapperTask")
                {
                    if (args.Length != 2)
                    {
                        DisplayUsage();
                        throw new ArgumentException("Incorrect number of arguments");
                    }

                    string blobSas = args[1];

                    MapperTask mapperTask = new MapperTask(blobSas);
                    mapperTask.RunAsync().Wait();
                }
                else if (args[0] == "-ReducerTask")
                {
                    ReducerTask reducerTask = new ReducerTask();
                    reducerTask.RunAsync().Wait();
                }
                else if (args[0] == "-SubmitWorkItem")
                {
                    WorkItemSubmitter submitter = new WorkItemSubmitter();
                    submitter.RunAsync().Wait();
                }
                else
                {
                    DisplayUsage();
                    throw new ArgumentException("Invalid option " + args[0]);
                }
            }
            else
            {
                DisplayUsage();
                return;
            }
        }