Exemplo n.º 1
0
 def modify_files(self, i):
     worker_id = i[0]
     path_folder = self.path + "coded_" + str(worker_id) + '/'
     # print("worker", worker_id, "starts")
     fileprocess = FileProcessor(path_folder + "Map/", self.users, self.num_of_links, self.path)
     fileprocess.create_pair_files('', worker_id)
     fileprocess.collect_file_data()
     return
Exemplo n.º 2
0
        # print(reverse_linkdict)
        os.chdir(folder_path)  # change the director for the folder path

        # Created an instance of crawler and pass user number and links file into
        crawler = Crawler(user, "res.txt", reverse_linkdict, linkdict)
        # #Call crawl_and_createfile method to get all target links and create file for each source link
        crawler.crawl_and_createfile()

        fileprocess = FileProcessor(folder_path, user, num_of_links)
        fileprocess.file_filling()
        fileprocess.index_value()
        #    fileprocess.index2pair()
        fileprocess.rename()
        # rename()
        fileprocess.create_pair_files('pair_dir')
        # if need for shuffle and reduce file

        fileprocess.max_len = fileprocess.find_largest()
        fileprocess.write_bin_files()

    if remapping:
        file_transfer = FileTransfer(users, folder_path, path)
        result, number_result = file_transfer.Mapping()

        file_coded_transfer = FileCodedTransfer(users, folder_path, path)
        everything = file_coded_transfer.shufgen()
        print("everything", everything)
        # file_transfer.Call_naive_function(everything)
        file_coded_transfer.Call_coded_function(everything)
        fr = FileReduce(users, folder_path, path)