Return-Path: X-Original-To: apmail-reef-dev-archive@minotaur.apache.org Delivered-To: apmail-reef-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1599217B2E for ; Thu, 9 Oct 2014 04:38:12 +0000 (UTC) Received: (qmail 32265 invoked by uid 500); 9 Oct 2014 04:38:12 -0000 Delivered-To: apmail-reef-dev-archive@reef.apache.org Received: (qmail 32237 invoked by uid 500); 9 Oct 2014 04:38:11 -0000 Mailing-List: contact dev-help@reef.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@reef.incubator.apache.org Delivered-To: mailing list dev@reef.incubator.apache.org Received: (qmail 32224 invoked by uid 99); 9 Oct 2014 04:38:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 04:38:11 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ydchen@gmail.com designates 209.85.218.41 as permitted sender) Received: from [209.85.218.41] (HELO mail-oi0-f41.google.com) (209.85.218.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 04:38:07 +0000 Received: by mail-oi0-f41.google.com with SMTP id u20so1013619oif.0 for ; Wed, 08 Oct 2014 21:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ixDaMHMjT+XBybYdn7VPtGvhO3vH6XdC9yQfqo3o1wY=; b=jT3n/C7p76kuqQ1XgOkfbvCNVmY3vgBvYTrzbkeViPRwOSNp3rw35VW3EUO2t514lW jtZXfD3CWMjp0GwcZVAVZdvnyCY++T4jHv2OFuUF9WS+uEhqsZSvIwpCvQPEije3aCiz gQJdW02xMtvTpey80vLTZl6o78ya24OiRAne61pUB2/XFlTSefX75uz7b7BHIYAVR2TM QGnIqxi9a7q2M3jCR00MdlfcpWp5o3MDXbAKzZOE4r3d2c3vrFwyTwppU3YSbhsLa76Q FKR5qEhXUydPcdxrSjGFetuJG2qwufFXvMtkDiQ4VCrWXEpX/6eMia3RdP8eoCW1pHID GoFQ== MIME-Version: 1.0 X-Received: by 10.60.176.169 with SMTP id cj9mr18510130oec.21.1412829464246; Wed, 08 Oct 2014 21:37:44 -0700 (PDT) Received: by 10.182.155.36 with HTTP; Wed, 8 Oct 2014 21:37:44 -0700 (PDT) In-Reply-To: References: <81bf717aba164c4c89daf595df7f0425@DM2PR03MB319.namprd03.prod.outlook.com> Date: Wed, 8 Oct 2014 21:37:44 -0700 Message-ID: Subject: Re: Question about Reef-webserver From: Yingda Chen To: dev Content-Type: multipart/alternative; boundary=047d7bd6ac4e583f620504f5fe73 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd6ac4e583f620504f5fe73 Content-Type: text/plain; charset=UTF-8 I am fine with making it public class, as long as we make it specific (in java doc) that this is only a request, whose satisfaction cannot be guaranteed. On Wed, Oct 8, 2014 at 9:31 PM, Yunseong Lee wrote: > It is not critical, but would be useful for some usage cases including > mine :) > > Any comments on changing the class PortNumber to public? > > Thank you > -Yunseong > On October 9, 2014 at 2:20:09 AM, Julia Wang (QIUHE) ( > qiuhe.wang@microsoft.com) wrote: > > We can change it to public if there is no objection. > > -----Original Message----- > From: Yunseong Lee [mailto:yunseong.lee@me.com] > Sent: Wednesday, October 08, 2014 10:12 AM > To: dev@reef.incubator.apache.org > Subject: Re: Question about Reef-webserver > > Thanks for the explanation in detail Yingda, Markus and Julia. > Now I understand why users are not always able to set the port number. > > But I still have a question about binding parameter. I already tried to > bind a port number as you suggested: > > final Configuration httpServerConfiguration = > Tang.Factory.getTang().newConfigurationBuilder() > .bindNamedParameter(PortNumber.class, "9000") > .build(); > > However, since PortNumber is not a public class, it is not available to > use in my class so that I could not bind the parameter. > Would you please let me know if I missed some point? > > Thank you. > - Yunseong > > > > I tried the way Julia suggested, but PortNumber is not a public class, > > On October 9, 2014 at 1:07:01 AM, Markus Weimer (weimer@apache.org) wrote: > > Hi, > > mostly: What Yingda said. > > Typically, we are on clusters with shared machines where one physical > machine (and IP address) hosts multiple containers. Assuming that any one > particular port is available for us isn't possible. Hence, the constructor > of HttpServerImpl tries different ports until an available one is found. In > the case of the Driver, we use the found port in order to register the > application with the resource manager to enable discovery through the RM, > which is part of the infrastructure of the cluster and therefore a known > entity. > > > The way HttpServerImpl does this searchfor a port is configurable, but it > starts with com.microsoft.reef.webserver.PortNumber, which defaults to > 8080. If you want to start the search elsewhere, you can bind a different > value to that named parameter. > > Hope this helps, > > Markus > > On Wed, Oct 8, 2014 at 7:15 AM, Yingda Chen wrote: > > > We had similar discussions before, and for most usage cases, we depend > > on YARN to do the http traffic forwarding, which will automatically > > find the port used by Reef (AM) http server. > > > > I agree that allowing user to set port can provide more flexibility, > > but with flexibility also comes some uncertainty - since we cannot > > guarantee that the port specified by the user can be used, as another > > application may already be using that. In fact, on a multi-tenant > > cluster where multiple Reef applications are running, port-collision > > is inevitable. I guess we can still do it and make it clear to the > > user that REEF can only bind the port on a best-effort basis. I am > > open to that discussion :) > > > > -Yingda > > > > On Wed, Oct 8, 2014 at 3:21 AM, Yunseong Lee > wrote: > > > > > Hi, I am building an application using Reef-webserver and I have a > > > question. > > > > > > Is there a way to set a port number other than the default value(8080)? > > > > > > As far as I have found, HttpServer does not have a method to set the > > > port number. > > > I found some tests binding PortNumber via Configuration, but since > > > PortNumber is not a public class it is not available outside the > > > package. > > > > > > In my opinion, it is reasonable to allow user to set the port number. > > > When another application reserved 8080 port, I found the app and > > > reef-webserver both go wrong. > > > > > > Any thoughts? > > > > > > Thank you. > > > - Yunseong > > > --047d7bd6ac4e583f620504f5fe73--