From 89689c52c39cdcc498d04508dbd235c6036ec17c Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Wed, 17 Jun 2020 09:04:26 -0700 Subject: [PATCH] YARN-10308. Update javadoc and variable names for YARN service. Contributed by Bilwa S T via eyang --- .../api/records/KerberosPrincipal.java | 20 ++++++++++--------- .../yarn/service/client/ServiceClient.java | 10 +++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/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 b/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 index 0ff4daa6b87..27125fbedc3 100644 --- a/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 +++ b/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; } diff --git a/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 b/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 index b3ac7bbe748..41d1e423946 100644 --- a/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 +++ b/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); } }