org.apache.hadoop.io.nativeio.NativeIO.ensureInitialized()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.apache.hadoop.io.nativeio.NativeIO.ensureInitialized()方法的一些代码示例,展示了NativeIO.ensureInitialized()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NativeIO.ensureInitialized()方法的具体详情如下:
包路径:org.apache.hadoop.io.nativeio.NativeIO
类名称:NativeIO
方法名:ensureInitialized

NativeIO.ensureInitialized介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

public static String getOwner(FileDescriptor fd) throws IOException {
 ensureInitialized();
 if (Shell.WINDOWS) {
  String owner = Windows.getOwner(fd);
  owner = stripDomain(owner);
  return owner;
 } else {
  long uid = POSIX.getUIDforFDOwnerforOwner(fd);
  CachedUid cUid = uidCache.get(uid);
  long now = System.currentTimeMillis();
  if (cUid != null && (cUid.timestamp + cacheTimeout) > now) {
   return cUid.username;
  }
  String user = POSIX.getUserName(uid);
  LOG.info("Got UserName " + user + " for UID " + uid
    + " from the native implementation");
  cUid = new CachedUid(user, now);
  uidCache.put(uid, cUid);
  return user;
 }
}

代码示例来源:origin: io.hops/hadoop-common

public static String getOwner(FileDescriptor fd) throws IOException {
 ensureInitialized();
 if (Shell.WINDOWS) {
  String owner = Windows.getOwner(fd);
  owner = stripDomain(owner);
  return owner;
 } else {
  long uid = POSIX.getUIDforFDOwnerforOwner(fd);
  CachedUid cUid = uidCache.get(uid);
  long now = System.currentTimeMillis();
  if (cUid != null && (cUid.timestamp + cacheTimeout) > now) {
   return cUid.username;
  }
  String user = POSIX.getUserName(uid);
  LOG.info("Got UserName " + user + " for UID " + uid
    + " from the native implementation");
  cUid = new CachedUid(user, now);
  uidCache.put(uid, cUid);
  return user;
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

public static String getOwner(FileDescriptor fd) throws IOException {
 ensureInitialized();
 if (Shell.WINDOWS) {
  String owner = Windows.getOwner(fd);
  owner = stripDomain(owner);
  return owner;
 } else {
  long uid = POSIX.getUIDforFDOwnerforOwner(fd);
  CachedUid cUid = uidCache.get(uid);
  long now = System.currentTimeMillis();
  if (cUid != null && (cUid.timestamp + cacheTimeout) > now) {
   return cUid.username;
  }
  String user = POSIX.getUserName(uid);
  LOG.info("Got UserName " + user + " for UID " + uid
    + " from the native implementation");
  cUid = new CachedUid(user, now);
  uidCache.put(uid, cUid);
  return user;
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

public static String getOwner(FileDescriptor fd) throws IOException {
 ensureInitialized();
 if (Shell.WINDOWS) {
  String owner = Windows.getOwner(fd);
  owner = stripDomain(owner);
  return owner;
 } else {
  long uid = POSIX.getUIDforFDOwnerforOwner(fd);
  CachedUid cUid = uidCache.get(uid);
  long now = System.currentTimeMillis();
  if (cUid != null && (cUid.timestamp + cacheTimeout) > now) {
   return cUid.username;
  }
  String user = POSIX.getUserName(uid);
  LOG.info("Got UserName " + user + " for UID " + uid
    + " from the native implementation");
  cUid = new CachedUid(user, now);
  uidCache.put(uid, cUid);
  return user;
 }
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

public static String getOwner(FileDescriptor fd) throws IOException {
 ensureInitialized();
 if (Shell.WINDOWS) {
  String owner = Windows.getOwner(fd);
  owner = stripDomain(owner);
  return owner;
 } else {
  long uid = POSIX.getUIDforFDOwnerforOwner(fd);
  CachedUid cUid = uidCache.get(uid);
  long now = System.currentTimeMillis();
  if (cUid != null && (cUid.timestamp + cacheTimeout) > now) {
   return cUid.username;
  }
  String user = POSIX.getUserName(uid);
  LOG.info("Got UserName " + user + " for UID " + uid
    + " from the native implementation");
  cUid = new CachedUid(user, now);
  uidCache.put(uid, cUid);
  return user;
 }
}

相关文章