Github user manuzhang commented on a diff in the pull request: https://github.com/apache/incubator-gearpump/pull/231#discussion_r145602797 --- 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() --- End diff -- How will `IOException`thrown on connect be handled ?
---