yzang commented on a change in pull request #278: BOOKKEEPER-1100: Add module 
for Bookkeeper Http Endpoint
URL: https://github.com/apache/bookkeeper/pull/278#discussion_r130435127
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
 ##########
 @@ -2023,7 +2027,49 @@ public ServerConfiguration 
setNettyMaxFrameSizeBytes(int maxSize) {
     }
 
     /**
-     * Gets the minimum safe Usable size to be available in index directory 
for Bookie to create Index File while replaying 
+     * Sets that whether the http server can start along with auto-recovery 
service
+     *
+     * @param enabled
+     *            - true if need to start http server with auto-recovery
+     * @return ServerConfiguration
+     */
+    public ServerConfiguration setHttpServerEnabled(boolean enabled) {
+        setProperty(HTTP_SERVER_ENABLED, enabled);
+        return this;
+    }
+
+    /**
+     * Get whether the http server start with auto-recovery service or not
+     *
+     * @return true - if http server should start with auto-recovery service
+     */
+    public boolean isHttpServerEnabled() {
+        return getBoolean(HTTP_SERVER_ENABLED, false);
+    }
+
+    /**
+     * Set Http server port listening on
+     *
+     * @param port
+     *          Port to listen on
+     * @return server configuration
+     */
+    public ServerConfiguration setHttpServerPort(int port) {
 
 Review comment:
   @eolivelli 
   For the first point, I kinda agree with you, but I'm still thinking about 
what's the benefit of doing that, do you minding sharing some examples of under 
when will expose and make port/address/protocol configurable be beneficial?
   
   For the second point, it is already achieved in this change, the interface 
in HttpServer allows youto pass the port in when you start the http server. The 
ServerConfiguration is just another way to make it possible to get the port 
from configuration, which could be useful in some other use cases. For example, 
in Twitter, we don't have a static port available for HttpServer, because we 
use aurora as the scheduler, the http port is dynamically assigned by aurora 
scheduler, so the only way to get the port is from configuration.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to