本文整理汇总了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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}