public object Any(Ls request)
        {
            var result = DfsUtils.listFiles();

            return(new LsResponse {
                Result = new List <FileHeader>(result.Item1.Values.ToArray()), inactiveWorkers = result.Item2
            });
        }
Exemple #2
0
        public static List <TaskAssigment> scheduleMRJob(string fileIn, string fileOut)
        {
            var listResult         = DfsUtils.listFiles();
            var listOfActiveWorker = WorkersUtil.listOfWorkers.Except(listResult.Item2).ToList();
            var files = listResult.Item1;

            if (files.ContainsKey(fileOut))
            {
                throw new ArgumentException("Output file already exists!");
            }
            if (!files.ContainsKey(fileIn))
            {
                throw new ArgumentException("Input file does not exists!");
            }
            if (files [fileIn].corrupted)
            {
                throw new ArgumentException("Input file is corrupted: starting MapReduce is inpossible!");
            }

            return(assignTaskToWorkers(files [fileIn], listOfActiveWorker));
        }
        public static List <string> getActiveWorkers()
        {
            var lsResult = DfsUtils.listFiles();

            return(WorkersUtil.listOfWorkers.Except(lsResult.Item2).ToList());
        }