本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease.getLastUpdate方法的典型用法代码示例。如果您正苦于以下问题:Java Lease.getLastUpdate方法的具体用法?Java Lease.getLastUpdate怎么用?Java Lease.getLastUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease
的用法示例。
在下文中一共展示了Lease.getLastUpdate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLeaseRenewalTime
import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease; //导入方法依赖的package包/类
/**
* @return the timestamp of the last renewal of the given lease,
* or -1 in the case that the lease doesn't exist.
*/
public static long getLeaseRenewalTime(NameNode nn, String path) {
LeaseManager lm = nn.getNamesystem().leaseManager;
Lease l = lm.getLeaseByPath(path);
if (l == null) {
return -1;
}
return l.getLastUpdate();
}
示例2: getLeaseRenewalTime
import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease; //导入方法依赖的package包/类
/**
* @return the timestamp of the last renewal of the given lease,
* or -1 in the case that the lease doesn't exist.
*/
public static long getLeaseRenewalTime(NameNode nn, String path) {
Lease l = getLeaseForPath(nn, path);
return l == null ? -1 : l.getLastUpdate();
}