• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IdMappingConstant类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.apache.hadoop.security.IdMappingConstant的典型用法代码示例。如果您正苦于以下问题:Java IdMappingConstant类的具体用法?Java IdMappingConstant怎么用?Java IdMappingConstant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IdMappingConstant类属于org.apache.hadoop.security包,在下文中一共展示了IdMappingConstant类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addDeprecatedKeys

点赞 3

import org.apache.hadoop.security.IdMappingConstant; //导入依赖的package包/类
private static void addDeprecatedKeys() {
  Configuration.addDeprecations(new DeprecationDelta[] {
      new DeprecationDelta("nfs3.server.port",
          NfsConfigKeys.DFS_NFS_SERVER_PORT_KEY),
      new DeprecationDelta("nfs3.mountd.port",
          NfsConfigKeys.DFS_NFS_MOUNTD_PORT_KEY),
      new DeprecationDelta("dfs.nfs.exports.cache.size",
          Nfs3Constant.NFS_EXPORTS_CACHE_SIZE_KEY),
      new DeprecationDelta("dfs.nfs.exports.cache.expirytime.millis",
          Nfs3Constant.NFS_EXPORTS_CACHE_EXPIRYTIME_MILLIS_KEY),
      new DeprecationDelta("hadoop.nfs.userupdate.milly",
          IdMappingConstant.USERGROUPID_UPDATE_MILLIS_KEY),
      new DeprecationDelta("nfs.usergroup.update.millis",
          IdMappingConstant.USERGROUPID_UPDATE_MILLIS_KEY),
      new DeprecationDelta("nfs.static.mapping.file",
          IdMappingConstant.STATIC_ID_MAPPING_FILE_KEY),
      new DeprecationDelta("dfs.nfs3.enableDump",
          NfsConfigKeys.DFS_NFS_FILE_DUMP_KEY),
      new DeprecationDelta("dfs.nfs3.dump.dir",
          NfsConfigKeys.DFS_NFS_FILE_DUMP_DIR_KEY),
      new DeprecationDelta("dfs.nfs3.max.open.files",
          NfsConfigKeys.DFS_NFS_MAX_OPEN_FILES_KEY),
      new DeprecationDelta("dfs.nfs3.stream.timeout",
          NfsConfigKeys.DFS_NFS_STREAM_TIMEOUT_KEY),
      new DeprecationDelta("dfs.nfs3.export.point",
          NfsConfigKeys.DFS_NFS_EXPORT_POINT_KEY),
      new DeprecationDelta("nfs.allow.insecure.ports",
          NfsConfigKeys.DFS_NFS_PORT_MONITORING_DISABLED_KEY),
      new DeprecationDelta("dfs.nfs.keytab.file",
          NfsConfigKeys.DFS_NFS_KEYTAB_FILE_KEY),
      new DeprecationDelta("dfs.nfs.kerberos.principal",
          NfsConfigKeys.DFS_NFS_KERBEROS_PRINCIPAL_KEY),
      new DeprecationDelta("dfs.nfs.rtmax",
          NfsConfigKeys.DFS_NFS_MAX_READ_TRANSFER_SIZE_KEY),
      new DeprecationDelta("dfs.nfs.wtmax",
          NfsConfigKeys.DFS_NFS_MAX_WRITE_TRANSFER_SIZE_KEY),
      new DeprecationDelta("dfs.nfs.dtmax",
          NfsConfigKeys.DFS_NFS_MAX_READDIR_TRANSFER_SIZE_KEY) });
}
 

开发者ID:naver,
项目名称:hadoop,
代码行数:40,
代码来源:NfsConfiguration.java

示例2: setattrInternal

点赞 2

import org.apache.hadoop.security.IdMappingConstant; //导入依赖的package包/类
private void setattrInternal(DFSClient dfsClient, String fileIdPath,
    SetAttr3 newAttr, boolean setMode) throws IOException {
  EnumSet<SetAttrField> updateFields = newAttr.getUpdateFields();

  if (setMode && updateFields.contains(SetAttrField.MODE)) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("set new mode: " + newAttr.getMode());
    }
    dfsClient.setPermission(fileIdPath,
        new FsPermission((short) (newAttr.getMode())));
  }
  if (updateFields.contains(SetAttrField.UID)
      || updateFields.contains(SetAttrField.GID)) {
    String uname = updateFields.contains(SetAttrField.UID) ? iug.getUserName(
        newAttr.getUid(), IdMappingConstant.UNKNOWN_USER) : null;
    String gname = updateFields.contains(SetAttrField.GID) ? iug
        .getGroupName(newAttr.getGid(), IdMappingConstant.UNKNOWN_GROUP) : null;
    dfsClient.setOwner(fileIdPath, uname, gname);
  }

  long atime = updateFields.contains(SetAttrField.ATIME) ? newAttr.getAtime()
      .getMilliSeconds() : -1;
  long mtime = updateFields.contains(SetAttrField.MTIME) ? newAttr.getMtime()
      .getMilliSeconds() : -1;
  if (atime != -1 || mtime != -1) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("set atime: " + +atime + " mtime: " + mtime);
    }
    dfsClient.setTimes(fileIdPath, mtime, atime);
  }
}
 

开发者ID:naver,
项目名称:hadoop,
代码行数:32,
代码来源:RpcProgramNfs3.java

示例3: testDeprecatedKeys

点赞 2

import org.apache.hadoop.security.IdMappingConstant; //导入依赖的package包/类
@Test
public void testDeprecatedKeys() {
  NfsConfiguration conf = new NfsConfiguration();
  conf.setInt("nfs3.server.port", 998);
  assertTrue(conf.getInt(NfsConfigKeys.DFS_NFS_SERVER_PORT_KEY, 0) == 998);

  conf.setInt("nfs3.mountd.port", 999);
  assertTrue(conf.getInt(NfsConfigKeys.DFS_NFS_MOUNTD_PORT_KEY, 0) == 999);

  conf.set("dfs.nfs.exports.allowed.hosts", "host1");
  assertTrue(conf.get(CommonConfigurationKeys.NFS_EXPORTS_ALLOWED_HOSTS_KEY)
      .equals("host1"));

  conf.setInt("dfs.nfs.exports.cache.expirytime.millis", 1000);
  assertTrue(conf.getInt(
      Nfs3Constant.NFS_EXPORTS_CACHE_EXPIRYTIME_MILLIS_KEY, 0) == 1000);

  conf.setInt("hadoop.nfs.userupdate.milly", 10);
  assertTrue(conf.getInt(IdMappingConstant.USERGROUPID_UPDATE_MILLIS_KEY, 0) == 10);

  conf.set("dfs.nfs3.dump.dir", "/nfs/tmp");
  assertTrue(conf.get(NfsConfigKeys.DFS_NFS_FILE_DUMP_DIR_KEY).equals(
      "/nfs/tmp"));

  conf.setBoolean("dfs.nfs3.enableDump", false);
  assertTrue(conf.getBoolean(NfsConfigKeys.DFS_NFS_FILE_DUMP_KEY, true) == false);

  conf.setInt("dfs.nfs3.max.open.files", 500);
  assertTrue(conf.getInt(NfsConfigKeys.DFS_NFS_MAX_OPEN_FILES_KEY, 0) == 500);

  conf.setInt("dfs.nfs3.stream.timeout", 6000);
  assertTrue(conf.getInt(NfsConfigKeys.DFS_NFS_STREAM_TIMEOUT_KEY, 0) == 6000);

  conf.set("dfs.nfs3.export.point", "/dir1");
  assertTrue(conf.get(NfsConfigKeys.DFS_NFS_EXPORT_POINT_KEY).equals("/dir1"));
}
 

开发者ID:naver,
项目名称:hadoop,
代码行数:37,
代码来源:TestRpcProgramNfs3.java

示例4: getUser

点赞 2

import org.apache.hadoop.security.IdMappingConstant; //导入依赖的package包/类
@Override
public String getUser() {
  return iug.getUserName(mCredentialsSys.getUID(),
      IdMappingConstant.UNKNOWN_USER);
}
 

开发者ID:naver,
项目名称:hadoop,
代码行数:6,
代码来源:SysSecurityHandler.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)