當前位置: 首頁>>代碼示例>>Java>>正文


Java FsPermission.getUMask方法代碼示例

本文整理匯總了Java中org.apache.hadoop.fs.permission.FsPermission.getUMask方法的典型用法代碼示例。如果您正苦於以下問題:Java FsPermission.getUMask方法的具體用法?Java FsPermission.getUMask怎麽用?Java FsPermission.getUMask使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.fs.permission.FsPermission的用法示例。


在下文中一共展示了FsPermission.getUMask方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FileContext

import org.apache.hadoop.fs.permission.FsPermission; //導入方法依賴的package包/類
private FileContext(final AbstractFileSystem defFs,
  final FsPermission theUmask, final Configuration aConf) {
  defaultFS = defFs;
  umask = FsPermission.getUMask(aConf);
  conf = aConf;
  tracer = FsTracer.get(aConf);
  try {
    ugi = UserGroupInformation.getCurrentUser();
  } catch (IOException e) {
    LOG.error("Exception in getCurrentUser: ",e);
    throw new RuntimeException("Failed to get the current user " +
    		"while creating a FileContext", e);
  }
  /*
   * Init the wd.
   * WorkingDir is implemented at the FileContext layer 
   * NOT at the AbstractFileSystem layer. 
   * If the DefaultFS, such as localFilesystem has a notion of
   *  builtin WD, we use that as the initial WD.
   *  Otherwise the WD is initialized to the home directory.
   */
  workingDir = defaultFS.getInitialWorkingDirectory();
  if (workingDir == null) {
    workingDir = defaultFS.getHomeDirectory();
  }
  resolveSymlinks = conf.getBoolean(
      CommonConfigurationKeys.FS_CLIENT_RESOLVE_REMOTE_SYMLINKS_KEY,
      CommonConfigurationKeys.FS_CLIENT_RESOLVE_REMOTE_SYMLINKS_DEFAULT);
  util = new Util(); // for the inner class
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:31,代碼來源:FileContext.java

示例2: createDir

import org.apache.hadoop.fs.permission.FsPermission; //導入方法依賴的package包/類
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));
  }
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:10,代碼來源:LogAggregationService.java

示例3: FileContext

import org.apache.hadoop.fs.permission.FsPermission; //導入方法依賴的package包/類
private FileContext(final AbstractFileSystem defFs,
  final FsPermission theUmask, final Configuration aConf) {
  defaultFS = defFs;
  umask = FsPermission.getUMask(aConf);
  conf = aConf;
  try {
    ugi = UserGroupInformation.getCurrentUser();
  } catch (IOException e) {
    LOG.error("Exception in getCurrentUser: ",e);
    throw new RuntimeException("Failed to get the current user " +
    		"while creating a FileContext", e);
  }
  /*
   * Init the wd.
   * WorkingDir is implemented at the FileContext layer 
   * NOT at the AbstractFileSystem layer. 
   * If the DefaultFS, such as localFilesystem has a notion of
   *  builtin WD, we use that as the initial WD.
   *  Otherwise the WD is initialized to the home directory.
   */
  workingDir = defaultFS.getInitialWorkingDirectory();
  if (workingDir == null) {
    workingDir = defaultFS.getHomeDirectory();
  }
  resolveSymlinks = conf.getBoolean(
      CommonConfigurationKeys.FS_CLIENT_RESOLVE_REMOTE_SYMLINKS_KEY,
      CommonConfigurationKeys.FS_CLIENT_RESOLVE_REMOTE_SYMLINKS_DEFAULT);
  util = new Util(); // for the inner class
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:30,代碼來源:FileContext.java

示例4: initialize

import org.apache.hadoop.fs.permission.FsPermission; //導入方法依賴的package包/類
@Override
public void initialize(URI uri, Configuration conf) throws IOException {
  super.initialize(uri, conf);
  setConf(conf);
  umask = FsPermission.getUMask(conf);
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:7,代碼來源:RawLocalFileSystem.java

示例5: create

import org.apache.hadoop.fs.permission.FsPermission; //導入方法依賴的package包/類
@Override
public FSDataOutputStream create(Path f, EnumSet<CreateFlag> createFlag,
    CreateOpts... opts) throws AccessControlException,
    FileAlreadyExistsException, FileNotFoundException,
    ParentNotDirectoryException, UnsupportedFileSystemException, IOException {

  // Need to translate the FileContext-style options into FileSystem-style

  // Permissions with umask
  CreateOpts.Perms permOpt = CreateOpts.getOpt(
      CreateOpts.Perms.class, opts);
  FsPermission umask = FsPermission.getUMask(fs.getConf());
  FsPermission permission = (permOpt != null) ? permOpt.getValue()
      : FsPermission.getFileDefault().applyUMask(umask);
  permission = permission.applyUMask(umask);
  // Overwrite
  boolean overwrite = createFlag.contains(CreateFlag.OVERWRITE);
  // bufferSize
  int bufferSize = fs.getConf().getInt(
      CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_KEY,
      CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_DEFAULT);
  CreateOpts.BufferSize bufOpt = CreateOpts.getOpt(
      CreateOpts.BufferSize.class, opts);
  bufferSize = (bufOpt != null) ? bufOpt.getValue() : bufferSize;
  // replication
  short replication = fs.getDefaultReplication(f);
  CreateOpts.ReplicationFactor repOpt =
      CreateOpts.getOpt(CreateOpts.ReplicationFactor.class, opts);
  replication = (repOpt != null) ? repOpt.getValue() : replication;
  // blockSize
  long blockSize = fs.getDefaultBlockSize(f);
  CreateOpts.BlockSize blockOpt = CreateOpts.getOpt(
      CreateOpts.BlockSize.class, opts);
  blockSize = (blockOpt != null) ? blockOpt.getValue() : blockSize;
  // Progressable
  Progressable progress = null;
  CreateOpts.Progress progressOpt = CreateOpts.getOpt(
      CreateOpts.Progress.class, opts);
  progress = (progressOpt != null) ? progressOpt.getValue() : progress;
  return fs.create(f, permission, overwrite, bufferSize, replication,
      blockSize, progress);
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:43,代碼來源:FileSystemTestWrapper.java

示例6: getFileContext

import org.apache.hadoop.fs.permission.FsPermission; //導入方法依賴的package包/類
/**
 * Create a FileContext with specified FS as default using the specified
 * config.
 * 
 * @param defFS
 * @param aConf
 * @return new FileContext with specified FS as default.
 */
public static FileContext getFileContext(final AbstractFileSystem defFS,
                  final Configuration aConf) {
  return new FileContext(defFS, FsPermission.getUMask(aConf), aConf);
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:13,代碼來源:FileContext.java

示例7: getFileContext

import org.apache.hadoop.fs.permission.FsPermission; //導入方法依賴的package包/類
/**
 * Create a FileContext with specified FS as default using the specified
 * config.
 * 
 * @param defFS
 * @param aConf
 * @return new FileContext with specifed FS as default.
 */
public static FileContext getFileContext(final AbstractFileSystem defFS,
                  final Configuration aConf) {
  return new FileContext(defFS, FsPermission.getUMask(aConf), aConf);
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:13,代碼來源:FileContext.java


注:本文中的org.apache.hadoop.fs.permission.FsPermission.getUMask方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。