TransportAddress is a small immutable wrapper around an InetSocketAddress so that they can be sent over the wire. We don't make very many InetSocketAddress objects but we create new wrappers around them on every inbound message and on outbound exceptions:
|
response.remoteAddress(new TransportAddress(remoteAddress)); |
|
request.remoteAddress(new TransportAddress(channel.getRemoteAddress())); |
|
TransportAddress address = new TransportAddress(channel.getLocalAddress()); |
We should really be re-using the TransportAddress wrapper in these cases.
TransportAddressis a small immutable wrapper around anInetSocketAddressso that they can be sent over the wire. We don't make very manyInetSocketAddressobjects but we create new wrappers around them on every inbound message and on outbound exceptions:elasticsearch/server/src/main/java/org/elasticsearch/transport/InboundHandler.java
Line 322 in 2a5b698
elasticsearch/server/src/main/java/org/elasticsearch/transport/InboundHandler.java
Line 241 in 2a5b698
elasticsearch/server/src/main/java/org/elasticsearch/transport/OutboundHandler.java
Line 146 in 34d9cbe
We should really be re-using the
TransportAddresswrapper in these cases.