gearpump-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manuzhang <...@git.apache.org>
Subject [GitHub] incubator-gearpump pull request #231: [GEARPUMP-355] Fix YarnAppMaster addre...
Date Thu, 19 Oct 2017 05:13:16 GMT
Github user manuzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/231#discussion_r145601401
  
    --- 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) {
    --- End diff --
    
    fix style: need a space before `(`


---

Mime
View raw message