[SPARK-3286] - Cannot view ApplicationMaster UI when Yarn’s url scheme i...

...s https
Per @vanzin , alpha means pre-branch-2 hadoop.   Before YARN-1203(Hadoop 2.2), we cannot pass AM URLS with scheme. There are stable releases before YARN-1203. So for stable releases without YARN-1203, we have to pass host:port.

There are 4 cases:
Alpha and yarn.http.policy !=HTTPS_ONLY  : uiAddress = host:port
Alpha and yarn.http.policy ==HTTPS_ONLY  : uiAddress = scheme:host:port  (strip off scheme since alpha will choke on scheme.)

stable and yarn.http.policy !=HTTPS_ONLY  : uiAddress = host:port
stable and yarn.http.policy ==HTTPS_ONLY  : uiAddress = scheme:host:port  (we are taking a bet that yarn.http.policy==HTTPS_ONLY occurs only for stable release after Yarn-1203  since this property was introduced by Yarn-1277 . Both these changes are released in Hadoop-2.2. )

So I think, we need to do the conditional logic for both stable and alpha.
We also need to strip off the scheme for alpha.
Please let me know , if there is a better solution.