diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-08-30 15:50:05 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-08-30 15:50:05 +0200 |
commit | 6f115c564f92919d04f14d0c375a40ff35be41f1 (patch) | |
tree | ac285861c82410b82b7d4140eb4bc9e858573f52 /configserver | |
parent | ea77181347a0837a69c883fe7a382e648aa9679e (diff) |
Replace last usage of LinuxInetAddress by HostName
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java index acd640002fa..310c7ceeef7 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/rpc/GetConfigProcessor.java @@ -6,7 +6,7 @@ import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.Version; import com.yahoo.jrt.Request; import com.yahoo.log.LogLevel; -import com.yahoo.net.LinuxInetAddress; +import com.yahoo.net.HostName; import com.yahoo.vespa.config.ConfigPayload; import com.yahoo.vespa.config.ErrorCode; import com.yahoo.vespa.config.UnknownConfigIdException; @@ -27,7 +27,7 @@ import java.util.logging.Logger; class GetConfigProcessor implements Runnable { private static final Logger log = Logger.getLogger(GetConfigProcessor.class.getName()); - private static final String localHostName; + private static final String localHostName = HostName.getLocalhost(); private final JRTServerConfigRequest request; /* True only when this request has expired its server timeout and we need to respond to the client */ @@ -151,14 +151,6 @@ class GetConfigProcessor implements Runnable { respond(request); } - /** - * Done in a static block to prevent people invoking this directly. - * Do not call java.net.Inet4AddressImpl.getLocalHostName() on each request, as this causes CPU bottlenecks. - */ - static { - localHostName = LinuxInetAddress.getLocalHost().getHostName(); - } - static boolean logDebug(Trace trace) { return trace.shouldTrace(RpcServer.TRACELEVEL_DEBUG) || log.isLoggable(LogLevel.DEBUG); } |