JobImpl implements org.apache.hadoop.mapreduce.v2.app.job.Job, 
  EventHandler<JobEvent> { @VisibleForTesting static void cleanupSharedCacheUploadPolicies(Configuration conf) { Job.setArchiveSharedCacheUploadPolicies(conf, Collections.emptyMap()); Job.setFileSharedCacheUploadPolicies(conf, Collections.emptyMap()); } JobImpl(JobId jobId, ApplicationAttemptId applicationAttemptId,
      Configuration conf, EventHandler eventHandler,
      TaskAttemptListener taskAttemptListener,
      JobTokenSecretManager jobTokenSecretManager,
      Credentials jobCredentials, Clock clock,
      Map<TaskId, TaskInfo> completedTasksFromPreviousRun, MRAppMetrics metrics,
      OutputCommitter committer, boolean newApiCommitter, String userName,
      long appSubmitTime, List<AMInfo> amInfos, AppContext appContext,
      JobStateInternal forcedState, String forcedDiagnostic); @Override JobId getID(); @Override boolean checkAccess(UserGroupInformation callerUGI, 
      JobACL jobOperation); @Override Task getTask(TaskId taskID); @Override int getCompletedMaps(); @Override int getCompletedReduces(); @Override boolean isUber(); @Override Counters getAllCounters(); static Counters incrTaskCounters(
      Counters counters, Collection<Task> tasks); @Override TaskAttemptCompletionEvent[] getTaskAttemptCompletionEvents(
      int fromEventId, int maxEvents); @Override TaskCompletionEvent[] getMapAttemptCompletionEvents(
      int startIndex, int maxEvents); @Override List<String> getDiagnostics(); @Override JobReport getReport(); @Override float getProgress(); @Override Map<TaskId, Task> getTasks(); @Override Map<TaskId,Task> getTasks(TaskType taskType); @Override JobState getState(); @Override /** * The only entry point to change the Job. */ void handle(JobEvent event); @Private JobStateInternal getInternalState(); @Override String getUserName(); @Override String getQueueName(); @Override void setQueueName(String queueName); @Override Path getConfFile(); @Override String getName(); @Override int getTotalMaps(); @Override int getTotalReduces(); @Override Map<JobACL, AccessControlList> getJobACLs(); @Override List<AMInfo> getAMInfos(); static String escapeString(String data); @Private void constructFinalFullcounters(); @Override Configuration loadConfFile(); float getMaxAllowedFetchFailuresFraction(); int getMaxFetchFailuresNotifications(); @Override void setJobPriority(Priority priority); @Override int getFailedMaps(); @Override int getFailedReduces(); @Override int getKilledMaps(); @Override int getKilledReduces(); static final String JOB_KILLED_DIAG; public JobConf conf; public Path remoteJobConfFile; }
@Test public void testCleanupSharedCacheUploadPolicies() { Configuration config = new Configuration(); Map<String, Boolean> archivePolicies = new HashMap<>(); archivePolicies.put("archive1", true); archivePolicies.put("archive2", true); Job.setArchiveSharedCacheUploadPolicies(config, archivePolicies); Map<String, Boolean> filePolicies = new HashMap<>(); filePolicies.put("file1", true); filePolicies.put("jar1", true); Job.setFileSharedCacheUploadPolicies(config, filePolicies); Assert.assertEquals( 2, Job.getArchiveSharedCacheUploadPolicies(config).size()); Assert.assertEquals( 2, Job.getFileSharedCacheUploadPolicies(config).size()); JobImpl.cleanupSharedCacheUploadPolicies(config); Assert.assertEquals( 0, Job.getArchiveSharedCacheUploadPolicies(config).size()); Assert.assertEquals( 0, Job.getFileSharedCacheUploadPolicies(config).size()); }