Github user manuzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/231#discussion_r145601399
  
    --- Diff: 
experiments/yarn/src/main/scala/org/apache/gearpump/experiments/yarn/client/AppMasterResolver.scala
 ---
    @@ -75,3 +64,38 @@ class AppMasterResolver(yarnClient: YarnClient, system: 
ActorSystem) {
         result
       }
     }
    +
    +object AppMasterResolver {
    +
    +  val LOG = LogUtil.getLogger(getClass)
    +
    +  def resolveAppMasterAddress(report: ApplicationReport, system: 
ActorSystem): ActorRef = {
    +    val appMasterPath = s"${report.getOriginalTrackingUrl}" + 
"supervisor-actor-path"
    +    LOG.info(s"appMasterPath=$appMasterPath")
    +
    +    val connectionFactory: URLConnectionFactory = URLConnectionFactory
    +      .newDefaultURLConnectionFactory(new YarnConfiguration())
    +    val url: URL = new URL(appMasterPath)
    +    val connection: HttpURLConnection = 
connectionFactory.openConnection(url)
    +      .asInstanceOf[HttpURLConnection]
    +    connection.setInstanceFollowRedirects(true)
    +    connection.connect()
    +    val status = connection.getResponseCode
    +
    +    var stream: java.io.InputStream = connection.getErrorStream
    +    if(stream == null) {
    +      stream = connection.getInputStream
    +    }
    +    if(status == 200) {
    --- End diff --
    
    fix style: need a space before `(`


---

Reply via email to