org.apache.hadoop.fs.permission.FsPermission#equals ( )源码实例Demo

下面列出了org.apache.hadoop.fs.permission.FsPermission#equals ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: hadoop   文件: ContainerLocalizer.java
private static void createDir(FileContext lfs, Path dirPath,
    FsPermission perms, boolean createParent) throws IOException {
  lfs.mkdir(dirPath, perms, createParent);
  if (!perms.equals(perms.applyUMask(lfs.getUMask()))) {
    lfs.setPermission(dirPath, perms);
  }
}
 
源代码2 项目: hadoop   文件: LogAggregationService.java
private void createDir(FileSystem fs, Path path, FsPermission fsPerm)
    throws IOException {
  FsPermission dirPerm = new FsPermission(fsPerm);
  fs.mkdirs(path, dirPerm);
  FsPermission umask = FsPermission.getUMask(fs.getConf());
  if (!dirPerm.equals(dirPerm.applyUMask(umask))) {
    fs.setPermission(path, new FsPermission(fsPerm));
  }
}
 
源代码3 项目: hadoop   文件: DockerContainerExecutor.java
protected void createDir(Path dirPath, FsPermission perms,
                         boolean createParent, String user) throws IOException {
  lfs.mkdir(dirPath, perms, createParent);
  if (!perms.equals(perms.applyUMask(lfs.getUMask()))) {
    lfs.setPermission(dirPath, perms);
  }
}
 
源代码4 项目: hadoop   文件: DirectoryCollection.java
private void createDir(FileContext localFs, Path dir, FsPermission perm)
    throws IOException {
  if (dir == null) {
    return;
  }
  try {
    localFs.getFileStatus(dir);
  } catch (FileNotFoundException e) {
    createDir(localFs, dir.getParent(), perm);
    localFs.mkdir(dir, perm, false);
    if (!perm.equals(perm.applyUMask(localFs.getUMask()))) {
      localFs.setPermission(dir, perm);
    }
  }
}
 
源代码5 项目: hadoop   文件: DefaultContainerExecutor.java
protected void createDir(Path dirPath, FsPermission perms,
    boolean createParent, String user) throws IOException {
  lfs.mkdir(dirPath, perms, createParent);
  if (!perms.equals(perms.applyUMask(lfs.getUMask()))) {
    lfs.setPermission(dirPath, perms);
  }
}
 
源代码6 项目: big-c   文件: ContainerLocalizer.java
private static void createDir(FileContext lfs, Path dirPath,
    FsPermission perms, boolean createParent) throws IOException {
  lfs.mkdir(dirPath, perms, createParent);
  if (!perms.equals(perms.applyUMask(lfs.getUMask()))) {
    lfs.setPermission(dirPath, perms);
  }
}
 
源代码7 项目: big-c   文件: LogAggregationService.java
private void createDir(FileSystem fs, Path path, FsPermission fsPerm)
    throws IOException {
  FsPermission dirPerm = new FsPermission(fsPerm);
  fs.mkdirs(path, dirPerm);
  FsPermission umask = FsPermission.getUMask(fs.getConf());
  if (!dirPerm.equals(dirPerm.applyUMask(umask))) {
    fs.setPermission(path, new FsPermission(fsPerm));
  }
}
 
源代码8 项目: big-c   文件: DockerContainerExecutor.java
protected void createDir(Path dirPath, FsPermission perms,
                         boolean createParent, String user) throws IOException {
  lfs.mkdir(dirPath, perms, createParent);
  if (!perms.equals(perms.applyUMask(lfs.getUMask()))) {
    lfs.setPermission(dirPath, perms);
  }
}
 
源代码9 项目: big-c   文件: DirectoryCollection.java
private void createDir(FileContext localFs, Path dir, FsPermission perm)
    throws IOException {
  if (dir == null) {
    return;
  }
  try {
    localFs.getFileStatus(dir);
  } catch (FileNotFoundException e) {
    createDir(localFs, dir.getParent(), perm);
    localFs.mkdir(dir, perm, false);
    if (!perm.equals(perm.applyUMask(localFs.getUMask()))) {
      localFs.setPermission(dir, perm);
    }
  }
}
 
源代码10 项目: big-c   文件: DefaultContainerExecutor.java
protected void createDir(Path dirPath, FsPermission perms,
    boolean createParent, String user) throws IOException {
  lfs.mkdir(dirPath, perms, createParent);
  if (!perms.equals(perms.applyUMask(lfs.getUMask()))) {
    lfs.setPermission(dirPath, perms);
  }
}
 
源代码11 项目: hbase   文件: MasterFileSystem.java
/**
 * Make sure the directories under rootDir have good permissions. Create if necessary.
 * @param p
 * @throws IOException
 */
private void checkSubDir(final Path p, final String dirPermsConfName) throws IOException {
  FileSystem fs = p.getFileSystem(conf);
  FsPermission dirPerms = new FsPermission(conf.get(dirPermsConfName, "700"));
  if (!fs.exists(p)) {
    if (isSecurityEnabled) {
      if (!fs.mkdirs(p, secureRootSubDirPerms)) {
        throw new IOException("HBase directory '" + p + "' creation failure.");
      }
    } else {
      if (!fs.mkdirs(p)) {
        throw new IOException("HBase directory '" + p + "' creation failure.");
      }
    }
  }
  else {
    if (isSecurityEnabled && !dirPerms.equals(fs.getFileStatus(p).getPermission())) {
      // check whether the permission match
      LOG.warn("Found HBase directory permissions NOT matching expected permissions for "
          + p.toString() + " permissions=" + fs.getFileStatus(p).getPermission()
          + ", expecting " + dirPerms + ". Automatically setting the permissions. "
          + "You can change the permissions by setting \"" + dirPermsConfName + "\" in hbase-site.xml "
          + "and restarting the master");
      fs.setPermission(p, dirPerms);
    }
  }
}
 
源代码12 项目: hadoop   文件: FSDownload.java
private void createDir(Path path, FsPermission perm) throws IOException {
  files.mkdir(path, perm, false);
  if (!perm.equals(files.getUMask().applyUMask(perm))) {
    files.setPermission(path, perm);
  }
}
 
源代码13 项目: big-c   文件: FSDownload.java
private void createDir(Path path, FsPermission perm) throws IOException {
  files.mkdir(path, perm, false);
  if (!perm.equals(files.getUMask().applyUMask(perm))) {
    files.setPermission(path, perm);
  }
}