HDFS-2859. LOCAL_ADDRESS_MATCHER.match has NPE when called from DFSUtil.getSuffixIDs when the host is incorrect. Contributed by Bikas Saha.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1623@1239356 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
048c416beb
commit
4d779e088a
@ -149,3 +149,5 @@ HDFS-2845. SBN should not allow browsing of the file system via web UI. (Bikas S
|
||||
HDFS-2742. HA: observed dataloss in replication stress test. (todd via eli)
|
||||
|
||||
HDFS-2870. Fix log level for block debug info in processMisReplicatedBlocks (todd)
|
||||
|
||||
HDFS-2859. LOCAL_ADDRESS_MATCHER.match has NPE when called from DFSUtil.getSuffixIDs when the host is incorrect (Bikas Saha via todd)
|
||||
|
@ -61,6 +61,8 @@
|
||||
import org.apache.hadoop.net.NetUtils;
|
||||
import org.apache.hadoop.net.NodeBase;
|
||||
import org.apache.hadoop.security.UserGroupInformation;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.Lists;
|
||||
@ -69,6 +71,8 @@
|
||||
|
||||
@InterfaceAudience.Private
|
||||
public class DFSUtil {
|
||||
private static final Log LOG = LogFactory.getLog(DFSUtil.class.getName());
|
||||
|
||||
private DFSUtil() { /* Hidden constructor */ }
|
||||
private static final ThreadLocal<Random> RANDOM = new ThreadLocal<Random>() {
|
||||
@Override
|
||||
@ -935,9 +939,10 @@ static String[] getSuffixIDs(final Configuration conf, final String addressKey,
|
||||
try {
|
||||
s = NetUtils.createSocketAddr(addr);
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Exception in creating socket address", e);
|
||||
continue;
|
||||
}
|
||||
if (matcher.match(s)) {
|
||||
if (!s.isUnresolved() && matcher.match(s)) {
|
||||
nameserviceId = nsId;
|
||||
namenodeId = nnId;
|
||||
found++;
|
||||
|
Loading…
Reference in New Issue
Block a user