Job job = new Job(conf,"job_name") is just used for setting the user-specified job name. Setting the job name is not mandatory since the job will be assigned a job id anyways. But, if we set a job name it becomes easier to track the status of the job while the job is running. This may not be useful a single small job running but this becomes essential when multiple large jobs are running on the cluster. The job status can be checked using the below command:
yarn application -appStates RUNNING -list
I am running a basic wordcount map-reduce job and simultaneously also keeping an eye on the status of the job by running the above command in a separate terminal. Please refer to the below screenshot and also notice the progress percentage:
Eclipse shows the statement as deprecated because the construction of the Job class that is Job(Confiuration conf, String jobName) is now deprecated. Instead of this, if you use the below code, most probably you will not be getting deprecated warning:
job.setJobName("mywc");