From 95372657fc25c02399b01793833021ccf88dada2 Mon Sep 17 00:00:00 2001 From: Giovanni Matteo Fumarola Date: Mon, 25 Feb 2019 11:45:37 -0800 Subject: [PATCH] YARN-9287. Consecutive StringBuilder append should be reuse. Contributed by Ayush Saxena. --- .../api/records/ApplicationAttemptId.java | 4 +- .../yarn/api/records/ApplicationId.java | 6 +- .../hadoop/yarn/api/records/ContainerId.java | 4 +- .../hadoop/yarn/api/records/NodeLabel.java | 10 +- .../yarn/api/records/ReservationId.java | 6 +- .../hadoop/yarn/api/records/Resource.java | 8 +- .../timeline/TimelineEntityGroupId.java | 6 +- .../timelineservice/FlowActivityEntity.java | 14 +- .../timelineservice/FlowRunEntity.java | 10 +- .../org/apache/hadoop/yarn/conf/HAUtil.java | 4 +- .../applications/distributedshell/Client.java | 8 +- .../yarn/service/client/ApiServiceClient.java | 44 +++---- .../hadoop/yarn/service/ServiceScheduler.java | 22 ++-- .../yarn/service/api/records/Artifact.java | 11 +- .../service/api/records/BaseResource.java | 6 +- .../yarn/service/api/records/Component.java | 52 ++++---- .../yarn/service/api/records/ConfigFile.java | 14 +- .../service/api/records/Configuration.java | 12 +- .../yarn/service/api/records/Container.java | 34 ++--- .../yarn/service/api/records/Error.java | 10 +- .../api/records/KerberosPrincipal.java | 10 +- .../api/records/PlacementConstraint.java | 30 ++--- .../service/api/records/PlacementPolicy.java | 8 +- .../service/api/records/ReadinessCheck.java | 12 +- .../yarn/service/api/records/Resource.java | 14 +- .../api/records/ResourceInformation.java | 14 +- .../yarn/service/api/records/Service.java | 59 +++++---- .../service/api/records/ServiceStatus.java | 12 +- .../component/instance/ComponentInstance.java | 24 ++-- .../containerlaunch/AbstractLauncher.java | 4 +- .../yarn/service/utils/CoreFileSystem.java | 4 +- .../service/utils/PublishedConfiguration.java | 6 +- .../yarn/service/utils/ServiceUtils.java | 4 +- .../hadoop/yarn/client/api/AMRMClient.java | 13 +- .../yarn/client/cli/ApplicationCLI.java | 4 +- .../hadoop/yarn/client/cli/RMAdminCLI.java | 8 +- .../apache/hadoop/yarn/client/cli/TopCLI.java | 68 +++++----- .../api/records/impl/pb/ContainerPBImpl.java | 24 ++-- .../impl/pb/ContainerStatusPBImpl.java | 24 ++-- .../impl/pb/LocalizationStatusPBImpl.java | 12 +- .../yarn/api/records/impl/pb/TokenPBImpl.java | 6 +- .../client/api/impl/TimelineV2ClientImpl.java | 6 +- .../yarn/logaggregation/LogToolUtils.java | 28 ++-- .../LogAggregationFileController.java | 6 +- .../org/apache/hadoop/yarn/state/Graph.java | 15 ++- .../yarn/util/ProcfsBasedProcessTree.java | 6 +- .../webapp/AHSErrorsAndWarningsPage.java | 11 +- .../SubClusterPolicyConfiguration.java | 6 +- .../utils/FederationStateStoreFacade.java | 4 +- .../server/sharedcache/SharedCacheUtil.java | 4 +- .../nodemanager/DefaultContainerExecutor.java | 14 +- .../nodemanager/LinuxContainerExecutor.java | 8 +- .../resourcemanager/ClientRMService.java | 4 +- .../amlauncher/AMLauncher.java | 4 +- .../invariants/MetricsInvariantChecker.java | 6 +- .../nodelabels/NodeAttributesManagerImpl.java | 10 +- .../scheduler/AbstractResourceUsage.java | 25 ++-- .../SchedulerApplicationAttempt.java | 6 +- .../scheduler/activities/ActivityNode.java | 6 +- .../scheduler/capacity/LeafQueue.java | 4 +- .../scheduler/capacity/ParentQueue.java | 4 +- .../scheduler/capacity/QueueCapacities.java | 18 +-- .../scheduler/common/PendingAsk.java | 10 +- .../common/fica/FiCaSchedulerApp.java | 121 +++++++++--------- .../event/ContainerPreemptEvent.java | 4 +- .../scheduler/fair/FSAppAttempt.java | 6 +- .../resourcemanager/webapp/NodesPage.java | 12 +- .../webapp/RMErrorsAndWarningsPage.java | 11 +- .../server/router/webapp/FederationPage.java | 10 +- .../yarn/server/router/webapp/NodesPage.java | 10 +- .../server/TestContainerManagerSecurity.java | 14 +- .../storage/HBaseTimelineSchemaCreator.java | 45 +++---- .../common/HBaseTimelineSchemaUtils.java | 10 +- .../storage/common/Separator.java | 4 +- .../storage/flow/FlowRunRowKey.java | 12 +- 75 files changed, 565 insertions(+), 544 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationAttemptId.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationAttemptId.java index dbaacd9176d..c5c8aa57bca 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationAttemptId.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationAttemptId.java @@ -127,8 +127,8 @@ public abstract class ApplicationAttemptId implements StringBuilder sb = new StringBuilder(64); sb.append(APP_ATTEMPT_ID_PREFIX); ApplicationId appId = getApplicationId(); - sb.append(appId.getClusterTimestamp()); - sb.append('_'); + sb.append(appId.getClusterTimestamp()) + .append('_'); FastNumberFormat.format(sb, appId.getId(), APP_ID_MIN_DIGITS); sb.append('_'); FastNumberFormat.format(sb, getAttemptId(), ATTEMPT_ID_MIN_DIGITS); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationId.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationId.java index 392e0a1d889..07b7f161e16 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationId.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ApplicationId.java @@ -98,9 +98,9 @@ public abstract class ApplicationId implements Comparable { @Override public String toString() { StringBuilder sb = new StringBuilder(64); - sb.append(APPLICATION_ID_PREFIX); - sb.append(getClusterTimestamp()); - sb.append('_'); + sb.append(APPLICATION_ID_PREFIX) + .append(getClusterTimestamp()) + .append('_'); FastNumberFormat.format(sb, getId(), APP_ID_MIN_DIGITS); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java index e506dc7c84f..68852d4061d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerId.java @@ -172,8 +172,8 @@ public abstract class ContainerId implements Comparable{ sb.append('_'); } ApplicationId appId = getApplicationAttemptId().getApplicationId(); - sb.append(appId.getClusterTimestamp()); - sb.append('_'); + sb.append(appId.getClusterTimestamp()) + .append('_'); FastNumberFormat.format(sb, appId.getId(), APP_ID_MIN_DIGITS); sb.append('_'); FastNumberFormat.format(sb, getApplicationAttemptId().getAttemptId(), diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeLabel.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeLabel.java index 1827fb59c91..d59ccfb241b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeLabel.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/NodeLabel.java @@ -98,11 +98,11 @@ public abstract class NodeLabel implements Comparable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("<"); - sb.append(getName()); - sb.append(":exclusivity="); - sb.append(isExclusive()); - sb.append(">"); + sb.append("<") + .append(getName()) + .append(":exclusivity=") + .append(isExclusive()) + .append(">"); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ReservationId.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ReservationId.java index fd0111538a4..6dad2a3abf0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ReservationId.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ReservationId.java @@ -103,9 +103,9 @@ public abstract class ReservationId implements Comparable { @Override public String toString() { StringBuilder sb = new StringBuilder(64); - sb.append(reserveIdStrPrefix); - sb.append(getClusterTimestamp()); - sb.append('_'); + sb.append(reserveIdStrPrefix) + .append(getClusterTimestamp()) + .append('_'); FastNumberFormat.format(sb, getId(), RESERVATION_ID_MIN_DIGITS); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java index b55a848edbb..83e1c5fe09b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/Resource.java @@ -475,10 +475,10 @@ public abstract class Resource implements Comparable { if (ri.getValue() == 0) { continue; } - sb.append(", "); - sb.append(ri.getName()).append(": ") - .append(ri.getValue()); - sb.append(ri.getUnits()); + sb.append(", ") + .append(ri.getName()).append(": ") + .append(ri.getValue()) + .append(ri.getUnits()); } sb.append(">"); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timeline/TimelineEntityGroupId.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timeline/TimelineEntityGroupId.java index 984e6e2e25a..e66b9bfa5f9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timeline/TimelineEntityGroupId.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timeline/TimelineEntityGroupId.java @@ -136,9 +136,9 @@ public class TimelineEntityGroupId implements StringBuilder sb = new StringBuilder(); sb.append(TIMELINE_ENTITY_GROUPID_STR_PREFIX + "_"); ApplicationId appId = getApplicationId(); - sb.append(appId.getClusterTimestamp()).append("_"); - sb.append(appId.getId()).append("_"); - sb.append(getTimelineEntityGroupId()); + sb.append(appId.getClusterTimestamp()).append("_") + .append(appId.getId()).append("_") + .append(getTimelineEntityGroupId()); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/FlowActivityEntity.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/FlowActivityEntity.java index cf19328f675..87fa99e1fe5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/FlowActivityEntity.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/FlowActivityEntity.java @@ -77,13 +77,13 @@ public class FlowActivityEntity extends TimelineEntity { String id = super.getId(); if (id == null) { StringBuilder sb = new StringBuilder(); - sb.append(getCluster()); - sb.append('/'); - sb.append(getDate().getTime()); - sb.append('/'); - sb.append(getUser()); - sb.append('@'); - sb.append(getFlowName()); + sb.append(getCluster()) + .append('/') + .append(getDate().getTime()) + .append('/') + .append(getUser()) + .append('@') + .append(getFlowName()); id = sb.toString(); setId(id); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/FlowRunEntity.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/FlowRunEntity.java index 5c666cdeb7b..513df166bd5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/FlowRunEntity.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/timelineservice/FlowRunEntity.java @@ -63,11 +63,11 @@ public class FlowRunEntity extends HierarchicalTimelineEntity { String id = super.getId(); if (id == null) { StringBuilder sb = new StringBuilder(); - sb.append(getInfo().get(USER_INFO_KEY).toString()); - sb.append('@'); - sb.append(getInfo().get(FLOW_NAME_INFO_KEY).toString()); - sb.append('/'); - sb.append(getInfo().get(FLOW_RUN_ID_INFO_KEY).toString()); + sb.append(getInfo().get(USER_INFO_KEY).toString()) + .append('@') + .append(getInfo().get(FLOW_NAME_INFO_KEY).toString()) + .append('/') + .append(getInfo().get(FLOW_RUN_ID_INFO_KEY).toString()); id = sb.toString(); setId(id); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/HAUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/HAUtil.java index 60c370b8309..655887a0c4a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/HAUtil.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/HAUtil.java @@ -129,8 +129,8 @@ public class HAUtil { for (String prefix : YarnConfiguration.getServiceAddressConfKeys(conf)) { checkAndSetRMRPCAddress(prefix, id, conf); } - setValue.append(id); - setValue.append(","); + setValue.append(id) + .append(","); } conf.set(YarnConfiguration.RM_HA_IDS, setValue.substring(0, setValue.length() - 1)); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java index 10cf25f5622..ef00e3eb1e7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java @@ -906,16 +906,16 @@ public class Client { for (String c : conf.getStrings( YarnConfiguration.YARN_APPLICATION_CLASSPATH, YarnConfiguration.DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH)) { - classPathEnv.append(ApplicationConstants.CLASS_PATH_SEPARATOR); - classPathEnv.append(c.trim()); + classPathEnv.append(ApplicationConstants.CLASS_PATH_SEPARATOR) + .append(c.trim()); } classPathEnv.append(ApplicationConstants.CLASS_PATH_SEPARATOR).append( "./log4j.properties"); // add the runtime classpath needed for tests to work if (conf.getBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER, false)) { - classPathEnv.append(':'); - classPathEnv.append(System.getProperty("java.class.path")); + classPathEnv.append(':') + .append(System.getProperty("java.class.path")); } env.put("CLASSPATH", classPathEnv.toString()); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java index 63378dc5a44..a6d15026da0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java @@ -105,14 +105,14 @@ public class ApiServiceClient extends AppAdminClient { Client client = Client.create(); client.setFollowRedirects(false); StringBuilder sb = new StringBuilder(); - sb.append(scheme); - sb.append(host); - sb.append(path); + sb.append(scheme) + .append(host) + .append(path); if (!useKerberos) { try { String username = UserGroupInformation.getCurrentUser().getShortUserName(); - sb.append("?user.name="); - sb.append(username); + sb.append("?user.name=") + .append(username); } catch (IOException e) { LOG.debug("Fail to resolve username: {}", e); } @@ -154,11 +154,11 @@ public class ApiServiceClient extends AppAdminClient { private String getServicePath(String appName) throws IOException { String url = getRMWebAddress(); StringBuilder api = new StringBuilder(); - api.append(url); - api.append("/app/v1/services"); + api.append(url) + .append("/app/v1/services"); if (appName != null) { - api.append("/"); - api.append(appName); + api.append("/") + .append(appName); } appendUserNameIfRequired(api); return api.toString(); @@ -168,8 +168,8 @@ public class ApiServiceClient extends AppAdminClient { Preconditions.checkNotNull(appName); String url = getRMWebAddress(); StringBuilder api = new StringBuilder(); - api.append(url); - api.append("/app/v1/services/").append(appName).append("/") + api.append(url) + .append("/app/v1/services/").append(appName).append("/") .append(RestApiConstants.COMP_INSTANCES); appendUserNameIfRequired(api); return api.toString(); @@ -196,8 +196,8 @@ public class ApiServiceClient extends AppAdminClient { Preconditions.checkNotNull(appName); String url = getRMWebAddress(); StringBuilder api = new StringBuilder(); - api.append(url); - api.append("/app/v1/services/").append(appName).append("/") + api.append(url) + .append("/app/v1/services/").append(appName).append("/") .append(RestApiConstants.COMPONENTS); appendUserNameIfRequired(api); return api.toString(); @@ -528,16 +528,16 @@ public class ApiServiceClient extends AppAdminClient { .get(ClientResponse.class); if (response.getStatus() == 404) { StringBuilder sb = new StringBuilder(); - sb.append(" Service "); - sb.append(appName); - sb.append(" not found"); + sb.append(" Service ") + .append(appName) + .append(" not found"); return sb.toString(); } if (response.getStatus() != 200) { StringBuilder sb = new StringBuilder(); - sb.append(appName); - sb.append(" Failed : HTTP error code : "); - sb.append(response.getStatus()); + sb.append(appName) + .append(" Failed : HTTP error code : ") + .append(response.getStatus()); return sb.toString(); } output = response.getEntity(String.class); @@ -659,9 +659,9 @@ public class ApiServiceClient extends AppAdminClient { ClientResponse response = getApiClient(uri).get(ClientResponse.class); if (response.getStatus() != 200) { StringBuilder sb = new StringBuilder(); - sb.append("Failed: HTTP error code: "); - sb.append(response.getStatus()); - sb.append(" ErrorMsg: ").append(response.getEntity(String.class)); + sb.append("Failed: HTTP error code: ") + .append(response.getStatus()) + .append(" ErrorMsg: ").append(response.getEntity(String.class)); return sb.toString(); } return response.getEntity(String.class); 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/ServiceScheduler.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/ServiceScheduler.java index f2cd5cb7a32..458a7a1c5c1 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/ServiceScheduler.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/ServiceScheduler.java @@ -1112,18 +1112,18 @@ public class ServiceScheduler extends CompositeService { } else { requestPath.append("http://"); } - requestPath.append(bareHost); - requestPath.append(":"); - requestPath.append(port); - requestPath.append("/ws/v1/node/yarn/sysfs/"); - requestPath.append(UserGroupInformation.getCurrentUser() - .getShortUserName()); - requestPath.append("/"); - requestPath.append(yarnApp.getId()); + requestPath.append(bareHost) + .append(":") + .append(port) + .append("/ws/v1/node/yarn/sysfs/") + .append(UserGroupInformation.getCurrentUser() + .getShortUserName()) + .append("/") + .append(yarnApp.getId()); if (!useKerberos) { - requestPath.append("?user.name="); - requestPath.append(UserGroupInformation.getCurrentUser() - .getShortUserName()); + requestPath.append("?user.name=") + .append(UserGroupInformation.getCurrentUser() + .getShortUserName()); } Builder builder = HttpUtil.connect(requestPath.toString()); ClientResponse response = builder.put(ClientResponse.class, spec); 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/Artifact.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/Artifact.java index bba579183f2..12979f38430 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/Artifact.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/Artifact.java @@ -145,12 +145,11 @@ public class Artifact implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Artifact {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" uri: ").append(toIndentedString(uri)).append("\n"); - sb.append("}"); + sb.append("class Artifact {\n") + .append(" id: ").append(toIndentedString(id)).append("\n") + .append(" type: ").append(toIndentedString(type)).append("\n") + .append(" uri: ").append(toIndentedString(uri)).append("\n") + .append("}"); return sb.toString(); } 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/BaseResource.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/BaseResource.java index 3d61fb76196..4ccb3903173 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/BaseResource.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/BaseResource.java @@ -44,9 +44,9 @@ public class BaseResource implements Serializable { @Override public String toString() { StringBuilder builder = new StringBuilder(); - builder.append("BaseResource [uri="); - builder.append(uri); - builder.append("]"); + builder.append("BaseResource [uri=") + .append(uri) + .append("]"); return builder.toString(); } } 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/Component.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/Component.java index 312340338ba..8a5b7d402f7 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/Component.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/Component.java @@ -474,31 +474,33 @@ public class Component implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Component {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" dependencies: ").append(toIndentedString(dependencies)) - .append("\n"); - sb.append(" readinessCheck: ").append(toIndentedString(readinessCheck)) - .append("\n"); - sb.append(" artifact: ").append(toIndentedString(artifact)).append("\n"); - sb.append(" launchCommand: ").append(toIndentedString(launchCommand)) - .append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); - sb.append(" numberOfContainers: ") - .append(toIndentedString(numberOfContainers)).append("\n"); - sb.append(" containers: ").append(toIndentedString(containers)) - .append("\n"); - sb.append(" runPrivilegedContainer: ") - .append(toIndentedString(runPrivilegedContainer)).append("\n"); - sb.append(" placementPolicy: ").append(toIndentedString(placementPolicy)) - .append("\n"); - sb.append(" configuration: ").append(toIndentedString(configuration)) - .append("\n"); - sb.append(" quicklinks: ").append(toIndentedString(quicklinks)) - .append("\n"); - sb.append("}"); + sb.append("class Component {\n") + .append(" name: ").append(toIndentedString(name)).append("\n") + .append(" state: ").append(toIndentedString(state)).append("\n") + .append(" dependencies: ").append(toIndentedString(dependencies)) + .append("\n") + .append(" readinessCheck: ").append(toIndentedString(readinessCheck)) + .append("\n") + .append(" artifact: ").append(toIndentedString(artifact)) + .append("\n") + .append(" launchCommand: ").append(toIndentedString(launchCommand)) + .append("\n") + .append(" resource: ").append(toIndentedString(resource)) + .append("\n") + .append(" numberOfContainers: ") + .append(toIndentedString(numberOfContainers)).append("\n") + .append(" containers: ").append(toIndentedString(containers)) + .append("\n") + .append(" runPrivilegedContainer: ") + .append(toIndentedString(runPrivilegedContainer)).append("\n") + .append(" placementPolicy: ") + .append(toIndentedString(placementPolicy)) + .append("\n") + .append(" configuration: ").append(toIndentedString(configuration)) + .append("\n") + .append(" quicklinks: ").append(toIndentedString(quicklinks)) + .append("\n") + .append("}"); return sb.toString(); } 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/ConfigFile.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/ConfigFile.java index 1cdae868355..c09373f5483 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/ConfigFile.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/ConfigFile.java @@ -211,13 +211,15 @@ public class ConfigFile implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ConfigFile {\n"); + sb.append("class ConfigFile {\n") - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" destFile: ").append(toIndentedString(destFile)).append("\n"); - sb.append(" srcFile: ").append(toIndentedString(srcFile)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append("}"); + .append(" type: ").append(toIndentedString(type)).append("\n") + .append(" destFile: ").append(toIndentedString(destFile)) + .append("\n") + .append(" srcFile: ").append(toIndentedString(srcFile)).append("\n") + .append(" properties: ").append(toIndentedString(properties)) + .append("\n") + .append("}"); return sb.toString(); } 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/Configuration.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/Configuration.java index dedfb6db81f..f52c7f27a04 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/Configuration.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/Configuration.java @@ -173,13 +173,13 @@ public class Configuration implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Configuration {\n"); + sb.append("class Configuration {\n") - sb.append(" properties: ").append(toIndentedString(properties)) - .append("\n"); - sb.append(" env: ").append(toIndentedString(env)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); + .append(" properties: ").append(toIndentedString(properties)) + .append("\n") + .append(" env: ").append(toIndentedString(env)).append("\n") + .append(" files: ").append(toIndentedString(files)).append("\n") + .append("}"); return sb.toString(); } 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/Container.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/Container.java index 99ba799ba14..0c03c9ed0b9 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/Container.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/Container.java @@ -310,21 +310,25 @@ public class Container extends BaseResource { StringBuilder sb = new StringBuilder(); sb.append("class Container {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" launchTime: ").append(toIndentedString(launchTime)) - .append("\n"); - sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); - sb.append(" hostname: ").append(toIndentedString(hostname)).append("\n"); - sb.append(" bareHost: ").append(toIndentedString(bareHost)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" componentInstanceName: ").append(toIndentedString( - componentInstanceName)) - .append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); - sb.append(" artifact: ").append(toIndentedString(artifact)).append("\n"); - sb.append(" privilegedContainer: ") - .append(toIndentedString(privilegedContainer)).append("\n"); - sb.append("}"); + sb.append(" id: ").append(toIndentedString(id)).append("\n") + .append(" launchTime: ").append(toIndentedString(launchTime)) + .append("\n") + .append(" ip: ").append(toIndentedString(ip)).append("\n") + .append(" hostname: ").append(toIndentedString(hostname)) + .append("\n") + .append(" bareHost: ").append(toIndentedString(bareHost)) + .append("\n") + .append(" state: ").append(toIndentedString(state)).append("\n") + .append(" componentInstanceName: ").append(toIndentedString( + componentInstanceName)) + .append("\n") + .append(" resource: ").append(toIndentedString(resource)) + .append("\n") + .append(" artifact: ").append(toIndentedString(artifact)) + .append("\n") + .append(" privilegedContainer: ") + .append(toIndentedString(privilegedContainer)).append("\n") + .append("}"); return sb.toString(); } 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/Error.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/Error.java index e6754ebf9c2..1ba30f2e351 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/Error.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/Error.java @@ -106,12 +106,12 @@ public class Error { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Error {\n"); + sb.append("class Error {\n") - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); - sb.append("}"); + .append(" code: ").append(toIndentedString(code)).append("\n") + .append(" message: ").append(toIndentedString(message)).append("\n") + .append(" fields: ").append(toIndentedString(fields)).append("\n") + .append("}"); return sb.toString(); } 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 4bae74d311d..0ff4daa6b87 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 @@ -120,12 +120,12 @@ public class KerberosPrincipal implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class KerberosPrincipal {\n"); + sb.append("class KerberosPrincipal {\n") - sb.append(" principalName: ").append(toIndentedString(principalName)) - .append("\n"); - sb.append(" keytab: ").append(toIndentedString(keytab)).append("\n"); - sb.append("}"); + .append(" principalName: ").append(toIndentedString(principalName)) + .append("\n") + .append(" keytab: ").append(toIndentedString(keytab)).append("\n") + .append("}"); return sb.toString(); } 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/PlacementConstraint.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/PlacementConstraint.java index 1c84c02e2e6..6b0bc61c424 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/PlacementConstraint.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/PlacementConstraint.java @@ -248,22 +248,22 @@ public class PlacementConstraint implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PlacementConstraint {\n"); + sb.append("class PlacementConstraint {\n") - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); - sb.append(" targetTags: ").append(toIndentedString(targetTags)) - .append("\n"); - sb.append(" nodeAttributes: ").append(toIndentedString(nodeAttributes)) - .append("\n"); - sb.append(" nodePartitions: ").append(toIndentedString(nodePartitions)) - .append("\n"); - sb.append(" minCardinality: ").append(toIndentedString(minCardinality)) - .append("\n"); - sb.append(" maxCardinality: ").append(toIndentedString(maxCardinality)) - .append("\n"); - sb.append("}"); + .append(" name: ").append(toIndentedString(name)).append("\n") + .append(" type: ").append(toIndentedString(type)).append("\n") + .append(" scope: ").append(toIndentedString(scope)).append("\n") + .append(" targetTags: ").append(toIndentedString(targetTags)) + .append("\n") + .append(" nodeAttributes: ").append(toIndentedString(nodeAttributes)) + .append("\n") + .append(" nodePartitions: ").append(toIndentedString(nodePartitions)) + .append("\n") + .append(" minCardinality: ").append(toIndentedString(minCardinality)) + .append("\n") + .append(" maxCardinality: ").append(toIndentedString(maxCardinality)) + .append("\n") + .append("}"); return sb.toString(); } 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/PlacementPolicy.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/PlacementPolicy.java index 799e6eb86b2..0b4225e1d68 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/PlacementPolicy.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/PlacementPolicy.java @@ -80,11 +80,11 @@ public class PlacementPolicy implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class PlacementPolicy {\n"); + sb.append("class PlacementPolicy {\n") - sb.append(" constraints: ").append(toIndentedString(constraints)) - .append("\n"); - sb.append("}"); + .append(" constraints: ").append(toIndentedString(constraints)) + .append("\n") + .append("}"); return sb.toString(); } 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/ReadinessCheck.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/ReadinessCheck.java index 1143a8f2e0e..5f94d49e14e 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/ReadinessCheck.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/ReadinessCheck.java @@ -173,12 +173,14 @@ public class ReadinessCheck implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ReadinessCheck {\n"); + sb.append("class ReadinessCheck {\n") - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); - sb.append(" artifact: ").append(toIndentedString(artifact)).append("\n"); - sb.append("}"); + .append(" type: ").append(toIndentedString(type)).append("\n") + .append(" properties: ").append(toIndentedString(properties)) + .append("\n") + .append(" artifact: ").append(toIndentedString(artifact)) + .append("\n") + .append("}"); return sb.toString(); } 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/Resource.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/Resource.java index 67f55fc61a1..4ffe87be37b 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/Resource.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/Resource.java @@ -162,14 +162,14 @@ public class Resource extends BaseResource implements Cloneable { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Resource {\n"); + sb.append("class Resource {\n") - sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); - sb.append(" cpus: ").append(toIndentedString(cpus)).append("\n"); - sb.append(" memory: ").append(toIndentedString(memory)).append("\n"); - sb.append(" additional: ").append( - toIndentedString(additional)).append("\n"); - sb.append("}"); + .append(" profile: ").append(toIndentedString(profile)).append("\n") + .append(" cpus: ").append(toIndentedString(cpus)).append("\n") + .append(" memory: ").append(toIndentedString(memory)).append("\n") + .append(" additional: ").append( + toIndentedString(additional)).append("\n") + .append("}"); return sb.toString(); } 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/ResourceInformation.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/ResourceInformation.java index f8681768c50..cc726a851c2 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/ResourceInformation.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/ResourceInformation.java @@ -127,13 +127,13 @@ public class ResourceInformation { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ResourceInformation {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" unit: ").append(toIndentedString(unit)).append("\n"); - sb.append(" attributes: ").append(toIndentedString(attributes)) - .append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append("}"); + sb.append("class ResourceInformation {\n") + .append(" value: ").append(toIndentedString(value)).append("\n") + .append(" unit: ").append(toIndentedString(unit)).append("\n") + .append(" attributes: ").append(toIndentedString(attributes)) + .append("\n") + .append(" tags: ").append(toIndentedString(tags)).append("\n") + .append("}"); return sb.toString(); } 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/Service.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/Service.java index 6e031219ba9..4171e189e1d 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/Service.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/Service.java @@ -424,35 +424,38 @@ public class Service extends BaseResource { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Service {\n"); + sb.append("class Service {\n") - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)) - .append("\n"); - sb.append(" artifact: ").append(toIndentedString(artifact)).append("\n"); - sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); - sb.append(" launchTime: ").append(toIndentedString(launchTime)) - .append("\n"); - sb.append(" numberOfRunningContainers: ") - .append(toIndentedString(numberOfRunningContainers)).append("\n"); - sb.append(" lifetime: ").append(toIndentedString(lifetime)).append("\n"); - sb.append(" components: ").append(toIndentedString(components)) - .append("\n"); - sb.append(" configuration: ").append(toIndentedString(configuration)) - .append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" quicklinks: ").append(toIndentedString(quicklinks)) - .append("\n"); - sb.append(" queue: ").append(toIndentedString(queue)).append("\n"); - sb.append(" kerberosPrincipal: ") - .append(toIndentedString(kerberosPrincipal)).append("\n"); - sb.append(" dockerClientConfig: ") - .append(toIndentedString(dockerClientConfig)).append("\n"); - sb.append(" dependencies: ") - .append(toIndentedString(dependencies)).append("\n"); - sb.append("}"); + .append(" name: ").append(toIndentedString(name)).append("\n") + .append(" id: ").append(toIndentedString(id)).append("\n") + .append(" version: ").append(toIndentedString(version)).append("\n") + .append(" description: ").append(toIndentedString(description)) + .append("\n") + .append(" artifact: ").append(toIndentedString(artifact)) + .append("\n") + .append(" resource: ").append(toIndentedString(resource)) + .append("\n") + .append(" launchTime: ").append(toIndentedString(launchTime)) + .append("\n") + .append(" numberOfRunningContainers: ") + .append(toIndentedString(numberOfRunningContainers)).append("\n") + .append(" lifetime: ").append(toIndentedString(lifetime)) + .append("\n") + .append(" components: ").append(toIndentedString(components)) + .append("\n") + .append(" configuration: ").append(toIndentedString(configuration)) + .append("\n") + .append(" state: ").append(toIndentedString(state)).append("\n") + .append(" quicklinks: ").append(toIndentedString(quicklinks)) + .append("\n") + .append(" queue: ").append(toIndentedString(queue)).append("\n") + .append(" kerberosPrincipal: ") + .append(toIndentedString(kerberosPrincipal)).append("\n") + .append(" dockerClientConfig: ") + .append(toIndentedString(dockerClientConfig)).append("\n") + .append(" dependencies: ") + .append(toIndentedString(dependencies)).append("\n") + .append("}"); return sb.toString(); } 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/ServiceStatus.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/ServiceStatus.java index c1bb73a3f4e..60f8f2d891f 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/ServiceStatus.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/ServiceStatus.java @@ -124,13 +124,13 @@ public class ServiceStatus extends BaseResource { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class ServiceStatus {\n"); + sb.append("class ServiceStatus {\n") - sb.append(" diagnostics: ").append(toIndentedString(diagnostics)) - .append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append("}"); + .append(" diagnostics: ").append(toIndentedString(diagnostics)) + .append("\n") + .append(" state: ").append(toIndentedString(state)).append("\n") + .append(" code: ").append(toIndentedString(code)).append("\n") + .append("}"); return sb.toString(); } 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/component/instance/ComponentInstance.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/component/instance/ComponentInstance.java index ec621945447..f44cd6ee611 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/component/instance/ComponentInstance.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/component/instance/ComponentInstance.java @@ -351,18 +351,18 @@ public class ComponentInstance implements EventHandler, comp.reInsertPendingInstance(compInstance); StringBuilder builder = new StringBuilder(); - builder.append(compInstance.getCompInstanceId()).append(": "); - builder.append(event.getContainerId()).append( - " completed. Reinsert back to pending list and requested "); - builder.append("a new container.").append(System.lineSeparator()); - builder.append(" exitStatus=").append( - failureBeforeLaunch || event.getStatus() == null ? null : - event.getStatus().getExitStatus()); - builder.append(", diagnostics="); - builder.append(failureBeforeLaunch ? - FAILED_BEFORE_LAUNCH_DIAG : - (event.getStatus() != null ? event.getStatus().getDiagnostics() : - UPGRADE_FAILED)); + builder.append(compInstance.getCompInstanceId()).append(": ") + .append(event.getContainerId()).append( + " completed. Reinsert back to pending list and requested ") + .append("a new container.").append(System.lineSeparator()) + .append(" exitStatus=").append( + failureBeforeLaunch || event.getStatus() == null ? null : + event.getStatus().getExitStatus()) + .append(", diagnostics=") + .append(failureBeforeLaunch ? + FAILED_BEFORE_LAUNCH_DIAG : + (event.getStatus() != null ? event.getStatus().getDiagnostics() : + UPGRADE_FAILED)); if (event.getStatus() != null && event.getStatus().getExitStatus() != 0) { LOG.error(builder.toString()); 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/containerlaunch/AbstractLauncher.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/containerlaunch/AbstractLauncher.java index c34cc77dcbb..aff07e5ba87 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/containerlaunch/AbstractLauncher.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/containerlaunch/AbstractLauncher.java @@ -166,8 +166,8 @@ public class AbstractLauncher { if (sb.length() > 0) { sb.append(","); } - sb.append(mount.getKey()).append(":"); - sb.append(mount.getValue()).append(":ro"); + sb.append(mount.getKey()).append(":") + .append(mount.getValue()).append(":ro"); } env.put(ENV_DOCKER_CONTAINER_MOUNTS, sb.toString()); } 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/utils/CoreFileSystem.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/utils/CoreFileSystem.java index 50b22e51107..b9a464960d5 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/utils/CoreFileSystem.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/utils/CoreFileSystem.java @@ -97,8 +97,8 @@ public class CoreFileSystem { public String toString() { final StringBuilder sb = new StringBuilder("CoreFileSystem{"); - sb.append("fileSystem=").append(fileSystem.getUri()); - sb.append('}'); + sb.append("fileSystem=").append(fileSystem.getUri()) + .append('}'); return sb.toString(); } 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/utils/PublishedConfiguration.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/utils/PublishedConfiguration.java index 04fbe663f39..e3e96a69987 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/utils/PublishedConfiguration.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/utils/PublishedConfiguration.java @@ -178,9 +178,9 @@ public class PublishedConfiguration { public String toString() { final StringBuilder sb = new StringBuilder("PublishedConfiguration{"); - sb.append("description='").append(description).append('\''); - sb.append(" entries = ").append(entries.size()); - sb.append('}'); + sb.append("description='").append(description).append('\'') + .append(" entries = ").append(entries.size()) + .append('}'); return sb.toString(); } 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/utils/ServiceUtils.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/utils/ServiceUtils.java index 0f0b3265e2d..a76b64d3cf0 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/utils/ServiceUtils.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/utils/ServiceUtils.java @@ -213,8 +213,8 @@ public final class ServiceUtils { return trailing ? separator : ""; } for (Object o : collection) { - b.append(o); - b.append(separator); + b.append(o) + .append(separator); } int length = separator.length(); String s = b.toString(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java index 59b33530b0b..954b9f64864 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java @@ -427,12 +427,13 @@ public abstract class AMRMClient extends public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Capability[").append(capability).append("]"); - sb.append("Priority[").append(priority).append("]"); - sb.append("AllocationRequestId[").append(allocationRequestId).append("]"); - sb.append("ExecutionTypeRequest[").append(executionTypeRequest) - .append("]"); - sb.append("Resource Profile[").append(resourceProfile).append("]"); + sb.append("Capability[").append(capability).append("]") + .append("Priority[").append(priority).append("]") + .append("AllocationRequestId[").append(allocationRequestId) + .append("]") + .append("ExecutionTypeRequest[").append(executionTypeRequest) + .append("]") + .append("Resource Profile[").append(resourceProfile).append("]"); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java index 8cb894134bc..535e6ce56f5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/ApplicationCLI.java @@ -1245,8 +1245,8 @@ public class ApplicationCLI extends YarnCLI { private String getAllValidApplicationStates() { StringBuilder sb = new StringBuilder(); - sb.append("The valid application state can be" + " one of the following: "); - sb.append(ALLSTATES_OPTION + ","); + sb.append("The valid application state can be" + " one of the following: ") + .append(ALLSTATES_OPTION + ","); for (YarnApplicationState appState : YarnApplicationState.values()) { sb.append(appState + ","); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java index 356a8cea1ae..708af3d1766 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RMAdminCLI.java @@ -292,8 +292,8 @@ public class RMAdminCLI extends HAAdmin { if (isHAEnabled) { appendHAUsage(summary); } - summary.append(" [-help [cmd]]"); - summary.append("\n"); + summary.append(" [-help [cmd]]") + .append("\n"); StringBuilder helpBuilder = new StringBuilder(); System.out.println(summary); @@ -513,8 +513,8 @@ public class RMAdminCLI extends HAAdmin { StringBuilder sb = new StringBuilder(); sb.append(username + " :"); for (String group : adminProtocol.getGroupsForUser(username)) { - sb.append(" "); - sb.append(group); + sb.append(" ") + .append(group); } System.out.println(sb); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java index 0d918065070..578a704d5b5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/TopCLI.java @@ -871,43 +871,47 @@ public class TopCLI extends YarnCLI { String currentTime = DateFormatUtils.ISO_8601_EXTENDED_TIME_FORMAT .format(now); - ret.append(CLEAR_LINE); - ret.append(limitLineLength(String.format( - "YARN top - %s, up %s, %d active users, queue(s): %s%n", currentTime, - uptimeStr, queueMetrics.activeUsers, queue), terminalWidth, true)); + ret.append(CLEAR_LINE) + .append(limitLineLength(String.format( + "YARN top - %s, up %s, %d active users, queue(s): %s%n", + currentTime, uptimeStr, queueMetrics.activeUsers, queue), + terminalWidth, true)); - ret.append(CLEAR_LINE); - ret.append(limitLineLength(String.format( - "NodeManager(s): %d total, %d active, %d unhealthy, %d decommissioned," - + " %d lost, %d rebooted%n", nodes.totalNodes, nodes.runningNodes, - nodes.unhealthyNodes, nodes.decommissionedNodes, nodes.lostNodes, - nodes.rebootedNodes), terminalWidth, true)); + ret.append(CLEAR_LINE) + .append(limitLineLength(String.format( + "NodeManager(s)" + + ": %d total, %d active, %d unhealthy, %d decommissioned," + + " %d lost, %d rebooted%n", + nodes.totalNodes, nodes.runningNodes, nodes.unhealthyNodes, + nodes.decommissionedNodes, nodes.lostNodes, + nodes.rebootedNodes), terminalWidth, true)); - ret.append(CLEAR_LINE); - ret.append(limitLineLength(String.format( - "Queue(s) Applications: %d running, %d submitted, %d pending," - + " %d completed, %d killed, %d failed%n", queueMetrics.appsRunning, - queueMetrics.appsSubmitted, queueMetrics.appsPending, - queueMetrics.appsCompleted, queueMetrics.appsKilled, - queueMetrics.appsFailed), terminalWidth, true)); + ret.append(CLEAR_LINE) + .append(limitLineLength(String.format( + "Queue(s) Applications: %d running, %d submitted, %d pending," + + " %d completed, %d killed, %d failed%n", + queueMetrics.appsRunning, queueMetrics.appsSubmitted, + queueMetrics.appsPending, queueMetrics.appsCompleted, + queueMetrics.appsKilled, queueMetrics.appsFailed), terminalWidth, + true)); - ret.append(CLEAR_LINE); - ret.append(limitLineLength(String.format("Queue(s) Mem(GB): %d available," - + " %d allocated, %d pending, %d reserved%n", - queueMetrics.availableMemoryGB, queueMetrics.allocatedMemoryGB, - queueMetrics.pendingMemoryGB, queueMetrics.reservedMemoryGB), - terminalWidth, true)); + ret.append(CLEAR_LINE) + .append(limitLineLength(String.format("Queue(s) Mem(GB): %d available," + + " %d allocated, %d pending, %d reserved%n", + queueMetrics.availableMemoryGB, queueMetrics.allocatedMemoryGB, + queueMetrics.pendingMemoryGB, queueMetrics.reservedMemoryGB), + terminalWidth, true)); - ret.append(CLEAR_LINE); - ret.append(limitLineLength(String.format("Queue(s) VCores: %d available," - + " %d allocated, %d pending, %d reserved%n", - queueMetrics.availableVCores, queueMetrics.allocatedVCores, - queueMetrics.pendingVCores, queueMetrics.reservedVCores), terminalWidth, - true)); + ret.append(CLEAR_LINE) + .append(limitLineLength(String.format("Queue(s) VCores: %d available," + + " %d allocated, %d pending, %d reserved%n", + queueMetrics.availableVCores, queueMetrics.allocatedVCores, + queueMetrics.pendingVCores, queueMetrics.reservedVCores), + terminalWidth, true)); - ret.append(CLEAR_LINE); - ret.append(limitLineLength(String.format( - "Queue(s) Containers: %d allocated, %d pending, %d reserved%n", + ret.append(CLEAR_LINE) + .append(limitLineLength(String.format( + "Queue(s) Containers: %d allocated, %d pending, %d reserved%n", queueMetrics.allocatedContainers, queueMetrics.pendingContainers, queueMetrics.reservedContainers), terminalWidth, true)); return ret.toString(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java index b9081fb01a1..b3dad0a0165 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java @@ -404,18 +404,18 @@ public class ContainerPBImpl extends Container { public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Container: ["); - sb.append("ContainerId: ").append(getId()).append(", "); - sb.append("AllocationRequestId: ").append(getAllocationRequestId()) - .append(", "); - sb.append("Version: ").append(getVersion()).append(", "); - sb.append("NodeId: ").append(getNodeId()).append(", "); - sb.append("NodeHttpAddress: ").append(getNodeHttpAddress()).append(", "); - sb.append("Resource: ").append(getResource()).append(", "); - sb.append("Priority: ").append(getPriority()).append(", "); - sb.append("Token: ").append(getContainerToken()).append(", "); - sb.append("ExecutionType: ").append(getExecutionType()).append(", "); - sb.append("]"); + sb.append("Container: [") + .append("ContainerId: ").append(getId()).append(", ") + .append("AllocationRequestId: ").append(getAllocationRequestId()) + .append(", ") + .append("Version: ").append(getVersion()).append(", ") + .append("NodeId: ").append(getNodeId()).append(", ") + .append("NodeHttpAddress: ").append(getNodeHttpAddress()).append(", ") + .append("Resource: ").append(getResource()).append(", ") + .append("Priority: ").append(getPriority()).append(", ") + .append("Token: ").append(getContainerToken()).append(", ") + .append("ExecutionType: ").append(getExecutionType()).append(", ") + .append("]"); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerStatusPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerStatusPBImpl.java index c43a8ab9620..92b17294caa 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerStatusPBImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerStatusPBImpl.java @@ -90,18 +90,18 @@ public class ContainerStatusPBImpl extends ContainerStatus { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("ContainerStatus: ["); - sb.append("ContainerId: ").append(getContainerId()).append(", "); - sb.append("ExecutionType: ").append(getExecutionType()).append(", "); - sb.append("State: ").append(getState()).append(", "); - sb.append("Capability: ").append(getCapability()).append(", "); - sb.append("Diagnostics: ").append(getDiagnostics()).append(", "); - sb.append("ExitStatus: ").append(getExitStatus()).append(", "); - sb.append("IP: ").append(getIPs()).append(", "); - sb.append("Host: ").append(getHost()).append(", "); - sb.append("ExposedPorts: ").append(getExposedPorts()).append(", "); - sb.append("ContainerSubState: ").append(getContainerSubState()); - sb.append("]"); + sb.append("ContainerStatus: [") + .append("ContainerId: ").append(getContainerId()).append(", ") + .append("ExecutionType: ").append(getExecutionType()).append(", ") + .append("State: ").append(getState()).append(", ") + .append("Capability: ").append(getCapability()).append(", ") + .append("Diagnostics: ").append(getDiagnostics()).append(", ") + .append("ExitStatus: ").append(getExitStatus()).append(", ") + .append("IP: ").append(getIPs()).append(", ") + .append("Host: ").append(getHost()).append(", ") + .append("ExposedPorts: ").append(getExposedPorts()).append(", ") + .append("ContainerSubState: ").append(getContainerSubState()) + .append("]"); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/LocalizationStatusPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/LocalizationStatusPBImpl.java index 3e7a9fe685e..e89d57549d6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/LocalizationStatusPBImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/LocalizationStatusPBImpl.java @@ -77,12 +77,12 @@ public class LocalizationStatusPBImpl extends LocalizationStatus { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("LocalizationStatus: ["); - sb.append("ResourceKey: ").append(getResourceKey()).append(", "); - sb.append("LocalizationState: ").append(getLocalizationState()) - .append(", "); - sb.append("Diagnostics: ").append(getDiagnostics()).append(", "); - sb.append("]"); + sb.append("LocalizationStatus: [") + .append("ResourceKey: ").append(getResourceKey()).append(", ") + .append("LocalizationState: ").append(getLocalizationState()) + .append(", ") + .append("Diagnostics: ").append(getDiagnostics()).append(", ") + .append("]"); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/TokenPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/TokenPBImpl.java index 7aeb460d525..8e888d50e74 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/TokenPBImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/TokenPBImpl.java @@ -184,9 +184,9 @@ public class TokenPBImpl extends Token { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("Token { "); - sb.append("kind: ").append(getKind()).append(", "); - sb.append("service: ").append(getService()).append(" }"); + sb.append("Token { ") + .append("kind: ").append(getKind()).append(", ") + .append("service: ").append(getService()).append(" }"); return sb.toString(); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java index 3cc7ac0fc12..c7c6587597d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java @@ -276,9 +276,9 @@ public class TimelineV2ClientImpl extends TimelineV2Client { } else { StringBuilder msg = new StringBuilder("TimelineClient has reached to max retry times : "); - msg.append(this.maxServiceRetries); - msg.append(" for service address: "); - msg.append(timelineServiceAddress); + msg.append(this.maxServiceRetries) + .append(" for service address: ") + .append(timelineServiceAddress); LOG.error(msg.toString()); throw new IOException(msg.toString(), e); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/LogToolUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/LogToolUtils.java index a6cc159f85a..c242d898482 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/LogToolUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/LogToolUtils.java @@ -89,13 +89,13 @@ public final class LogToolUtils { String containerStr = String.format( LogToolUtils.CONTAINER_ON_NODE_PATTERN, containerId, nodeId); - sb.append(containerStr + "\n"); - sb.append("LogAggregationType: " + logType + "\n"); - sb.append(StringUtils.repeat("=", containerStr.length()) + "\n"); - sb.append("LogType:" + fileName + "\n"); - sb.append("LogLastModifiedTime:" + lastModifiedTime + "\n"); - sb.append("LogLength:" + Long.toString(fileLength) + "\n"); - sb.append("LogContents:\n"); + sb.append(containerStr + "\n") + .append("LogAggregationType: " + logType + "\n") + .append(StringUtils.repeat("=", containerStr.length()) + "\n") + .append("LogType:" + fileName + "\n") + .append("LogLastModifiedTime:" + lastModifiedTime + "\n") + .append("LogLength:" + Long.toString(fileLength) + "\n") + .append("LogContents:\n"); byte[] b = sb.toString().getBytes( Charset.forName("UTF-8")); os.write(b, 0, b.length); @@ -138,13 +138,13 @@ public final class LogToolUtils { String containerStr = String.format( LogToolUtils.CONTAINER_ON_NODE_PATTERN, containerId, nodeId); - sb.append(containerStr + "\n"); - sb.append("LogAggregationType: " + logType + "\n"); - sb.append(StringUtils.repeat("=", containerStr.length()) + "\n"); - sb.append("LogType:" + fileName + "\n"); - sb.append("LogLastModifiedTime:" + lastModifiedTime + "\n"); - sb.append("LogLength:" + Long.toString(fileLength) + "\n"); - sb.append("LogContents:\n"); + sb.append(containerStr + "\n") + .append("LogAggregationType: " + logType + "\n") + .append(StringUtils.repeat("=", containerStr.length()) + "\n") + .append("LogType:" + fileName + "\n") + .append("LogLastModifiedTime:" + lastModifiedTime + "\n") + .append("LogLength:" + Long.toString(fileLength) + "\n") + .append("LogContents:\n"); byte[] b = sb.toString().getBytes( Charset.forName("UTF-8")); os.write(b, 0, b.length); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java index e37308de575..17a8aad5982 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/LogAggregationFileController.java @@ -531,9 +531,9 @@ public abstract class LogAggregationFileController { protected String aggregatedLogSuffix(String fileName) { StringBuilder sb = new StringBuilder(); String endOfFile = "End of LogType:" + fileName; - sb.append("\n" + endOfFile + "\n"); - sb.append(StringUtils.repeat("*", endOfFile.length() + 50) - + "\n\n"); + sb.append("\n" + endOfFile + "\n") + .append(StringUtils.repeat("*", endOfFile.length() + 50) + + "\n\n"); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java index 11e6f866bed..66ccafa92a5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java @@ -150,18 +150,19 @@ public class Graph { public String generateGraphViz(String indent) { StringBuilder sb = new StringBuilder(); if (this.parent == null) { - sb.append("digraph " + name + " {\n"); - sb.append(String.format("graph [ label=%s, fontsize=24, fontname=Helvetica];%n", - wrapSafeString(name))); - sb.append("node [fontsize=12, fontname=Helvetica];\n"); - sb.append("edge [fontsize=9, fontcolor=blue, fontname=Arial];\n"); + sb.append("digraph " + name + " {\n") + .append(String.format( + "graph [ label=%s, fontsize=24, fontname=Helvetica];%n", + wrapSafeString(name))) + .append("node [fontsize=12, fontname=Helvetica];\n") + .append("edge [fontsize=9, fontcolor=blue, fontname=Arial];\n"); } else { sb.append("subgraph cluster_" + name + " {\nlabel=\"" + name + "\"\n"); } for (Graph g : subgraphs) { String ginfo = g.generateGraphViz(indent+" "); - sb.append(ginfo); - sb.append("\n"); + sb.append(ginfo) + .append("\n"); } for (Node n : nodes) { sb.append(String.format( diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ProcfsBasedProcessTree.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ProcfsBasedProcessTree.java index 9ae890a02db..e8b6533fca1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ProcfsBasedProcessTree.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ProcfsBasedProcessTree.java @@ -979,9 +979,9 @@ public class ProcfsBasedProcessTree extends ResourceCalculatorProcessTree { public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("\t").append(this.getName()).append("\n"); - sb.append("\t").append(MemInfo.SIZE.name + ":" + this.getSize()) - .append(" kB\n"); + sb.append("\t").append(this.getName()).append("\n") + .append("\t").append(MemInfo.SIZE.name + ":" + this.getSize()) + .append(" kB\n"); sb.append("\t").append(MemInfo.PSS.name + ":" + this.getPss()) .append(" kB\n"); sb.append("\t").append(MemInfo.RSS.name + ":" + this.getRss()) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSErrorsAndWarningsPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSErrorsAndWarningsPage.java index 1601f8c54ce..ae3c5a0126c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSErrorsAndWarningsPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSErrorsAndWarningsPage.java @@ -47,11 +47,12 @@ public class AHSErrorsAndWarningsPage extends AHSView { private String tablesInit() { StringBuilder b = tableInit().append(", aoColumnDefs: ["); - b.append("{'sType': 'string', 'aTargets': [ 0 ]}"); - b.append(", {'sType': 'string', 'bSearchable': true, 'aTargets': [ 1 ]}"); - b.append(", {'sType': 'numeric', 'bSearchable': false, 'aTargets': [ 2 ]}"); - b.append(", {'sType': 'date', 'aTargets': [ 3 ] }]"); - b.append(", aaSorting: [[3, 'desc']]}"); + b.append("{'sType': 'string', 'aTargets': [ 0 ]}") + .append(", {'sType': 'string', 'bSearchable': true, 'aTargets': [ 1 ]}") + .append( + ", {'sType': 'numeric', 'bSearchable': false, 'aTargets': [ 2 ]}") + .append(", {'sType': 'date', 'aTargets': [ 3 ] }]") + .append(", aaSorting: [[3, 'desc']]}"); return b.toString(); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/records/SubClusterPolicyConfiguration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/records/SubClusterPolicyConfiguration.java index 52807d97dbd..817d270146f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/records/SubClusterPolicyConfiguration.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/store/records/SubClusterPolicyConfiguration.java @@ -154,9 +154,9 @@ public abstract class SubClusterPolicyConfiguration { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(getType()); - sb.append(" : "); - sb.append(getParams()); + sb.append(getType()) + .append(" : ") + .append(getParams()); return sb.toString(); } } \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/utils/FederationStateStoreFacade.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/utils/FederationStateStoreFacade.java index 6933d7cb6ca..60b794f36d1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/utils/FederationStateStoreFacade.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/utils/FederationStateStoreFacade.java @@ -516,8 +516,8 @@ public final class FederationStateStoreFacade { protected String buildCacheKey(String typeName, String methodName, String argName) { StringBuilder buffer = new StringBuilder(); - buffer.append(typeName).append("."); - buffer.append(methodName); + buffer.append(typeName).append(".") + .append(methodName); if (argName != null) { buffer.append("::"); buffer.append(argName); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/sharedcache/SharedCacheUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/sharedcache/SharedCacheUtil.java index 0e294324d58..9e4ad618486 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/sharedcache/SharedCacheUtil.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/sharedcache/SharedCacheUtil.java @@ -71,8 +71,8 @@ public class SharedCacheUtil { // SHARED_CACHE_ROOT/3/c/4/3c4f StringBuilder sb = new StringBuilder(cacheRoot); for (int i = 0; i < cacheDepth; i++) { - sb.append(Path.SEPARATOR_CHAR); - sb.append(checksum.charAt(i)); + sb.append(Path.SEPARATOR_CHAR) + .append(checksum.charAt(i)); } sb.append(Path.SEPARATOR_CHAR).append(checksum); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java index a337eddb245..90b12e9ef80 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java @@ -331,17 +331,17 @@ public class DefaultContainerExecutor extends ContainerExecutor { + containerId + " and exit code: " + exitCode , e); StringBuilder builder = new StringBuilder(); - builder.append("Exception from container-launch.\n"); - builder.append("Container id: ").append(containerId).append("\n"); - builder.append("Exit code: ").append(exitCode).append("\n"); + builder.append("Exception from container-launch.\n") + .append("Container id: ").append(containerId).append("\n") + .append("Exit code: ").append(exitCode).append("\n"); if (!Optional.fromNullable(e.getMessage()).or("").isEmpty()) { - builder.append("Exception message: "); - builder.append(e.getMessage()).append("\n"); + builder.append("Exception message: ") + .append(e.getMessage()).append("\n"); } if (!shExec.getOutput().isEmpty()) { - builder.append("Shell output: "); - builder.append(shExec.getOutput()).append("\n"); + builder.append("Shell output: ") + .append(shExec.getOutput()).append("\n"); } String diagnostics = builder.toString(); logOutput(diagnostics); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java index 56ca5b3f3b0..600f8023326 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LinuxContainerExecutor.java @@ -597,10 +597,10 @@ public class LinuxContainerExecutor extends ContainerExecutor { + containerId + " and exit code: " + exitCode, e); StringBuilder builder = new StringBuilder(); - builder.append("Exception from container-launch.\n"); - builder.append("Container id: " + containerId + "\n"); - builder.append("Exit code: " + exitCode + "\n"); - builder.append("Exception message: " + e.getMessage() + "\n"); + builder.append("Exception from container-launch.\n") + .append("Container id: " + containerId + "\n") + .append("Exit code: " + exitCode + "\n") + .append("Exception message: " + e.getMessage() + "\n"); if (!Optional.fromNullable(e.getErrorOutput()).or("").isEmpty()) { builder.append("Shell error output: " + e.getErrorOutput() + "\n"); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java index 757c7b88ac3..184482621b1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ClientRMService.java @@ -779,8 +779,8 @@ public class ClientRMService extends AbstractService implements String diagnostics = org.apache.commons.lang3.StringUtils .trimToNull(request.getDiagnostics()); if (diagnostics != null) { - message.append(" with diagnostic message: "); - message.append(diagnostics); + message.append(" with diagnostic message: ") + .append(diagnostics); } this.rmContext.getDispatcher().getEventHandler() diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java index 3ce014dc05d..05787fe5a02 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/amlauncher/AMLauncher.java @@ -352,8 +352,8 @@ public class AMLauncher implements Runnable { LOG.info("Error cleaning master ", ie); } catch (YarnException e) { StringBuilder sb = new StringBuilder("Container "); - sb.append(masterContainer.getId().toString()); - sb.append(" is not handled by this NodeManager"); + sb.append(masterContainer.getId().toString()) + .append(" is not handled by this NodeManager"); if (!e.getMessage().contains(sb.toString())) { // Ignoring if container is already killed by Node Manager. LOG.info("Error cleaning master ", e); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/invariants/MetricsInvariantChecker.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/invariants/MetricsInvariantChecker.java index ef4b9d071bd..51a7fb02464 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/invariants/MetricsInvariantChecker.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/invariants/MetricsInvariantChecker.java @@ -127,9 +127,9 @@ public class MetricsInvariantChecker extends InvariantsChecker { } invariants.put(inv, scriptEngine.compile(inv)); - sb.append(" ("); - sb.append(inv); - sb.append(") "); + sb.append(" (") + .append(inv) + .append(") "); } // create a single large combined invariant for speed of checking diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/NodeAttributesManagerImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/NodeAttributesManagerImpl.java index 90cf110d41c..99272d42870 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/NodeAttributesManagerImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/nodelabels/NodeAttributesManagerImpl.java @@ -194,11 +194,11 @@ public class NodeAttributesManagerImpl extends NodeAttributesManager { default: break; } - logMsg.append(" NM = "); - logMsg.append(entry.getKey()); - logMsg.append(", attributes=[ "); - logMsg.append(StringUtils.join(entry.getValue().keySet(), ",")); - logMsg.append("] ,"); + logMsg.append(" NM = ") + .append(entry.getKey()) + .append(", attributes=[ ") + .append(StringUtils.join(entry.getValue().keySet(), ",")) + .append("] ,"); } if (LOG.isDebugEnabled()) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractResourceUsage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractResourceUsage.java index 93f8ce2b980..664cb3505a2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractResourceUsage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractResourceUsage.java @@ -56,15 +56,15 @@ public class AbstractResourceUsage { } /** - * Use enum here to make implementation more cleaner and readable. - * Indicates array index for each resource usage type. + * Use enum here to make implementation more cleaner and readable. Indicates + * array index for each resource usage type. */ public enum ResourceType { // CACHED_USED and CACHED_PENDING may be read by anyone, but must only // be written by ordering policies USED(0), PENDING(1), AMUSED(2), RESERVED(3), CACHED_USED(4), CACHED_PENDING( - 5), AMLIMIT(6), MIN_RESOURCE(7), MAX_RESOURCE(8), EFF_MIN_RESOURCE( - 9), EFF_MAX_RESOURCE(10), USERAMLIMIT(11); + 5), AMLIMIT(6), MIN_RESOURCE(7), MAX_RESOURCE( + 8), EFF_MIN_RESOURCE(9), EFF_MAX_RESOURCE(10), USERAMLIMIT(11); private int idx; @@ -94,13 +94,14 @@ public class AbstractResourceUsage { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("{used=" + resArr.get(ResourceType.USED.idx) + ", "); - sb.append("pending=" + resArr.get(ResourceType.PENDING.idx) + ", "); - sb.append("am_used=" + resArr.get(ResourceType.AMUSED.idx) + ", "); - sb.append("reserved=" + resArr.get(ResourceType.RESERVED.idx) + ", "); - sb.append("min_eff=" + resArr.get(ResourceType.EFF_MIN_RESOURCE.idx) + ", "); - sb.append( - "max_eff=" + resArr.get(ResourceType.EFF_MAX_RESOURCE.idx) + "}"); + sb.append("{used=" + resArr.get(ResourceType.USED.idx) + ", ") + .append("pending=" + resArr.get(ResourceType.PENDING.idx) + ", ") + .append("am_used=" + resArr.get(ResourceType.AMUSED.idx) + ", ") + .append("reserved=" + resArr.get(ResourceType.RESERVED.idx) + ", ") + .append( + "min_eff=" + resArr.get(ResourceType.EFF_MIN_RESOURCE.idx) + ", ") + .append( + "max_eff=" + resArr.get(ResourceType.EFF_MAX_RESOURCE.idx) + "}"); return sb.toString(); } } @@ -134,7 +135,7 @@ public class AbstractResourceUsage { readLock.lock(); Resource allOfType = Resources.createResource(0); for (Map.Entry usageEntry : usages.entrySet()) { - //all usages types are initialized + // all usages types are initialized Resources.addTo(allOfType, usageEntry.getValue().resArr.get(type.idx)); } return allOfType; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java index f9df2b829b7..0439a3f8550 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerApplicationAttempt.java @@ -1357,9 +1357,9 @@ public class SchedulerApplicationAttempt implements SchedulableEntity { return; } StringBuilder diagnosticMessageBldr = new StringBuilder(); - diagnosticMessageBldr.append("["); - diagnosticMessageBldr.append(fdf.format(System.currentTimeMillis())); - diagnosticMessageBldr.append("] "); + diagnosticMessageBldr.append("[") + .append(fdf.format(System.currentTimeMillis())) + .append("] "); switch (state) { case INACTIVATED: diagnosticMessageBldr.append(state.diagnosticMessage); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/activities/ActivityNode.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/activities/ActivityNode.java index a03814c16fe..0cf9604fc99 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/activities/ActivityNode.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/activities/ActivityNode.java @@ -94,9 +94,9 @@ public class ActivityNode { public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(this.activityNodeName + " "); - sb.append(this.appPriority + " "); - sb.append(this.state + " "); + sb.append(this.activityNodeName + " ") + .append(this.appPriority + " ") + .append(this.state + " "); if (!this.diagnostic.equals("")) { sb.append(this.diagnostic + "\n"); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java index 333d1f1fc5e..3920987e337 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java @@ -249,8 +249,8 @@ public class LeafQueue extends AbstractCSQueue { StringBuilder labelStrBuilder = new StringBuilder(); if (accessibleLabels != null) { for (String s : accessibleLabels) { - labelStrBuilder.append(s); - labelStrBuilder.append(","); + labelStrBuilder.append(s) + .append(","); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java index cd7518f26db..6d3794e5300 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/ParentQueue.java @@ -136,8 +136,8 @@ public class ParentQueue extends AbstractCSQueue { StringBuilder labelStrBuilder = new StringBuilder(); if (accessibleLabels != null) { for (String s : accessibleLabels) { - labelStrBuilder.append(s); - labelStrBuilder.append(","); + labelStrBuilder.append(s) + .append(","); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueCapacities.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueCapacities.java index 35c084bb4d3..51b9fa827e8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueCapacities.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/QueueCapacities.java @@ -69,15 +69,15 @@ public class QueueCapacities { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("{used=" + capacitiesArr[0] + "%, "); - sb.append("abs_used=" + capacitiesArr[1] + "%, "); - sb.append("max_cap=" + capacitiesArr[2] + "%, "); - sb.append("abs_max_cap=" + capacitiesArr[3] + "%, "); - sb.append("cap=" + capacitiesArr[4] + "%, "); - sb.append("abs_cap=" + capacitiesArr[5] + "%}"); - sb.append("max_am_perc=" + capacitiesArr[6] + "%}"); - sb.append("reserved_cap=" + capacitiesArr[7] + "%}"); - sb.append("abs_reserved_cap=" + capacitiesArr[8] + "%}"); + sb.append("{used=" + capacitiesArr[0] + "%, ") + .append("abs_used=" + capacitiesArr[1] + "%, ") + .append("max_cap=" + capacitiesArr[2] + "%, ") + .append("abs_max_cap=" + capacitiesArr[3] + "%, ") + .append("cap=" + capacitiesArr[4] + "%, ") + .append("abs_cap=" + capacitiesArr[5] + "%}") + .append("max_am_perc=" + capacitiesArr[6] + "%}") + .append("reserved_cap=" + capacitiesArr[7] + "%}") + .append("abs_reserved_cap=" + capacitiesArr[8] + "%}"); return sb.toString(); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/PendingAsk.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/PendingAsk.java index 2ed3e837188..d932392bb4a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/PendingAsk.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/PendingAsk.java @@ -53,11 +53,11 @@ public class PendingAsk { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append(""); return sb.toString(); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java index 114ee5116f4..d0e8220697a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/common/fica/FiCaSchedulerApp.java @@ -999,25 +999,24 @@ public class FiCaSchedulerApp extends SchedulerApplicationAttempt { protected void getPendingAppDiagnosticMessage( StringBuilder diagnosticMessage) { LeafQueue queue = getCSLeafQueue(); - diagnosticMessage.append(" Details : AM Partition = "); - diagnosticMessage.append(appAMNodePartitionName.isEmpty() - ? NodeLabel.DEFAULT_NODE_LABEL_PARTITION : appAMNodePartitionName); - diagnosticMessage.append("; "); - diagnosticMessage.append("AM Resource Request = "); - diagnosticMessage.append(getAMResource(appAMNodePartitionName)); - diagnosticMessage.append("; "); - diagnosticMessage.append("Queue Resource Limit for AM = "); - diagnosticMessage - .append(queue.getAMResourceLimitPerPartition(appAMNodePartitionName)); - diagnosticMessage.append("; "); - diagnosticMessage.append("User AM Resource Limit of the queue = "); - diagnosticMessage.append(queue.getUserAMResourceLimitPerPartition( - appAMNodePartitionName, getUser())); - diagnosticMessage.append("; "); - diagnosticMessage.append("Queue AM Resource Usage = "); - diagnosticMessage.append( - queue.getQueueResourceUsage().getAMUsed(appAMNodePartitionName)); - diagnosticMessage.append("; "); + diagnosticMessage.append(" Details : AM Partition = ") + .append(appAMNodePartitionName.isEmpty() + ? NodeLabel.DEFAULT_NODE_LABEL_PARTITION : appAMNodePartitionName) + .append("; ") + .append("AM Resource Request = ") + .append(getAMResource(appAMNodePartitionName)) + .append("; ") + .append("Queue Resource Limit for AM = ") + .append(queue.getAMResourceLimitPerPartition(appAMNodePartitionName)) + .append("; ") + .append("User AM Resource Limit of the queue = ") + .append(queue.getUserAMResourceLimitPerPartition( + appAMNodePartitionName, getUser())) + .append("; ") + .append("Queue AM Resource Usage = ") + .append( + queue.getQueueResourceUsage().getAMUsed(appAMNodePartitionName)) + .append("; "); } protected void getActivedAppDiagnosticMessage( @@ -1025,39 +1024,39 @@ public class FiCaSchedulerApp extends SchedulerApplicationAttempt { LeafQueue queue = getCSLeafQueue(); QueueCapacities queueCapacities = queue.getQueueCapacities(); QueueResourceQuotas queueResourceQuotas = queue.getQueueResourceQuotas(); - diagnosticMessage.append(" Details : AM Partition = "); - diagnosticMessage.append(appAMNodePartitionName.isEmpty() - ? NodeLabel.DEFAULT_NODE_LABEL_PARTITION : appAMNodePartitionName); - diagnosticMessage.append(" ; "); - diagnosticMessage.append("Partition Resource = "); - diagnosticMessage.append(rmContext.getNodeLabelManager() - .getResourceByLabel(appAMNodePartitionName, Resources.none())); - diagnosticMessage.append(" ; "); - diagnosticMessage.append("Queue's Absolute capacity = "); - diagnosticMessage.append( - queueCapacities.getAbsoluteCapacity(appAMNodePartitionName) * 100); - diagnosticMessage.append(" % ; "); - diagnosticMessage.append("Queue's Absolute used capacity = "); - diagnosticMessage.append( - queueCapacities.getAbsoluteUsedCapacity(appAMNodePartitionName) * 100); - diagnosticMessage.append(" % ; "); - diagnosticMessage.append("Queue's Absolute max capacity = "); - diagnosticMessage.append( - queueCapacities.getAbsoluteMaximumCapacity(appAMNodePartitionName) - * 100); - diagnosticMessage.append(" % ; "); - diagnosticMessage.append("Queue's capacity (absolute resource) = "); - diagnosticMessage.append( - queueResourceQuotas.getEffectiveMinResource(appAMNodePartitionName)); - diagnosticMessage.append(" ; "); - diagnosticMessage.append("Queue's used capacity (absolute resource) = "); - diagnosticMessage - .append(queue.getQueueResourceUsage().getUsed(appAMNodePartitionName)); - diagnosticMessage.append(" ; "); - diagnosticMessage.append("Queue's max capacity (absolute resource) = "); - diagnosticMessage.append( - queueResourceQuotas.getEffectiveMaxResource(appAMNodePartitionName)); - diagnosticMessage.append(" ; "); + diagnosticMessage.append(" Details : AM Partition = ") + .append(appAMNodePartitionName.isEmpty() + ? NodeLabel.DEFAULT_NODE_LABEL_PARTITION : appAMNodePartitionName) + .append(" ; ") + .append("Partition Resource = ") + .append(rmContext.getNodeLabelManager() + .getResourceByLabel(appAMNodePartitionName, Resources.none())) + .append(" ; ") + .append("Queue's Absolute capacity = ") + .append( + queueCapacities.getAbsoluteCapacity(appAMNodePartitionName) * 100) + .append(" % ; ") + .append("Queue's Absolute used capacity = ") + .append( + queueCapacities.getAbsoluteUsedCapacity(appAMNodePartitionName) + * 100) + .append(" % ; ") + .append("Queue's Absolute max capacity = ") + .append( + queueCapacities.getAbsoluteMaximumCapacity(appAMNodePartitionName) + * 100) + .append(" % ; ") + .append("Queue's capacity (absolute resource) = ") + .append( + queueResourceQuotas.getEffectiveMinResource(appAMNodePartitionName)) + .append(" ; ") + .append("Queue's used capacity (absolute resource) = ") + .append(queue.getQueueResourceUsage().getUsed(appAMNodePartitionName)) + .append(" ; ") + .append("Queue's max capacity (absolute resource) = ") + .append( + queueResourceQuotas.getEffectiveMaxResource(appAMNodePartitionName)) + .append(" ; "); } /** @@ -1082,15 +1081,15 @@ public class FiCaSchedulerApp extends SchedulerApplicationAttempt { appSkipNodeDiagnostics = null; } diagnosticMessageBldr.append( - CSAMContainerLaunchDiagnosticsConstants.LAST_NODE_PROCESSED_MSG); - diagnosticMessageBldr.append(node.getNodeID()); - diagnosticMessageBldr.append(" ( Partition : "); - diagnosticMessageBldr.append(node.getLabels()); - diagnosticMessageBldr.append(", Total resource : "); - diagnosticMessageBldr.append(node.getTotalResource()); - diagnosticMessageBldr.append(", Available resource : "); - diagnosticMessageBldr.append(node.getUnallocatedResource()); - diagnosticMessageBldr.append(" )."); + CSAMContainerLaunchDiagnosticsConstants.LAST_NODE_PROCESSED_MSG) + .append(node.getNodeID()) + .append(" ( Partition : ") + .append(node.getLabels()) + .append(", Total resource : ") + .append(node.getTotalResource()) + .append(", Available resource : ") + .append(node.getUnallocatedResource()) + .append(" )."); updateAMContainerDiagnostics(AMState.ACTIVATED, diagnosticMessageBldr.toString()); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/event/ContainerPreemptEvent.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/event/ContainerPreemptEvent.java index df1b676f0b3..1397f6f116b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/event/ContainerPreemptEvent.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/event/ContainerPreemptEvent.java @@ -48,8 +48,8 @@ public class ContainerPreemptEvent extends SchedulerEvent { @Override public String toString() { StringBuilder sb = new StringBuilder(super.toString()); - sb.append(" ").append(getAppId()); - sb.append(" ").append(getContainer().getContainerId()); + sb.append(" ").append(getAppId()) + .append(" ").append(getContainer().getContainerId()); return sb.toString(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java index 2a6657aa5df..4f5b4253b06 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSAppAttempt.java @@ -1399,9 +1399,9 @@ public class FSAppAttempt extends SchedulerApplicationAttempt } StringBuilder diagnosticMessageBldr = new StringBuilder(); - diagnosticMessageBldr.append(" (Resource request: "); - diagnosticMessageBldr.append(resource); - diagnosticMessageBldr.append(reason); + diagnosticMessageBldr.append(" (Resource request: ") + .append(resource) + .append(reason); updateAMContainerDiagnostics(AMState.INACTIVATED, diagnosticMessageBldr.toString()); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java index 4dfb9d9ccd0..8e7974043ed 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java @@ -233,12 +233,12 @@ class NodesPage extends RmView { private String nodesTableInit() { StringBuilder b = tableInit().append(", 'aaData': nodeTableData") .append(", bDeferRender: true").append(", bProcessing: true") - .append(", aoColumnDefs: ["); - b.append("{'bSearchable': false, 'aTargets': [ 7 ]}"); - b.append(", {'sType': 'title-numeric', 'bSearchable': false, " - + "'aTargets': [ 9, 10 ] }"); - b.append(", {'sType': 'title-numeric', 'aTargets': [ 5 ]}"); - b.append("]}"); + .append(", aoColumnDefs: [") + .append("{'bSearchable': false, 'aTargets': [ 7 ]}") + .append(", {'sType': 'title-numeric', 'bSearchable': false, " + + "'aTargets': [ 9, 10 ] }") + .append(", {'sType': 'title-numeric', 'aTargets': [ 5 ]}") + .append("]}"); return b.toString(); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMErrorsAndWarningsPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMErrorsAndWarningsPage.java index c2ac59d20f7..77fe0cc5803 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMErrorsAndWarningsPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMErrorsAndWarningsPage.java @@ -44,11 +44,12 @@ public class RMErrorsAndWarningsPage extends RmView { private String tablesInit() { StringBuilder b = tableInit().append(", aoColumnDefs: ["); - b.append("{'sType': 'string', 'aTargets': [ 0 ]}"); - b.append(", {'sType': 'string', 'bSearchable': true, 'aTargets': [ 1 ]}"); - b.append(", {'sType': 'numeric', 'bSearchable': false, 'aTargets': [ 2 ]}"); - b.append(", {'sType': 'date', 'aTargets': [ 3 ] }]"); - b.append(", aaSorting: [[3, 'desc']]}"); + b.append("{'sType': 'string', 'aTargets': [ 0 ]}") + .append(", {'sType': 'string', 'bSearchable': true, 'aTargets': [ 1 ]}") + .append( + ", {'sType': 'numeric', 'bSearchable': false, 'aTargets': [ 2 ]}") + .append(", {'sType': 'date', 'aTargets': [ 3 ] }]") + .append(", aaSorting: [[3, 'desc']]}"); return b.toString(); } } \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationPage.java index ddd2866e3b1..02ec1a24020 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/FederationPage.java @@ -47,11 +47,11 @@ class FederationPage extends RouterView { private String rmsTableInit() { StringBuilder b = tableInit().append(", aoColumnDefs: ["); - b.append("{'bSearchable': false, 'aTargets': [ 7 ]}"); - b.append(", {'sType': 'title-numeric', 'bSearchable': false, " - + "'aTargets': [ 8, 9 ] }"); - b.append(", {'sType': 'title-numeric', 'aTargets': [ 5 ]}"); - b.append("]}"); + b.append("{'bSearchable': false, 'aTargets': [ 7 ]}") + .append(", {'sType': 'title-numeric', 'bSearchable': false, " + + "'aTargets': [ 8, 9 ] }") + .append(", {'sType': 'title-numeric', 'aTargets': [ 5 ]}") + .append("]}"); return b.toString(); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/NodesPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/NodesPage.java index 0351cbac3a3..7b2a3da7650 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/NodesPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/webapp/NodesPage.java @@ -50,11 +50,11 @@ class NodesPage extends RouterView { private String nodesTableInit() { StringBuilder b = tableInit().append(", aoColumnDefs: ["); - b.append("{'bSearchable': false, 'aTargets': [ 7 ]}"); - b.append(", {'sType': 'title-numeric', 'bSearchable': false, " - + "'aTargets': [ 2, 3, 4, 5, 6 ] }"); - b.append(", {'sType': 'title-numeric', 'aTargets': [ 5 ]}"); - b.append("]}"); + b.append("{'bSearchable': false, 'aTargets': [ 7 ]}") + .append(", {'sType': 'title-numeric', 'bSearchable': false, " + + "'aTargets': [ 2, 3, 4, 5, 6 ] }") + .append(", {'sType': 'title-numeric', 'aTargets': [ 5 ]}") + .append("]}"); return b.toString(); } } \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java index 77a021c5cf9..de944cbc89c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerManagerSecurity.java @@ -375,8 +375,8 @@ public class TestContainerManagerSecurity extends KerberosSecurityTestcase { // authentication... It should complain saying container was recently // stopped. sb = new StringBuilder("Container "); - sb.append(validContainerId); - sb.append(" was recently stopped on node manager"); + sb.append(validContainerId) + .append(" was recently stopped on node manager"); Assert.assertTrue(testGetContainer(rpc, validAppAttemptId, validNode, validContainerId, validNMToken, true).contains(sb.toString())); @@ -385,9 +385,9 @@ public class TestContainerManagerSecurity extends KerberosSecurityTestcase { // This should fail as container is removed from recently tracked finished // containers. - sb = new StringBuilder("Container "); - sb.append(validContainerId.toString()); - sb.append(" is not handled by this NodeManager"); + sb = new StringBuilder("Container ") + .append(validContainerId.toString()) + .append(" is not handled by this NodeManager"); Assert.assertTrue(testGetContainer(rpc, validAppAttemptId, validNode, validContainerId, validNMToken, false).contains(sb.toString())); @@ -708,8 +708,8 @@ public class TestContainerManagerSecurity extends KerberosSecurityTestcase { nodeId, user, r, Priority.newInstance(0), 0); StringBuilder sb = new StringBuilder("Given Container "); - sb.append(cId2); - sb.append(" seems to have an illegally generated token."); + sb.append(cId2) + .append(" seems to have an illegally generated token."); Assert.assertTrue(testStartContainer(rpc, appAttemptId, nodeId, containerToken2, nmToken, true).contains(sb.toString())); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineSchemaCreator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineSchemaCreator.java index b1593c5101a..4263fac62b9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineSchemaCreator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineSchemaCreator.java @@ -237,28 +237,29 @@ public final class HBaseTimelineSchemaCreator implements SchemaCreator { private static void printUsage() { StringBuilder usage = new StringBuilder("Command Usage: \n"); - usage.append("TimelineSchemaCreator [-help] Display help info" + - " for all commands. Or\n"); - usage.append("TimelineSchemaCreator -create [OPTIONAL_OPTIONS]" + - " Create hbase tables.\n\n"); - usage.append("The Optional options for creating tables include: \n"); - usage.append("[-entityTableName ] " + - "The name of the Entity table\n"); - usage.append("[-entityMetricsTTL ]" + - " TTL for metrics in the Entity table\n"); - usage.append("[-appToflowTableName ]" + - " The name of the AppToFlow table\n"); - usage.append("[-applicationTableName ]" + - " The name of the Application table\n"); - usage.append("[-applicationMetricsTTL ]" + - " TTL for metrics in the Application table\n"); - usage.append("[-subApplicationTableName ]" + - " The name of the SubApplication table\n"); - usage.append("[-subApplicationMetricsTTL " + - " ]" + - " TTL for metrics in the SubApplication table\n"); - usage.append("[-skipExistingTable] Whether to skip existing" + - " hbase tables\n"); + usage + .append("TimelineSchemaCreator [-help] Display help info" + + " for all commands. Or\n") + .append("TimelineSchemaCreator -create [OPTIONAL_OPTIONS]" + + " Create hbase tables.\n\n") + .append("The Optional options for creating tables include: \n") + .append("[-entityTableName ] " + + "The name of the Entity table\n") + .append("[-entityMetricsTTL ]" + + " TTL for metrics in the Entity table\n") + .append("[-appToflowTableName ]" + + " The name of the AppToFlow table\n") + .append("[-applicationTableName ]" + + " The name of the Application table\n") + .append("[-applicationMetricsTTL ]" + + " TTL for metrics in the Application table\n") + .append("[-subApplicationTableName ]" + + " The name of the SubApplication table\n") + .append("[-subApplicationMetricsTTL " + + " ]" + + " TTL for metrics in the SubApplication table\n") + .append("[-skipExistingTable] Whether to skip existing" + + " hbase tables\n"); System.out.println(usage.toString()); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineSchemaUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineSchemaUtils.java index e5f92cccc43..d3b9f54e7d6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineSchemaUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/HBaseTimelineSchemaUtils.java @@ -146,11 +146,11 @@ public final class HBaseTimelineSchemaUtils { */ public static String convertApplicationIdToString(ApplicationId appId) { StringBuilder sb = new StringBuilder(64); - sb.append(ApplicationId.appIdStrPrefix); - sb.append("_"); - sb.append(appId.getClusterTimestamp()); - sb.append('_'); - sb.append(APP_ID_FORMAT.get().format(appId.getId())); + sb.append(ApplicationId.appIdStrPrefix) + .append("_") + .append(appId.getClusterTimestamp()) + .append('_') + .append(APP_ID_FORMAT.get().format(appId.getId())); return sb.toString(); } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/Separator.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/Separator.java index 5090b4d60c5..b5cbcf21ab6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/Separator.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/Separator.java @@ -330,8 +330,8 @@ public enum Separator { StringBuilder sb = new StringBuilder(encode(items[0].toString())); // Start at 1, we've already grabbed the first value at index 0 for (int i = 1; i < items.length; i++) { - sb.append(this.value); - sb.append(encode(items[i].toString())); + sb.append(this.value) + .append(encode(items[i].toString())); } return sb.toString(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/FlowRunRowKey.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/FlowRunRowKey.java index 7ce91cfed5c..118177a2da3 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/FlowRunRowKey.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/FlowRunRowKey.java @@ -106,12 +106,12 @@ public class FlowRunRowKey { @Override public String toString() { StringBuilder flowKeyStr = new StringBuilder(); - flowKeyStr.append("{clusterId=" + clusterId); - flowKeyStr.append(" userId=" + userId); - flowKeyStr.append(" flowName=" + flowName); - flowKeyStr.append(" flowRunId="); - flowKeyStr.append(flowRunId); - flowKeyStr.append("}"); + flowKeyStr.append("{clusterId=" + clusterId) + .append(" userId=" + userId) + .append(" flowName=" + flowName) + .append(" flowRunId=") + .append(flowRunId) + .append("}"); return flowKeyStr.toString(); }