Bladeren bron

HDFS-4496. DFSClient: don't create a domain socket unless we need it. Contributed by Colin Patrick McCabe.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-347@1445491 13f79535-47bb-0310-9956-ffa450edef68
Todd Lipcon 12 jaren geleden
bovenliggende
commit
27e158362c

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt

@@ -45,3 +45,5 @@ HDFS-4473. Don't create domain socket unless we need it. (Colin Patrick McCabe v
 HDFS-4485. DN should chmod socket path a+w. (Colin Patrick McCabe via atm)
 
 HDFS-4453. Make a simple doc to describe the usage and design of the shortcircuit read feature. (Colin Patrick McCabe via atm)
+
+HDFS-4496. DFSClient: don't create a domain socket unless we need it (Colin Patrick McCabe via todd)

+ 4 - 0
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DomainSocketFactory.java

@@ -85,6 +85,10 @@ class DomainSocketFactory {
     // If there is no domain socket path configured, we can't use domain
     // sockets.
     if (conf.domainSocketPath.isEmpty()) return null;
+    // If we can't do anything with the domain socket, don't create it.
+    if (!(conf.domainSocketDataTraffic || conf.shortCircuitLocalReads)) {
+      return null;
+    }
     // UNIX domain sockets can only be used to talk to local peers
     if (!DFSClient.isLocalAddress(addr)) return null;
     // If the DomainSocket code is not loaded, we can't create