Merge trunk into HA branch.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1623@1233533 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
commit
3e17cdde56
@ -266,6 +266,9 @@ Release 0.23.1 - UNRELEASED
|
||||
not use ArrayWritable for writing non-array items. (Uma Maheswara Rao G
|
||||
via szetszwo)
|
||||
|
||||
HDFS-2803. Add logging to LeaseRenewer for better lease expiration debugging.
|
||||
(Jimmy Xiang via todd)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
HDFS-2130. Switch default checksum to CRC32C. (todd)
|
||||
|
@ -292,6 +292,10 @@ synchronized void put(final String src, final DFSOutputStream out,
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Lease renewer daemon for " + clientsString()
|
||||
+ " with renew id " + id + " started");
|
||||
}
|
||||
LeaseRenewer.this.run(id);
|
||||
} catch(InterruptedException e) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
@ -302,6 +306,10 @@ public void run() {
|
||||
synchronized(LeaseRenewer.this) {
|
||||
Factory.INSTANCE.remove(LeaseRenewer.this);
|
||||
}
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Lease renewer daemon for " + clientsString()
|
||||
+ " with renew id " + id + " exited");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -401,6 +409,9 @@ public int compare(final DFSClient left, final DFSClient right) {
|
||||
if (!c.getClientName().equals(previousName)) {
|
||||
c.renewLease();
|
||||
previousName = c.getClientName();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Lease renewed for client " + previousName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -416,6 +427,10 @@ private void run(final int id) throws InterruptedException {
|
||||
if (System.currentTimeMillis() - lastRenewed >= getRenewalTime()) {
|
||||
try {
|
||||
renew();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Lease renewer daemon for " + clientsString()
|
||||
+ " with renew id " + id + " executed");
|
||||
}
|
||||
lastRenewed = System.currentTimeMillis();
|
||||
} catch (SocketTimeoutException ie) {
|
||||
LOG.warn("Failed to renew lease for " + clientsString() + " for "
|
||||
@ -435,6 +450,15 @@ private void run(final int id) throws InterruptedException {
|
||||
|
||||
synchronized(this) {
|
||||
if (id != currentId || isRenewerExpired()) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
if (id != currentId) {
|
||||
LOG.debug("Lease renewer daemon for " + clientsString()
|
||||
+ " with renew id " + id + " is not current");
|
||||
} else {
|
||||
LOG.debug("Lease renewer daemon for " + clientsString()
|
||||
+ " with renew id " + id + " expired");
|
||||
}
|
||||
}
|
||||
//no longer the current daemon or expired
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user