Package org.apache.hadoop.fs.permission

Examples of org.apache.hadoop.fs.permission.FsPermission


    Path stagingArea =
      new Path(conf.get("mapreduce.jobtracker.staging.root.dir",
          "/tmp/hadoop/mapred/staging"));
    LOG.info("Creating Staging root directory : " + stagingArea);
    fs.mkdirs(stagingArea);
    fs.setPermission(stagingArea, new FsPermission((short)0777));
  }
View Full Code Here


              //Since the file is found break out of loop
              if (distCacheFileIsFound){
                LOG.info("PATH found is :" + path.toString());
                distributedFileCount++;
                String filename = path.getName();
                FsPermission fsPerm = fileStatus.getPermission();
                Assert.assertTrue("File Permission is not 777",
                    fsPerm.equals(new FsPermission("777")));
              }
            }
          }

          // Since distributed cache is unmodified in dfs
View Full Code Here

              //Since the file is found break out of loop
              if (distCacheFileIsFound){
                LOG.info("PATH found is :" + path.toString());
                distributedFileCount++;
                String filename = path.getName();
                FsPermission fsPerm = fileStatus.getPermission();
                Assert.assertTrue("File Permission is not 777",
                    fsPerm.equals(new FsPermission("777")));
              }
            }
          }

          LOG.debug("The distributed FileCount is :" + distributedFileCount);
View Full Code Here

  }
 
  public void testLocalDirs() throws Exception {
    Configuration conf = new Configuration();
    final String permStr = "755";
    FsPermission expected = new FsPermission(permStr);
    conf.set(DataNode.DATA_DIR_PERMISSION_KEY, permStr);
    MiniDFSCluster cluster = null;
   
    try {
      // Start the cluster
      cluster =
        new MiniDFSCluster(0, conf, 1, true, 
                          true, false,  null, null, null, null);
      cluster.waitActive();
     
      // Check permissions on directories in 'dfs.data.dir'
      FileSystem localFS = FileSystem.getLocal(conf);
      String[] dataDirs = conf.getStrings(DataNode.DATA_DIR_KEY);
      for (String dir : dataDirs) {
        Path dataDir = new Path(dir);
        FsPermission actual = localFS.getFileStatus(dataDir).getPermission();
        assertEquals("Permission for dir: " + dataDir + ", is " + actual +
                         ", while expected is " + expected,
                     expected, actual);
      }
    } finally {
View Full Code Here

    if (localFs.isFile(localPath)) {
      LOG.debug("Password file is already created by previous path");
      return;
    }
    FSDataOutputStream out = FileSystem.create(localFs, localPath,
        new FsPermission("400"));
    out.write(password);
    out.close();
  }
View Full Code Here

    FSDataOutputStream out = createFile(fs,
        JobSubmissionFiles.getJobSplitFile(jobSubmitDir), conf);
    SplitMetaInfo[] info = writeNewSplits(conf, splits, out);
    out.close();
    writeJobSplitMetaInfo(fs,JobSubmissionFiles.getJobSplitMetaFile(jobSubmitDir),
        new FsPermission(JobSubmissionFiles.JOB_FILE_PERMISSION), splitVersion,
        info);
  }
View Full Code Here

    FSDataOutputStream out = createFile(fs,
        JobSubmissionFiles.getJobSplitFile(jobSubmitDir), conf);
    SplitMetaInfo[] info = writeOldSplits(splits, out);
    out.close();
    writeJobSplitMetaInfo(fs,JobSubmissionFiles.getJobSplitMetaFile(jobSubmitDir),
        new FsPermission(JobSubmissionFiles.JOB_FILE_PERMISSION), splitVersion,
        info);
  }
View Full Code Here

  }
 
  private static FSDataOutputStream createFile(FileSystem fs, Path splitFile,
      Configuration jobthrows IOException {
    FSDataOutputStream out = FileSystem.create(fs, splitFile,
        new FsPermission(JobSubmissionFiles.JOB_FILE_PERMISSION));
    int replication = job.getInt("mapred.submit.replication", 10);
    fs.setReplication(splitFile, (short)replication);
    writeSplitHeader(out);
    return out;
  }
View Full Code Here

      }
      if (!preserve_status) {
        return destFileSys.create(f, true, sizeBuf, reporter);
      }

      FsPermission permission = preseved.contains(FileAttribute.PERMISSION)?
          srcstat.getPermission(): null;
      short replication = preseved.contains(FileAttribute.REPLICATION)?
          srcstat.getReplication(): destFileSys.getDefaultReplication();
      long blockSize = preseved.contains(FileAttribute.BLOCK_SIZE)?
          srcstat.getBlockSize(): destFileSys.getDefaultBlockSize();
View Full Code Here

    } catch (InterruptedException e) {
      throw new IOException(e);
    }
    Path jobDirectory = new Path(stagingArea,
                               NAME + "_" + randomId);
    FsPermission mapredSysPerms =
      new FsPermission(JobSubmissionFiles.JOB_DIR_PERMISSION);
    FileSystem.mkdirs(jobDirectory.getFileSystem(conf), jobDirectory,
                      mapredSysPerms);
    conf.set(JOB_DIR_LABEL, jobDirectory.toString());
    //get a tmp directory for input splits
    FileSystem jobfs = jobDirectory.getFileSystem(conf);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.permission.FsPermission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.