当前位置: 首页>>代码示例>>Java>>正文


Java Lease.getHolder方法代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease.getHolder方法的典型用法代码示例。如果您正苦于以下问题:Java Lease.getHolder方法的具体用法?Java Lease.getHolder怎么用?Java Lease.getHolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease的用法示例。


在下文中一共展示了Lease.getHolder方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRandomFileStats

import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease; //导入方法依赖的package包/类
/**
 * Retrieves a list of random files with some information.
 *
 * @param percent
 *          the percent of files to return
 * @return the list of files
 */
public List<FileStatusExtended> getRandomFileStats(double percent) {
  readLock();
  try {
    List<FileStatusExtended> stats = new LinkedList<FileStatusExtended>();
    for (INodeFile file : getRandomFiles(percent)) {
      try {
        String path = file.getFullPathName();
        FileStatus stat = createFileStatus(path, file);
        Lease lease = this.getFSNamesystem().leaseManager.getLeaseByPath(path);
        String holder = (lease == null) ? null : lease.getHolder();
        long hardlinkId = (file instanceof INodeHardLinkFile) ? ((INodeHardLinkFile) file)
            .getHardLinkID() : -1;
            stats.add(new FileStatusExtended(stat, file.getBlocks(), holder,
                hardlinkId));
      } catch (IOException ioe) {
        // the file has already been deleted; ingore it
      }
    }
    return stats;
  } finally {
    readUnlock();
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:31,代码来源:FSDirectory.java

示例2: getRandomFileStats

import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease; //导入方法依赖的package包/类
/**
 * Retrieves a list of random files with some information.
 * 
 * @param maxFiles
 *          the maximum number of files to return
 * @return the list of files
 */
public List<FileStatusExtended> getRandomFileStats(int maxFiles) {
  readLock();
  try {
    List<FileStatusExtended> stats = new LinkedList<FileStatusExtended>();
    for (INodeFile file : getRandomFiles(maxFiles)) {
      String path = file.getFullPathName();
      FileStatus stat = createFileStatus(path, file);
      Lease lease = this.getFSNamesystem().leaseManager.getLeaseByPath(path);
      String holder = (lease == null) ? null : lease.getHolder();
      stats.add(new FileStatusExtended(stat, file.getBlocks(), holder));
    }
    return stats;
  } finally {
    readUnlock();
  }
}
 
开发者ID:iVCE,项目名称:RDFS,代码行数:24,代码来源:FSDirectory.java

示例3: getLeaseHolderForPath

import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease; //导入方法依赖的package包/类
public static String getLeaseHolderForPath(NameNode namenode, String path) {
  Lease l = namenode.getNamesystem().leaseManager.getLeaseByPath(path);
  return l == null? null: l.getHolder();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:NameNodeAdapter.java

示例4: getLeaseHolderForPath

import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease; //导入方法依赖的package包/类
public static String getLeaseHolderForPath(NameNode namenode, String path) {
  Lease l = getLeaseForPath(namenode, path);
  return l == null? null: l.getHolder();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:5,代码来源:NameNodeAdapter.java

示例5: getFileInfoExtended

import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease; //导入方法依赖的package包/类
public FileStatusExtended getFileInfoExtended(String src) throws IOException {
  Lease lease = leaseManager.getLeaseByPath(src);
  String leaseHolder = (lease == null) ? "" : lease.getHolder();
  return getFileInfoExtended(src, leaseHolder);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:6,代码来源:FSNamesystem.java

示例6: getFileInfoExtended

import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease; //导入方法依赖的package包/类
FileStatusExtended getFileInfoExtended(String src) throws IOException {
  Lease lease = leaseManager.getLeaseByPath(src);
  String leaseHolder = (lease == null) ? "" : lease.getHolder();
  return getFileInfoExtended(src, leaseHolder);
}
 
开发者ID:iVCE,项目名称:RDFS,代码行数:6,代码来源:FSNamesystem.java


注:本文中的org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease.getHolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。