eolivelli commented on a change in pull request #297: Issue 296: Bookie
supports ephemeral port
URL: https://github.com/apache/bookkeeper/pull/297#discussion_r129763738
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java
##########
@@ -219,7 +225,12 @@ protected void initChannel(SocketChannel ch) throws
Exception {
});
// Bind and start to accept incoming connections
- bootstrap.bind(address.getAddress(), address.getPort()).sync();
+ Channel listen = bootstrap.bind(address.getAddress(),
address.getPort()).sync().channel();
+ if (listen.localAddress() instanceof InetSocketAddress) {
+ if (conf.getBookiePort() == 0) {
+ conf.setBookiePort(((InetSocketAddress)
listen.localAddress()).getPort());
Review comment:
@jiazhai @sijie is there any other case in which we "change" the provided
configuration object ?
wouldn't it be clearer to add a public getBookieSocketAddress() ?
if we do not have any other case it should be better to treat
ServerConfiguration as immutable once the server is started
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services