Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

in paython pls with comments I want question No 2 Show transcribed image text 2:

ID: 3727083 • Letter: I

Question

in paython pls with comments I want question No 2

Show transcribed image text

2:25 albaha.blackboard.com mobily I Processing Jobs in Distributed Platform This assignment is for assisting you to understand more about Hadoop technology, so be patient when you try to solve it Question 1: "Creating the jobs for processing" 1- Create in your root directory folder called jobs. Inside the folder, create three files or mores with the extend of.txt 2- Each file should include English text. Bring these text from on line articles 3- In your python create a program that opens these files, reads thenm 4 For each read files, the program should remove every vowels from the text, and write the result in a new files Question2: "Creating simple Yarn architecture" Write a python program that has four types of classes: 1 Class Jobs which has the following attributes (number: int, name: string, input file: file, output file: file), methods (setJobs, getJobs) and the constructors for the class 2- Class Client which has the following attributes( number: int, name: string, List of SubmittedJobs:Jobs, List of ProcessedJobs: Jobs), methods Setter/Getter, constructors, SendJobsToResourceManager, ReceivedProceeedJobs: List Jobs), Methods setter/getter constructors, 3- Class ResourceManager which has the following attributes(number: int, name: string, RecievedJobsFromClient List Jobs, ProcessedJobs:List Jobs, ReceivedProceeedJobs: List Jobs), Methods setter/getter, constructors, Allocation(), SentJobsToNodes (0, GetNodesResources), 4- Class Nodes which has the following attributes(number : int, name string, AssignedJobs: List Jobs, ProcessJob: Job, FinishedProcessing List Jobs), methods getter/setter, constructors, SendAvaliable Resources), GetlobToProcess), ProcessJobs(), AddJobsTofinish(), SendFinishedJobsToResoucesManager()

Explanation / Answer

class Jobs:      #jobs class

               number

               name

               infile = open('filename')     #input file

               outfile = open('filename', 'w')   #output file

              

               def set_Jobs(self, jobs):   #setter method for jobs

                              self.__jobs = jobs

                             

                             

               def get_Jobs(self):    #getter method for jobs

                              return self.jobs

              

                             

               def __init__(self, name, number):    #constructor

                              self.__number = number

                              self.__name = name

              

class Client(Jobs):     #client class

               number

               name

               SubmittedJobs = list()

               ProcessedJobs = list()

              

               def __init__(self, name, number):   #constructor

                              self.__number = number

                              self.__name = name

              

              

               def set_name(self, name)     #setter method

                              self.__name = name

              

               def get_name(self):           #getter method

        return self.__name

       

    def set_number(self, number):     #setter method

               self.__number = number

              

        def get_number(self):               #getter method

               return self.__number

              

    def sendJobsToResourceManager(self,SubmittedJobs):       #sending jobs to resources manages

               return self.SubmittedJobs

            

        def receivedProceedJobs(self, ProcessedJobs):      #return processed jobs

               self.ProcessedJobs

class ResourceManager(Client):          #ResourceManager class

              

               jobs = 'sendJobsToResourceManager'          #jobs function from ResourceManager

               ReceivedJobsFromClient = getattr(Client, jobs)     # all received jobs from client

               processed_jobs = 'receivedProceedJobs'

               ReceivedProcessedJobs = getattr(Client, processed_jobs) ## all received processed jobs from client

              

               ProcessedJobs

              

              

               def sentJobsToNodes(self, ReceivedJobsFromClient):    #sending jobs to Nodes

                              return self.ReceivedJobsFromClient

              

               def Allocation(self):                           #allocation method

              

               def getNodesResources(self):           #resources methods from Nodes

              

                             

               def __init__(self, name, number):      #constructor

                              self.__number = number

                              self.__name = name

class Nodes(ResourceManager):

               AssignedJobs = getattr(ResourceManager,'ReceivedProcessedJobs')

               ProcessJob = getattr(ResourceManager, 'sentJobsToNodes' )

               FinishedProcessing

              

                             

               def __init__(self, name, number):     #constructor

                              self.__number = number

                              self.__name = name

                             

               def sendAvailableResources(self, resources):

                              return self.resources

              

               def getJobToProcess(self):

              

               def ProcessJobs(self):

              

               def addJobsToFinish(self):

              

               def FinishedJobsToResourceManager(self):