ClientDistributedCacheManager { public static void determineCacheVisibilities(Configuration job, Map<URI, FileStatus> statCache) throws IOException { URI[] tarchives = DistributedCache.getCacheArchives(job); if (tarchives != null) { StringBuilder archiveVisibilities = new StringBuilder(String.valueOf(isPublic(job, tarchives[0], statCache))); for (int i = 1; i < tarchives.length; i++) { archiveVisibilities.append(","); archiveVisibilities.append(String.valueOf(isPublic(job, tarchives[i], statCache))); } setArchiveVisibilities(job, archiveVisibilities.toString()); } URI[] tfiles = DistributedCache.getCacheFiles(job); if (tfiles != null) { StringBuilder fileVisibilities = new StringBuilder(String.valueOf(isPublic(job, tfiles[0], statCache))); for (int i = 1; i < tfiles.length; i++) { fileVisibilities.append(","); fileVisibilities.append(String.valueOf(isPublic(job, tfiles[i], statCache))); } setFileVisibilities(job, fileVisibilities.toString()); } }  static void determineTimestampsAndCacheVisibilities(Configuration job); static void determineTimestamps(Configuration job,
      Map<URI, FileStatus> statCache); static void getDelegationTokens(Configuration job,
      Credentials credentials); static void determineCacheVisibilities(Configuration job,
      Map<URI, FileStatus> statCache);  }
@Test public void testDetermineCacheVisibilities() throws IOException { fs.setWorkingDirectory(TEST_VISIBILITY_CHILD_DIR); fs.setPermission(TEST_VISIBILITY_CHILD_DIR, new FsPermission((short)00777)); fs.setPermission(TEST_VISIBILITY_PARENT_DIR, new FsPermission((short)00700)); Job job = Job.getInstance(conf); Path relativePath = new Path("thirdCachefile"); job.addCacheFile(relativePath.toUri()); Configuration jobConf = job.getConfiguration(); Map<URI, FileStatus> statCache = new HashMap<URI, FileStatus>(); ClientDistributedCacheManager. determineCacheVisibilities(jobConf, statCache); Assert.assertFalse(jobConf. getBoolean(MRJobConfig.CACHE_FILE_VISIBILITIES,true)); }