Ejemplo n.º 1
0
        //The same Exe is shared for the job 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")
                {
                    TextSearchJobManagerTask jobManager = new TextSearchJobManagerTask();
                    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] == "-SubmitJob")
                {
                    JobSubmitter submitter = new JobSubmitter();
                    submitter.RunAsync().Wait();
                }
                else
                {
                    DisplayUsage();
                    throw new ArgumentException("Invalid option " + args[0]);
                }
            }
            else
            {
                DisplayUsage();
                return;
            }
        }
Ejemplo n.º 2
0
        //The same Exe is shared for the job 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")
                {
                    TextSearchJobManagerTask jobManager = new TextSearchJobManagerTask();
                    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] == "-SubmitJob")
                {
                    JobSubmitter submitter = new JobSubmitter();
                    submitter.RunAsync().Wait();
                }
                else
                {
                    DisplayUsage();
                    throw new ArgumentException("Invalid option " + args[0]);
                }
            }
            else
            {
                DisplayUsage();
                return;
            }
        }
Ejemplo n.º 3
0
        public static void Main(string[] args)
        {
            try
            {
                TextSearchJobManagerTask jobManagerTask = new TextSearchJobManagerTask();

                jobManagerTask.RunAsync().Wait();
            }
            catch (AggregateException e)
            {
                SampleHelpers.PrintAggregateException(e);

                throw;
            }
        }