[Rumen] LoggedTaskAttempt#getHostName() returns null. (amarrk)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1199105 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cb7f819b91
commit
6749d1395f
|
@ -29,6 +29,8 @@ Trunk (unreleased changes)
|
|||
uri with no authority. (John George via jitendra)
|
||||
|
||||
BUG FIXES
|
||||
MAPREDUCE-3346. [Rumen] LoggedTaskAttempt#getHostName() returns null.
|
||||
(amarrk)
|
||||
|
||||
MAPREDUCE-2950. [Gridmix] TestUserResolve fails in trunk.
|
||||
(Ravi Gummadi via amarrk)
|
||||
|
|
|
@ -328,11 +328,27 @@ public class LoggedTaskAttempt implements DeepCompare {
|
|||
return hostName;
|
||||
}
|
||||
|
||||
|
||||
void setHostName(String hostName) {
|
||||
this.hostName = hostName;
|
||||
}
|
||||
|
||||
// hostName is saved in the format rackName/NodeName
|
||||
void setHostName(String hostName, String rackName) {
|
||||
this.hostName = hostName == null || rackName == null ? null
|
||||
: rackName.intern() + "/" + hostName.intern();
|
||||
if (hostName == null || hostName.length() == 0) {
|
||||
throw new RuntimeException("Invalid entry! Missing hostname");
|
||||
} else if (rackName == null || rackName.length() == 0) {
|
||||
setHostName(hostName);
|
||||
} else {
|
||||
// make sure that the rackname is prefixed with a '/'
|
||||
if (!rackName.startsWith("/")) {
|
||||
rackName = "/" + rackName;
|
||||
}
|
||||
// make sure that the hostname is prefixed with a '/'
|
||||
if (!hostName.startsWith("/")) {
|
||||
hostName = "/" + hostName;
|
||||
}
|
||||
setHostName(rackName.intern() + hostName.intern());
|
||||
}
|
||||
}
|
||||
|
||||
public long getHdfsBytesRead() {
|
||||
|
|
Loading…
Reference in New Issue