浏览代码

YARN-10308. Update javadoc and variable names for YARN service.
Contributed by Bilwa S T via eyang

Eric Yang 4 年之前
父节点
当前提交
89689c52c3

+ 11 - 9
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/KerberosPrincipal.java

@@ -71,8 +71,9 @@ public class KerberosPrincipal implements Serializable {
   }
 
   /**
-   * The URI of the kerberos keytab. It supports two schemes \"
-   * hdfs\" and \"file\". If the URI starts with \"
+   * The URI of the kerberos keytab. It supports hadoop supported schemes
+   * like \"hdfs\" \"file\" \"s3\"
+   *  \"viewfs\" etc.If the URI starts with \"
    * hdfs://\" scheme, it indicates the path on hdfs where the keytab is
    * stored. The keytab will be localized by YARN and made available to AM in
    * its local directory. If the URI starts with \"file://\"
@@ -81,13 +82,14 @@ public class KerberosPrincipal implements Serializable {
    *
    * @return keytab
    **/
-  @ApiModelProperty(value = "The URI of the kerberos keytab. It supports two " +
-      "schemes \"hdfs\" and \"file\". If the URI starts with \"hdfs://\" " +
-      "scheme, it indicates the path on hdfs where the keytab is stored. The " +
-      "keytab will be localized by YARN and made available to AM in its local" +
-      " directory. If the URI starts with \"file://\" scheme, it indicates a " +
-      "path on the local host where the keytab is presumbaly installed by " +
-      "admins upfront. ")
+  @ApiModelProperty(value = "The URI of the kerberos keytab. It supports"
+      + " Hadoop supported filesystem types like \"hdfs\", \"file\","
+      + " \"viewfs\", \"s3\" etc.If the URI starts with \"hdfs://\" scheme, "
+      + "it indicates the path on hdfs where the keytab is stored. The "
+      + "keytab will be localized by YARN and made available to AM in its local"
+      + " directory. If the URI starts with \"file://\" scheme, it indicates a "
+      + "path on the local host where the keytab is presumbaly installed by "
+      + "admins upfront. ")
   public String getKeytab() {
     return keytab;
   }

+ 5 - 5
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/client/ServiceClient.java

@@ -1478,18 +1478,18 @@ public class ServiceClient extends AppAdminClient implements SliderExitCodes,
     if ("file".equals(keytabURI.getScheme())) {
       LOG.info("Using a keytab from localhost: " + keytabURI);
     } else {
-      Path keytabOnhdfs = new Path(keytabURI);
-      if (!fileSystem.getFileSystem().exists(keytabOnhdfs)) {
+      Path keytabPath = new Path(keytabURI);
+      if (!fileSystem.getFileSystem().exists(keytabPath)) {
         LOG.warn(service.getName() + "'s keytab (principalName = "
-            + principalName + ") doesn't exist at: " + keytabOnhdfs);
+            + principalName + ") doesn't exist at: " + keytabPath);
         return;
       }
-      LocalResource keytabRes = fileSystem.createAmResource(keytabOnhdfs,
+      LocalResource keytabRes = fileSystem.createAmResource(keytabPath,
           LocalResourceType.FILE, LocalResourceVisibility.PRIVATE);
       localResource.put(String.format(YarnServiceConstants.KEYTAB_LOCATION,
           service.getName()), keytabRes);
       LOG.info("Adding " + service.getName() + "'s keytab for "
-          + "localization, uri = " + keytabOnhdfs);
+          + "localization, uri = " + keytabPath);
     }
   }