예제 #1
0
 public override string Call(string args)
 {
     if (null != OverrideInput)
     {
         foreach (string oinp in OverrideInput.Split(';'))
         {
             string inp = oinp.Trim();
             if (inp.Length != 0)
             {
                 remote.InputFiles.Add(inp);
             }
         }
     }
     if (null != OverrideOutput)
     {
         remote.OutputFile = OverrideOutput;
     }
     return(remote.Exec(ParseArgs(args)));
 }
예제 #2
0
            public override string Call(string args)
            {
                if (null != OverrideInput)
                {
                    foreach (string oinp in OverrideInput.Split(';'))
                    {
                        string inp = oinp.Trim();
                        if (inp.Length != 0)
                        {
                            map.InputFiles.Add(inp);
                        }
                    }
                }
                if (null != OverrideOutput)
                {
                    reduce.OutputFile = OverrideOutput;
                }

                bool mrsame = object.ReferenceEquals(map, reduce);

                string[] aargs = ParseArgs(args);
                map.Init(aargs);
                List <KeyValuePair <ByteSlice, ByteSlice> > mapout = map.RunMap();

                map.RunSort(mapout);
                if (!mrsame)
                {
                    reduce.Init(aargs);
                }
                reduce.RunReduce(mapout);
                if (mrsame)
                {
                    return(map.ReadToEnd());
                }
                return(map.ReadToEnd() + reduce.ReadToEnd());
            }