List of usage examples for org.apache.hadoop.hdfs.protocol HdfsConstants LEASE_SOFTLIMIT_PERIOD
long LEASE_SOFTLIMIT_PERIOD
To view the source code for org.apache.hadoop.hdfs.protocol HdfsConstants LEASE_SOFTLIMIT_PERIOD.
Click Source Link
From source file:com.mellanox.r4h.LeaseRenewer.java
License:Apache License
/** Close the given client. */ synchronized void closeClient(final DFSClient dfsc) { dfsclients.remove(dfsc);//from w w w .j a v a2 s. com if (dfsclients.isEmpty()) { if (!isRunning() || isRenewerExpired()) { Factory.INSTANCE.remove(LeaseRenewer.this); return; } if (emptyTime == Long.MAX_VALUE) { // discover the first time that the client list is empty. emptyTime = Time.monotonicNow(); } } // update renewal time if (renewal == dfsc.getHdfsTimeout() / 2) { long min = HdfsConstants.LEASE_SOFTLIMIT_PERIOD; for (DFSClient c : dfsclients) { if (c.getHdfsTimeout() > 0) { final long timeout = c.getHdfsTimeout(); if (timeout < min) { min = timeout; } } } renewal = min / 2; } }