You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/11/06 22:22:35 UTC

[GitHub] dlg99 commented on a change in pull request #1789: Cache InetSocketAddress if hostname is IPAddress

dlg99 commented on a change in pull request #1789: Cache InetSocketAddress if hostname is IPAddress
URL: https://github.com/apache/bookkeeper/pull/1789#discussion_r231316265
 
 

 ##########
 File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/net/BookieSocketAddress.java
 ##########
 @@ -38,11 +39,19 @@
     // Member fields that make up this class.
     private final String hostname;
     private final int port;
+    private final boolean isHostnameIPAddress;
+    private final InetSocketAddress socketAddress;
 
 Review comment:
   I'd do Optional<InetSocketAddress>
   assign Optional.empty() if it is empty
   and use 
   socketAddress.orElseGet(() -> new InetSocketAddress(hostname, port)) to get address as needed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services