flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-11081) Support binding port range for REST server
Date Tue, 11 Dec 2018 17:26:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-11081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16717606#comment-16717606
] 

ASF GitHub Bot commented on FLINK-11081:
----------------------------------------

walterddr commented on a change in pull request #7263: [FLINK-11081] Support binding port
range for REST server
URL: https://github.com/apache/flink/pull/7263#discussion_r240692650
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpoint.java
 ##########
 @@ -181,14 +184,44 @@ protected void initChannel(SocketChannel ch) {
 				.channel(NioServerSocketChannel.class)
 				.childHandler(initializer);
 
-			log.debug("Binding rest endpoint to {}:{}.", restBindAddress, restBindPort);
-			final ChannelFuture channel;
-			if (restBindAddress == null) {
-				channel = bootstrap.bind(restBindPort);
-			} else {
-				channel = bootstrap.bind(restBindAddress, restBindPort);
+			ChannelFuture channel;
+
+			// parse port range definition and create port iterator
+			Iterator<Integer> portsIterator;
+			try {
+				portsIterator = NetUtils.getPortRangeFromString(restBindPort);
+			} catch (Exception e) {
 
 Review comment:
   `getPortRangeFromString` only throws `NumberFormatException` which extends illegal argument
exception already.

----------------------------------------------------------------
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


> Support binding port range for REST server
> ------------------------------------------
>
>                 Key: FLINK-11081
>                 URL: https://issues.apache.org/jira/browse/FLINK-11081
>             Project: Flink
>          Issue Type: Improvement
>          Components: REST
>    Affects Versions: 1.7.0, 1.8.0
>            Reporter: Till Rohrmann
>            Assignee: vinoyang
>            Priority: Major
>              Labels: pull-request-available
>
> Currently the {{RestServerEndpoint}} binds to the port specified by {{RestOptions#PORT}}.
{{PORT}} is of type integer. Sometimes, it would be useful to being able to specify not only
a single port but a port range to pick a port from. Therefore, I propose to add similar to
{{RestOptions#BIND_ADDRESS}} another option {{RestOptions#BIND_PORT}} which allows to specify
a port range for the {{RestServerEndpoint}} to pick a port from. {{RestOptions#PORT}} would
then only be used by the client to connect to the started {{RestServerEndpoint}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message