You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by sl...@apache.org on 2026/01/22 09:08:23 UTC
(hadoop) branch trunk updated: YARN-11874. ResourceManager REST API backward compatibility with Jersey1 (#8033) Contributed by Bence Kosztolnik.
This is an automated email from the ASF dual-hosted git repository.
slfan1989 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 94ce2f02de8 YARN-11874. ResourceManager REST API backward compatibility with Jersey1 (#8033) Contributed by Bence Kosztolnik.
94ce2f02de8 is described below
commit 94ce2f02de893526f8dc3bb09350da65f3affd8e
Author: K0K0V0K <10...@users.noreply.github.com>
AuthorDate: Thu Jan 22 10:08:17 2026 +0100
YARN-11874. ResourceManager REST API backward compatibility with Jersey1 (#8033) Contributed by Bence Kosztolnik.
* YARN-11874. fix YARN rest if to be backward compatible with jersey1 behavior.
Reviewed-by: Benjamin Teke <bt...@apache.org>
Signed-off-by: Shilun Fan <sl...@apache.org>
---
dev-support/Jenkinsfile | 4 +-
.../hadoop-client-minicluster/pom.xml | 7 +
hadoop-project/pom.xml | 20 +
.../hadoop-yarn-server-resourcemanager/pom.xml | 12 +-
.../federation/FederationStateStoreHeartbeat.java | 29 +-
.../federation/FederationStateStoreService.java | 6 +-
.../webapp/JAXBContextResolver.java | 145 +-
.../server/resourcemanager/webapp/RMWebApp.java | 5 +-
.../resourcemanager/webapp/dao/NodeLabelsInfo.java | 4 +-
.../jsonprovider/ClassSerialisationConfig.java | 241 ++++
.../jsonprovider/ExcludeRootJSONProvider.java | 146 ++
.../jsonprovider/IncludeRootJSONProvider.java | 144 ++
.../webapp/jsonprovider/JsonProviderFeature.java | 67 +
.../yarn/server/resourcemanager/TestRMHA.java | 8 +-
.../TestFederationRMStateStoreService.java | 17 +-
.../webapp/TestRMWebServiceAppsNodelabel.java | 10 +-
.../resourcemanager/webapp/TestRMWebServices.java | 9 +-
.../webapp/TestRMWebServicesAppAttempts.java | 8 +-
.../TestRMWebServicesAppCustomResourceTypes.java | 4 +-
.../webapp/TestRMWebServicesApps.java | 92 +-
.../TestRMWebServicesAppsCustomResourceTypes.java | 8 +-
.../webapp/TestRMWebServicesAppsModification.java | 122 +-
.../webapp/TestRMWebServicesCapacitySched.java | 8 +-
...TestRMWebServicesCapacitySchedDefaultLabel.java | 8 +-
...estRMWebServicesCapacitySchedDynamicConfig.java | 9 +-
...icesCapacitySchedDynamicConfigAbsoluteMode.java | 9 +-
...rvicesCapacitySchedDynamicConfigWeightMode.java | 9 +-
...cesCapacitySchedDynamicConfigWeightModeDQC.java | 9 +-
...ebServicesCapacitySchedLegacyQueueCreation.java | 9 +-
...pacitySchedLegacyQueueCreationAbsoluteMode.java | 4 +-
...WebServicesCapacitySchedulerConfigMutation.java | 17 +-
...estRMWebServicesCapacitySchedulerMixedMode.java | 5 +-
...itySchedulerMixedModeAbsoluteAndPercentage.java | 5 +-
...lerMixedModeAbsoluteAndPercentageAndWeight.java | 5 +-
...edModeAbsoluteAndPercentageAndWeightVector.java | 5 +-
...edulerMixedModeAbsoluteAndPercentageVector.java | 5 +-
...apacitySchedulerMixedModeAbsoluteAndWeight.java | 5 +-
...ySchedulerMixedModeAbsoluteAndWeightVector.java | 5 +-
...acitySchedulerMixedModePercentageAndWeight.java | 5 +-
...chedulerMixedModePercentageAndWeightVector.java | 5 +-
.../TestRMWebServicesConfigurationMutation.java | 86 +-
.../webapp/TestRMWebServicesContainers.java | 9 +-
...estRMWebServicesCustomResourceTypesCommons.java | 2 +-
...RMWebServicesDelegationTokenAuthentication.java | 4 +-
.../webapp/TestRMWebServicesDelegationTokens.java | 8 +-
.../TestRMWebServicesForCSWithPartitions.java | 5 +-
.../webapp/TestRMWebServicesNodeLabels.java | 45 +-
.../webapp/TestRMWebServicesNodes.java | 37 +-
.../webapp/TestRMWebServicesReservation.java | 121 +-
.../TestRMWebServicesSchedulerActivities.java | 7 +-
...esSchedulerActivitiesWithMultiNodesEnabled.java | 5 +-
.../resourcemanager/webapp/TestWebServiceUtil.java | 49 +-
.../TestRMWebServicesFairScheduler.java | 7 +-
...ebServicesFairSchedulerCustomResourceTypes.java | 11 +-
.../webapp/helper/AppInfoJsonVerifications.java | 5 +-
.../webapp/reader/AppStateReader.java | 71 -
.../ApplicationSubmissionContextInfoReader.java | 75 -
.../webapp/reader/LabelsToNodesInfoReader.java | 74 -
.../webapp/reader/NodeLabelsInfoReader.java | 74 -
.../webapp/reader/NodeToLabelsInfoReader.java | 74 -
.../webapp/reader/ResourceOptionInfoReader.java | 74 -
.../ApplicationSubmissionContextInfoWriter.java | 89 --
.../webapp/writer/ResourceOptionInfoWriter.java | 87 --
.../webapp/writer/SchedConfUpdateInfoWriter.java | 87 --
.../hadoop/yarn/webapp/TestRMWithCSRFFilter.java | 5 +-
...igmutation-absolute-hierarchy-after-update.json | 412 ++----
...gmutation-absolute-hierarchy-before-update.json | 420 ++----
...ion-absolute-hierarchy-legacy-after-update.json | 412 ++----
...on-absolute-hierarchy-legacy-before-update.json | 420 ++----
.../webapp/dynamic-testAbsoluteMode-0.json | 624 +++-----
.../webapp/dynamic-testAbsoluteMode-16.json | 588 +++-----
.../webapp/dynamic-testAbsoluteMode-32.json | 588 +++-----
.../webapp/dynamic-testAbsoluteMode-legacy-0.json | 616 +++-----
.../webapp/dynamic-testPercentageMode-0.json | 600 +++-----
.../webapp/dynamic-testPercentageMode-16.json | 564 +++-----
.../webapp/dynamic-testPercentageMode-32.json | 564 +++-----
.../dynamic-testPercentageMode-legacy-0.json | 564 +++-----
.../resources/webapp/dynamic-testWeightMode-0.json | 600 +++-----
.../webapp/dynamic-testWeightMode-16.json | 564 +++-----
.../webapp/dynamic-testWeightMode-32.json | 564 +++-----
.../webapp/dynamic-testWeightMode-after-aqc.json | 1524 +++++++-------------
.../webapp/dynamic-testWeightMode-before-aqc.json | 546 +++----
.../webapp/dynamic-testWeightMode-legacy-0.json | 556 +++----
.../webapp/dynamic-testWeightMode-legacy-16.json | 556 +++----
.../webapp/dynamic-testWeightMode-legacy-32.json | 556 +++----
.../dynamic-testWeightMode-legacy-after-aqc.json | 1508 +++++++------------
.../dynamic-testWeightMode-legacy-before-aqc.json | 538 +++----
...mixed-testSchedulerAbsoluteAndPercentage-0.json | 612 +++-----
...ixed-testSchedulerAbsoluteAndPercentage-16.json | 596 +++-----
...ixed-testSchedulerAbsoluteAndPercentage-32.json | 576 +++-----
...tSchedulerAbsoluteAndPercentageAndWeight-0.json | 608 +++-----
...SchedulerAbsoluteAndPercentageAndWeight-16.json | 592 +++-----
...SchedulerAbsoluteAndPercentageAndWeight-32.json | 572 +++-----
...dulerAbsoluteAndPercentageAndWeightMixed-0.json | 610 +++-----
...ulerAbsoluteAndPercentageAndWeightMixed-16.json | 594 +++-----
...ulerAbsoluteAndPercentageAndWeightMixed-32.json | 574 +++-----
.../mixed-testSchedulerAbsoluteAndWeight-0.json | 612 +++-----
.../mixed-testSchedulerAbsoluteAndWeight-16.json | 596 +++-----
.../mixed-testSchedulerAbsoluteAndWeight-32.json | 576 +++-----
.../mixed-testSchedulerPercentageAndWeight-0.json | 600 +++-----
.../mixed-testSchedulerPercentageAndWeight-16.json | 564 +++-----
.../mixed-testSchedulerPercentageAndWeight-32.json | 564 +++-----
...er-response-AbsoluteModeLegacyAutoCreation.json | 312 ++--
.../scheduler-response-PerUserResources.json | 404 ++----
...-response-PercentageModeLegacyAutoCreation.json | 226 +--
.../test/resources/webapp/scheduler-response.json | 352 ++---
106 files changed, 8745 insertions(+), 17625 deletions(-)
diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile
index 672061ea09a..8cc03dff69d 100644
--- a/dev-support/Jenkinsfile
+++ b/dev-support/Jenkinsfile
@@ -55,7 +55,7 @@ pipeline {
environment {
YETUS='yetus'
// Branch or tag name. Yetus release tags are 'rel/X.Y.Z'
- YETUS_VERSION='rel/0.14.0'
+ YETUS_VERSION='a7d29a6a72750a0c5c39512f33945e773e69303e'
}
parameters {
@@ -71,7 +71,7 @@ pipeline {
checkout([
$class: 'GitSCM',
branches: [[name: "${env.YETUS_VERSION}"]],
- userRemoteConfigs: [[ url: 'https://github.com/apache/yetus.git']]]
+ userRemoteConfigs: [[ url: 'https://github.com/ayushtkn/yetus.git']]]
)
}
}
diff --git a/hadoop-client-modules/hadoop-client-minicluster/pom.xml b/hadoop-client-modules/hadoop-client-minicluster/pom.xml
index 8edef50fe50..f123d1fe66b 100644
--- a/hadoop-client-modules/hadoop-client-minicluster/pom.xml
+++ b/hadoop-client-modules/hadoop-client-minicluster/pom.xml
@@ -720,6 +720,13 @@
<exclude>**/*.java</exclude>
</excludes>
</filter>
+ <!-- Some of our dependencies include html, so remove it. -->
+ <filter>
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>**/*.html</exclude>
+ </excludes>
+ </filter>
<!-- We pull in several test jars; keep out the actual test classes -->
<filter>
<artifact>*:*</artifact>
diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml
index 727c2cbbc8c..e84951afe92 100644
--- a/hadoop-project/pom.xml
+++ b/hadoop-project/pom.xml
@@ -67,6 +67,11 @@
<!-- jersey version -->
<jersey2.version>2.46</jersey2.version>
+ <!-- moxy version -->
+ <eclipse-persistence.version>2.7.14</eclipse-persistence.version>
+ <jsonapi.version>1.1.6</jsonapi.version>
+ <json.version>1.1.4</json.version>
+
<!-- jaxb version -->
<jaxb.version>2.3.9</jaxb.version>
@@ -2187,6 +2192,21 @@
<artifactId>jersey-media-json-jettison</artifactId>
<version>${jersey2.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.persistence</groupId>
+ <artifactId>org.eclipse.persistence.moxy</artifactId>
+ <version>${eclipse-persistence.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.json</groupId>
+ <artifactId>jakarta.json-api</artifactId>
+ <version>${jsonapi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish</groupId>
+ <artifactId>javax.json</artifactId>
+ <version>${json.version}</version>
+ </dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
index b02097814aa..98f33dd0501 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/pom.xml
@@ -262,8 +262,16 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.glassfish.jersey.media</groupId>
- <artifactId>jersey-media-json-jettison</artifactId>
+ <groupId>org.eclipse.persistence</groupId>
+ <artifactId>org.eclipse.persistence.moxy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.json</groupId>
+ <artifactId>jakarta.json-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish</groupId>
+ <artifactId>javax.json</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreHeartbeat.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreHeartbeat.java
index d43b2091c70..ffd3889d315 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreHeartbeat.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreHeartbeat.java
@@ -20,19 +20,23 @@
import java.io.StringWriter;
+import javax.ws.rs.core.MediaType;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+
import org.apache.hadoop.yarn.server.federation.store.FederationStateStore;
import org.apache.hadoop.yarn.server.federation.store.records.SubClusterHeartbeatRequest;
import org.apache.hadoop.yarn.server.federation.store.records.SubClusterId;
import org.apache.hadoop.yarn.server.federation.store.records.SubClusterState;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.JAXBContextResolver;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterMetricsInfo;
+
+import org.eclipse.persistence.jaxb.MarshallerProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonMarshaller;
-
/**
* Periodic heart beat from a <code>ResourceManager</code> participating in
* federation to indicate liveliness. The heart beat publishes the current
@@ -48,12 +52,18 @@ public class FederationStateStoreHeartbeat implements Runnable {
private final FederationStateStore stateStoreService;
private final ResourceScheduler rs;
private String capability;
+ private JAXBContextResolver resolver;
- public FederationStateStoreHeartbeat(SubClusterId subClusterId,
- FederationStateStore stateStoreClient, ResourceScheduler scheduler) {
+ public FederationStateStoreHeartbeat(
+ SubClusterId subClusterId,
+ FederationStateStore stateStoreClient,
+ ResourceScheduler scheduler,
+ JAXBContextResolver resolver
+ ) {
this.stateStoreService = stateStoreClient;
this.subClusterId = subClusterId;
this.rs = scheduler;
+ this.resolver = resolver;
LOG.info("Initialized Federation membership for cluster with timestamp: {}. ",
ResourceManager.getClusterTimeStamp());
}
@@ -66,12 +76,11 @@ private void updateClusterState() {
try {
// get the current state
ClusterMetricsInfo clusterMetricsInfo = new ClusterMetricsInfo(rs);
-
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(ClusterMetricsInfo.class);
- JettisonMarshaller jsonMarshaller = jettisonJaxbContext.createJsonMarshaller();
+ JAXBContext context = resolver.getContext(ClusterMetricsInfo.class);
+ Marshaller marshaller = context.createMarshaller();
+ marshaller.setProperty(MarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_JSON);
StringWriter stringWriter = new StringWriter();
- jsonMarshaller.marshallToJSON(clusterMetricsInfo, stringWriter);
-
+ marshaller.marshal(clusterMetricsInfo, stringWriter);
capability = stringWriter.toString();
} catch (Exception e) {
LOG.warn("Exception while trying to generate cluster state,"
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java
index e19d5a24048..25829ad1f74 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/federation/FederationStateStoreService.java
@@ -90,6 +90,7 @@
import org.apache.hadoop.yarn.server.records.Version;
import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.JAXBContextResolver;
import org.apache.hadoop.yarn.util.Clock;
import org.apache.hadoop.yarn.util.MonotonicClock;
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
@@ -122,6 +123,7 @@ public class FederationStateStoreService extends AbstractService
private String cleanUpThreadNamePrefix = "FederationStateStoreService-Clean-Thread";
private int cleanUpRetryCountNum;
private long cleanUpRetrySleepTime;
+ private JAXBContextResolver resolver;
public FederationStateStoreService(RMContext rmContext) {
super(FederationStateStoreService.class.getName());
@@ -183,6 +185,8 @@ protected void serviceInit(Configuration conf) throws Exception {
this.metrics = FederationStateStoreServiceMetrics.getMetrics();
LOG.info("Initialized federation statestore service metrics.");
+ this.resolver = new JAXBContextResolver(conf);
+
super.serviceInit(conf);
}
@@ -253,7 +257,7 @@ private void registerAndInitializeHeartbeat() {
"Failed to register Federation membership with the StateStore", e);
}
stateStoreHeartbeat = new FederationStateStoreHeartbeat(subClusterId,
- stateStoreClient, rmContext.getScheduler());
+ stateStoreClient, rmContext.getScheduler(), resolver);
scheduledExecutorService =
HadoopExecutors.newSingleThreadScheduledExecutor();
scheduledExecutorService.scheduleWithFixedDelay(stateStoreHeartbeat,
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/JAXBContextResolver.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/JAXBContextResolver.java
index 37ea2ee04e3..ecc658b86a3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/JAXBContextResolver.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/JAXBContextResolver.java
@@ -18,15 +18,15 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
+import org.eclipse.persistence.jaxb.JAXBContextFactory;
+import org.eclipse.persistence.jaxb.MarshallerProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.util.HashMap;
+import java.util.Set;
import javax.inject.Inject;
import javax.inject.Singleton;
@@ -35,54 +35,13 @@
import javax.xml.bind.JAXBContext;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.yarn.conf.YarnConfiguration;
-import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.UserInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerQueueInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.FifoSchedulerInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.SchedulerTypeInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.UserMetricsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterMetricsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.SchedulerInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodesInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerQueueInfoList;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.UsersInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ApplicationStatisticsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.StatisticsItemInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerHealthInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.FairSchedulerQueueInfoList;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppTimeoutsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppTimeoutInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInformationsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ActivitiesInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppActivitiesInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.QueueAclsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.QueueAclInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.BulkActivitiesInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NewApplication;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ApplicationSubmissionContextInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ContainerLaunchContextInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LocalResourceInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.DelegationToken;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppQueue;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppPriority;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceOptionInfo;
-import org.apache.hadoop.yarn.webapp.RemoteExceptionData;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.ClassSerialisationConfig;
@Singleton
@Provider
public class JAXBContextResolver implements ContextResolver<JAXBContext> {
-
private static final Logger LOG = LoggerFactory.getLogger(JAXBContextResolver.class.getName());
-
- private final Map<Class, JAXBContext> typesContextMap;
+ private final Map<Class, JAXBContext> typesContextMap = new HashMap<>();
public JAXBContextResolver() throws Exception {
this(new Configuration());
@@ -90,83 +49,29 @@ public JAXBContextResolver() throws Exception {
@Inject
public JAXBContextResolver(@javax.inject.Named("conf") Configuration conf) throws Exception {
-
- JAXBContext context;
- JAXBContext unWrappedRootContext;
-
- // you have to specify all the dao classes here
- final Class[] cTypes =
- { AppInfo.class, AppAttemptInfo.class, AppAttemptsInfo.class,
- ClusterInfo.class, CapacitySchedulerQueueInfo.class,
- FifoSchedulerInfo.class, SchedulerTypeInfo.class, NodeInfo.class,
- UserMetricsInfo.class, CapacitySchedulerInfo.class,
- ClusterMetricsInfo.class, SchedulerInfo.class, AppsInfo.class,
- NodesInfo.class, RemoteExceptionData.class,
- CapacitySchedulerQueueInfoList.class, ResourceInfo.class,
- UsersInfo.class, UserInfo.class, ApplicationStatisticsInfo.class,
- StatisticsItemInfo.class, CapacitySchedulerHealthInfo.class,
- FairSchedulerQueueInfoList.class, AppTimeoutsInfo.class,
- AppTimeoutInfo.class, ResourceInformationsInfo.class,
- ActivitiesInfo.class, AppActivitiesInfo.class,
- QueueAclsInfo.class, QueueAclInfo.class,
- BulkActivitiesInfo.class};
-
- // these dao classes need root unwrapping
- final Class[] rootUnwrappedTypes =
- { NewApplication.class, ApplicationSubmissionContextInfo.class,
- ContainerLaunchContextInfo.class, LocalResourceInfo.class,
- DelegationToken.class, AppQueue.class, AppPriority.class,
- ResourceOptionInfo.class };
-
- ArrayList<Class> finalcTypesList = new ArrayList<>();
- ArrayList<Class> finalRootUnwrappedTypesList = new ArrayList<>();
-
- Collections.addAll(finalcTypesList, cTypes);
- Collections.addAll(finalRootUnwrappedTypesList, rootUnwrappedTypes);
-
- // Add Custom DAO Classes
- Class[] daoClasses = null;
- Class[] unwrappedDaoClasses = null;
- boolean loadCustom = true;
- try {
- daoClasses = conf
- .getClasses(YarnConfiguration.YARN_HTTP_WEBAPP_CUSTOM_DAO_CLASSES);
- unwrappedDaoClasses = conf.getClasses(
- YarnConfiguration.YARN_HTTP_WEBAPP_CUSTOM_UNWRAPPED_DAO_CLASSES);
- } catch (Exception e) {
- LOG.warn("Failed to load custom dao class: ", e);
- loadCustom = false;
- }
-
- if (loadCustom) {
- if (daoClasses != null) {
- Collections.addAll(finalcTypesList, daoClasses);
- LOG.debug("Added custom dao classes: {}.", Arrays.toString(daoClasses));
- }
- if (unwrappedDaoClasses != null) {
- Collections.addAll(finalRootUnwrappedTypesList, unwrappedDaoClasses);
- LOG.debug("Added custom Unwrapped dao classes: {}", Arrays.toString(unwrappedDaoClasses));
- }
- }
-
- final Class[] finalcTypes = finalcTypesList
- .toArray(new Class[finalcTypesList.size()]);
- final Class[] finalRootUnwrappedTypes = finalRootUnwrappedTypesList
- .toArray(new Class[finalRootUnwrappedTypesList.size()]);
-
- this.typesContextMap = new HashMap<>();
- context = new JettisonJaxbContext(finalcTypes);
- unWrappedRootContext = new JettisonJaxbContext(finalRootUnwrappedTypes);
- for (Class type : finalcTypes) {
- typesContextMap.put(type, context);
- }
- for (Class type : finalRootUnwrappedTypes) {
- typesContextMap.put(type, unWrappedRootContext);
- }
+ ClassSerialisationConfig classSerialisationConfig = new ClassSerialisationConfig(conf);
+ Set<Class<?>> wrappedClasses = classSerialisationConfig.getWrappedClasses();
+ Set<Class<?>> unWrappedClasses = classSerialisationConfig.getUnWrappedClasses();
+
+ //WARNING: AFAIK these properties not respected by MOXyJsonProvider
+ //For details check MOXyJsonProvider#readFrom method
+ JAXBContext wrappedContext = JAXBContextFactory.createContext(
+ wrappedClasses.toArray(new Class[0]),
+ Collections.singletonMap(MarshallerProperties.JSON_INCLUDE_ROOT, true)
+ );
+ JAXBContext unWrappedContext = JAXBContextFactory.createContext(
+ unWrappedClasses.toArray(new Class[0]),
+ Collections.singletonMap(MarshallerProperties.JSON_INCLUDE_ROOT, false)
+ );
+
+ wrappedClasses.forEach(type -> typesContextMap.put(type, wrappedContext));
+ unWrappedClasses.forEach(type -> typesContextMap.put(type, unWrappedContext));
}
@Override
public JAXBContext getContext(Class<?> objectType) {
- return typesContextMap.get(objectType);
+ JAXBContext jaxbContext = typesContextMap.get(objectType);
+ LOG.trace("Context for {} is {}", objectType, jaxbContext);
+ return jaxbContext;
}
}
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/RMWebApp.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebApp.java
index b8b24a8c642..4b795bb580b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebApp.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebApp.java
@@ -27,6 +27,7 @@
import org.slf4j.LoggerFactory;
import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.RMHAUtils;
import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
@@ -36,7 +37,6 @@
import javax.servlet.Filter;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
/**
@@ -60,7 +60,8 @@ public ResourceConfig resourceConfig() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
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/dao/NodeLabelsInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/NodeLabelsInfo.java
index c9809b6d2e3..e2e99ee4b15 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/NodeLabelsInfo.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/NodeLabelsInfo.java
@@ -48,7 +48,7 @@ public NodeLabelsInfo(List<NodeLabel> nodeLabels) {
this.nodeLabelsInfo.add(new NodeLabelInfo(label));
}
}
-
+
public NodeLabelsInfo(Set<String> nodeLabelsName) {
this.nodeLabelsInfo = new ArrayList<>();
for (String labelName : nodeLabelsName) {
@@ -75,7 +75,7 @@ public Set<NodeLabel> getNodeLabels() {
}
return nodeLabels;
}
-
+
public List<String> getNodeLabelsName() {
ArrayList<String> nodeLabelsName = new ArrayList<>();
for (NodeLabelInfo label : nodeLabelsInfo) {
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/jsonprovider/ClassSerialisationConfig.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/jsonprovider/ClassSerialisationConfig.java
new file mode 100644
index 00000000000..af2ef6307c7
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/jsonprovider/ClassSerialisationConfig.java
@@ -0,0 +1,241 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import javax.inject.Inject;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.util.Sets;
+import org.apache.hadoop.yarn.conf.YarnConfiguration;
+import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.UserInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ActivitiesInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppActivitiesInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppPriority;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppQueue;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppState;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppTimeoutInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppTimeoutsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ApplicationStatisticsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ApplicationSubmissionContextInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.BulkActivitiesInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerHealthInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerQueueInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CapacitySchedulerQueueInfoList;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterMetricsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterUserInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ConfigVersionInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ContainerLaunchContextInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.DelegationToken;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.FairSchedulerQueueInfoList;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.FifoSchedulerInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LabelsToNodesInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LocalResourceInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NewApplication;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NewReservation;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeLabelsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeToLabelsEntryList;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeToLabelsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodesInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.QueueAclInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.QueueAclsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationDeleteRequestInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationDeleteResponseInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationListInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationSubmissionRequestInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationUpdateRequestInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationUpdateResponseInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInformationsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceOptionInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.SchedulerInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.SchedulerOverviewInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.SchedulerTypeInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.StatisticsItemInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.UserMetricsInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.UsersInfo;
+import org.apache.hadoop.yarn.server.webapp.dao.ContainerInfo;
+import org.apache.hadoop.yarn.server.webapp.dao.ContainersInfo;
+import org.apache.hadoop.yarn.webapp.RemoteExceptionData;
+import org.apache.hadoop.yarn.webapp.dao.ConfInfo;
+import org.apache.hadoop.yarn.webapp.dao.SchedConfUpdateInfo;
+
+/**
+ * Configuration holder for class serialization setup
+ * used by the ResourceManager web services layer.
+ *
+ * <p>This class manages two categories of data transfer objects (DTOs):</p>
+ * <ul>
+ * <li><b>Wrapped classes</b>
+ * – classes whose JSON representation includes a root wrapper element.</li>
+ * <li><b>Unwrapped classes</b>
+ * – classes whose JSON representation omits a root wrapper element.</li>
+ * </ul>
+ *
+ * <p>The configuration is initialized with a default list of constant classes and may optionally
+ * include user-defined classes loaded from configuration properties:</p>
+ * <ul>
+ * <li>{@code yarn.http.webapp.custom.dao.classes}</li>
+ * <li>{@code yarn.http.webapp.custom.unwrapped.dao.classes}</li>
+ * </ul>
+ *
+ * <p>This configuration is primarily used to control JSON serialization behavior in MOXy providers
+ * when serializing REST API objects.</p>
+ *
+ * <p><b>Example:</b></p>
+ * <p>If we have a class like:</p>
+ *
+ * <pre>{@code
+ * @XmlRootElement(name = "foo-class")
+ * class Foo {
+ * String a;
+ * String b;
+ * }
+ * }</pre>
+ *
+ * <p>and the class is present in the wrapped classes list, it will be marshalled as:</p>
+ *
+ * <pre>{@code
+ * {
+ * "foo-class": {
+ * "a": "...",
+ * "b": "..."
+ * }
+ * }
+ * }</pre>
+ *
+ * <p>or if the class is present in the unwrapped classes list, it will be marshalled as:</p>
+ *
+ * <pre>{@code
+ * {
+ * "a": "...",
+ * "b": "..."
+ * }
+ * }</pre>
+ */
+public class ClassSerialisationConfig {
+ private static final Logger LOG = LoggerFactory.getLogger(ClassSerialisationConfig.class);
+
+ private static final Set<Class<?>> CONST_WRAPPED_CLASSES =
+ Sets.newHashSet(ActivitiesInfo.class, AppActivitiesInfo.class, AppAttemptInfo.class,
+ AppAttemptsInfo.class, AppInfo.class, ApplicationStatisticsInfo.class, AppsInfo.class,
+ AppTimeoutInfo.class, AppTimeoutsInfo.class, BulkActivitiesInfo.class,
+ CapacitySchedulerHealthInfo.class, CapacitySchedulerInfo.class,
+ CapacitySchedulerQueueInfo.class, CapacitySchedulerQueueInfoList.class, ClusterInfo.class,
+ ClusterMetricsInfo.class, ConfigVersionInfo.class, ContainerInfo.class,
+ FairSchedulerQueueInfoList.class, FifoSchedulerInfo.class, NewReservation.class,
+ NodeInfo.class, NodesInfo.class, QueueAclInfo.class, QueueAclsInfo.class,
+ RemoteExceptionData.class, ReservationDeleteRequestInfo.class,
+ ReservationDeleteResponseInfo.class, ReservationSubmissionRequestInfo.class,
+ ReservationUpdateRequestInfo.class, ReservationUpdateResponseInfo.class,
+ ResourceInfo.class, ResourceInformationsInfo.class, SchedulerInfo.class,
+ SchedulerOverviewInfo.class, SchedulerTypeInfo.class, StatisticsItemInfo.class,
+ UserInfo.class, UserMetricsInfo.class, UsersInfo.class);
+
+ private static final Set<Class<?>> CONST_UNWRAPPED_CLASSES =
+ Sets.newHashSet(ApplicationSubmissionContextInfo.class, AppPriority.class, AppQueue.class,
+ AppState.class, ClusterUserInfo.class, ConfInfo.class, ContainersInfo.class ,
+ ContainerLaunchContextInfo.class, DelegationToken.class, LabelsToNodesInfo.class,
+ LocalResourceInfo.class, NewApplication.class, NodeLabelsInfo.class,
+ NodeToLabelsEntryList.class, NodeToLabelsInfo.class, ReservationListInfo.class,
+ ResourceOptionInfo.class, SchedConfUpdateInfo.class);
+
+ private final Set<Class<?>> wrappedClasses;
+ private final Set<Class<?>> unWrappedClasses;
+
+ /**
+ * Default constructor.
+ */
+ public ClassSerialisationConfig() {
+ this(new Configuration());
+ }
+
+ /**
+ * Constructs a new {@code ClassSerialisationConfig} instance and initializes
+ * the sets of wrapped and unwrapped classes used for JSON serialization.
+ *
+ * @param conf the Hadoop {@link Configuration} instance (typically injected via
+ * dependency injection) used to load optional custom class definitions
+ */
+ @Inject
+ public ClassSerialisationConfig(@javax.inject.Named("conf") Configuration conf) {
+ wrappedClasses = new HashSet<>(CONST_WRAPPED_CLASSES);
+ try {
+ wrappedClasses.addAll(
+ Arrays.asList(conf.getClasses(YarnConfiguration.YARN_HTTP_WEBAPP_CUSTOM_DAO_CLASSES)));
+ } catch (RuntimeException e) {
+ LOG.warn("Failed to load YARN_HTTP_WEBAPP_CUSTOM_DAO_CLASSES", e);
+ }
+
+ unWrappedClasses = new HashSet<>(CONST_UNWRAPPED_CLASSES);
+ try {
+ unWrappedClasses.addAll(Arrays.asList(
+ conf.getClasses(YarnConfiguration.YARN_HTTP_WEBAPP_CUSTOM_UNWRAPPED_DAO_CLASSES)));
+ } catch (RuntimeException e) {
+ LOG.warn("Failed to load YARN_HTTP_WEBAPP_CUSTOM_DAO_CLASSES", e);
+ }
+
+ LOG.trace("ClassSerialisationConfig was created, wrappedClasses: {} unWrappedClasses: {}",
+ wrappedClasses, unWrappedClasses);
+
+ Set<Class<?>> duplicates = new HashSet<>(wrappedClasses);
+ duplicates.retainAll(unWrappedClasses);
+ if (!duplicates.isEmpty()) {
+ throw new Error(String.format("Duplicate classes found: %s", duplicates));
+ }
+ }
+
+ /**
+ * Returns the set of classes whose JSON representation should include a root element.
+ * <p>
+ * These classes are used by MOXy JSON providers to determine which data transfer
+ * objects (DTOs) should be wrapped with a root element when serialized.
+ * </p>
+ *
+ * @return an unmodifiable {@link Set} of wrapped classes
+ */
+ public Set<Class<?>> getWrappedClasses() {
+ return wrappedClasses;
+ }
+
+ /**
+ * Returns the set of classes whose JSON representation should omit the root element.
+ * <p>
+ * These classes are used by MOXy JSON providers to determine which data transfer
+ * objects (DTOs) should be serialized without a root element in the JSON output.
+ * </p>
+ *
+ * @return an unmodifiable {@link Set} of unwrapped classes
+ */
+ public Set<Class<?>> getUnWrappedClasses() {
+ return unWrappedClasses;
+ }
+}
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/jsonprovider/ExcludeRootJSONProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/jsonprovider/ExcludeRootJSONProvider.java
new file mode 100644
index 00000000000..01fb49714ca
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/jsonprovider/ExcludeRootJSONProvider.java
@@ -0,0 +1,146 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.Provider;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.eclipse.persistence.jaxb.MarshallerProperties;
+import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hadoop.conf.Configuration;
+
+/**
+ * A custom JSON provider that extends {@link org.eclipse.persistence.jaxb.rs.MOXyJsonProvider}
+ * to handle JSON marshalling and unmarshalling without including the root element
+ * for configured classes.
+ * <p>
+ * This provider integrates with EclipseLink MOXy and the JAX-RS runtime (annotated with
+ * {@link javax.ws.rs.ext.Provider}), and it is configured to both produce and consume
+ * {@code application/json} content types. It uses a {@link ClassSerialisationConfig}
+ * to determine which classes should be serialized
+ * and deserialized without a root element in the resulting JSON.
+ * </p>
+ *
+ * During marshalling and unmarshalling, this provider sets the MOXy-specific properties:
+ * <ul>
+ * <li>{@code MarshallerProperties.JSON_INCLUDE_ROOT = false}</li>
+ * <li>{@code MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS = false}</li>
+ * </ul>
+ * ensuring that the JSON representation excludes the root element and does not include
+ * empty collections. This is useful when interoperating with APIs that expect flat
+ * JSON structures or when simplifying payloads for lightweight clients.
+ *
+ * <p>
+ * This class also provides detailed trace-level logging to help developers verify
+ * which entity types are being handled by this provider and how JSON binding is applied.
+ * </p>
+ *
+ * @see org.eclipse.persistence.jaxb.rs.MOXyJsonProvider
+ * @see org.eclipse.persistence.jaxb.MarshallerProperties
+ * @see ClassSerialisationConfig
+ * @see Configuration
+ */
+@Provider
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public class ExcludeRootJSONProvider extends MOXyJsonProvider {
+
+ private final static Logger LOG = LoggerFactory.getLogger(ExcludeRootJSONProvider.class);
+ private final ClassSerialisationConfig classSerialisationConfig;
+
+ /**
+ * Default constructor.
+ */
+ public ExcludeRootJSONProvider() {
+ this(new Configuration());
+ }
+
+ /**
+ * Constructs a new {@code ExcludeRootJSONProvider} instance and initializes
+ * its {@link ClassSerialisationConfig} based on the provided application configuration.
+ * <p>
+ * This constructor is designed for dependency injection. The {@code Configuration}
+ * object is injected (qualified with {@code @Named("conf")}) and used to
+ * create a {@link ClassSerialisationConfig} instance, which controls how
+ * classes are serialized to JSON (e.g., whether to include root elements).
+ * </p>
+ *
+ * @param conf the application {@link Configuration} instance injected by the framework;
+ * used to initialize serialization settings
+ */
+ @Inject
+ public ExcludeRootJSONProvider(@javax.inject.Named("conf") Configuration conf) {
+ classSerialisationConfig = new ClassSerialisationConfig(conf);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ boolean match = classSerialisationConfig.getUnWrappedClasses().contains(type);
+ LOG.trace("ExcludeRootJSONProvider compatibility with {} is {}", type, match);
+ return match;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ return isReadable(type, genericType, annotations, mediaType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void preReadFrom(Class<Object> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType, MultivaluedMap<String, String> httpHeaders, Unmarshaller unmarshaller)
+ throws JAXBException {
+ LOG.trace("ExcludeRootJSONProvider preReadFrom with {}", type);
+ unmarshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, false);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void preWriteTo(Object object, Class<?> type, Type genericType,
+ Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
+ Marshaller marshaller) throws JAXBException {
+ LOG.trace("ExcludeRootJSONProvider preWriteTo with {}", type);
+ marshaller.setProperty(MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS, false);
+ marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, false);
+ }
+}
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/jsonprovider/IncludeRootJSONProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/jsonprovider/IncludeRootJSONProvider.java
new file mode 100644
index 00000000000..ce711a1e4c4
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/jsonprovider/IncludeRootJSONProvider.java
@@ -0,0 +1,144 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.Provider;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.eclipse.persistence.jaxb.MarshallerProperties;
+import org.eclipse.persistence.jaxb.rs.MOXyJsonProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hadoop.conf.Configuration;
+
+/**
+ * A custom JSON provider that extends {@link org.eclipse.persistence.jaxb.rs.MOXyJsonProvider}
+ * to ensure that JSON marshalling and unmarshalling
+ * include the root element for configured classes.
+ * <p>
+ * This provider integrates with EclipseLink MOXy and the JAX-RS runtime (annotated with
+ * {@link javax.ws.rs.ext.Provider}), and it is configured to both produce and consume
+ * {@code application/json} content types. It uses a {@link ClassSerialisationConfig}
+ * to determine which classes should include
+ * their root elements when serialized or deserialized.
+ * </p>
+ *
+ * During marshalling and unmarshalling, this provider sets the MOXy-specific properties:
+ * <ul>
+ * <li>{@code MarshallerProperties.JSON_INCLUDE_ROOT = true}</li>
+ * <li>{@code MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS = false}</li>
+ * </ul>
+ * ensuring consistent JSON structure that includes the root element and omits empty collections.
+ *
+ * <p>
+ * This class also provides detailed trace logging to help debug compatibility and data binding
+ * behavior for registered entity types.
+ * </p>
+ *
+ * @see org.eclipse.persistence.jaxb.rs.MOXyJsonProvider
+ * @see org.eclipse.persistence.jaxb.MarshallerProperties
+ * @see ClassSerialisationConfig
+ * @see Configuration
+ */
+@Provider
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public class IncludeRootJSONProvider extends MOXyJsonProvider {
+
+ private final static Logger LOG = LoggerFactory.getLogger(IncludeRootJSONProvider.class);
+ private final ClassSerialisationConfig classSerialisationConfig;
+
+ /**
+ * Default constructor.
+ */
+ public IncludeRootJSONProvider() {
+ this(new Configuration());
+ }
+
+ /**
+ * Constructs a new {@code IncludeRootJSONProvider} instance and initializes
+ * its {@link ClassSerialisationConfig} based on the provided application configuration.
+ * <p>
+ * This constructor is designed for dependency injection. The {@code Configuration}
+ * object is injected (qualified with {@code @Named("conf")}) and used to
+ * create a {@link ClassSerialisationConfig} instance, which controls how
+ * classes are serialized to JSON (e.g., whether to include root elements).
+ * </p>
+ *
+ * @param conf the application {@link Configuration} instance injected by the framework;
+ * used to initialize serialization settings
+ */
+ @Inject
+ public IncludeRootJSONProvider(@javax.inject.Named("conf") Configuration conf) {
+ classSerialisationConfig = new ClassSerialisationConfig(conf);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ boolean match = classSerialisationConfig.getWrappedClasses().contains(type);
+ LOG.trace("IncludeRootJSONProvider compatibility with {} is {}", type, match);
+ return match;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ return isReadable(type, genericType, annotations, mediaType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void preReadFrom(Class<Object> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType, MultivaluedMap<String, String> httpHeaders, Unmarshaller unmarshaller)
+ throws JAXBException {
+ LOG.trace("IncludeRootJSONProvider preReadFrom with {}", type);
+ unmarshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void preWriteTo(Object object, Class<?> type, Type genericType,
+ Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
+ Marshaller marshaller) throws JAXBException {
+ LOG.trace("IncludeRootJSONProvider preWriteTo with {}", type);
+ marshaller.setProperty(MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS, false);
+ marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, true);
+ }
+}
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/jsonprovider/JsonProviderFeature.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/jsonprovider/JsonProviderFeature.java
new file mode 100644
index 00000000000..db71574f9cb
--- /dev/null
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/jsonprovider/JsonProviderFeature.java
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider;
+
+import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
+
+/**
+ * A JAX-RS {@link Feature} that registers custom MOXy JSON providers
+ * for handling serialization and deserialization of JSON with or without
+ * root elements.
+ *
+ * <p>
+ * This feature disables MOXy's automatic provider discovery to ensure
+ * that the custom providers {@link IncludeRootJSONProvider} and
+ * {@link ExcludeRootJSONProvider} are used explicitly with defined priorities.
+ * </p>
+ *
+ * <p>Configuration details:</p>
+ * <ul>
+ * <li>Registers {@link IncludeRootJSONProvider} with priority {@code 2001}.</li>
+ * <li>Registers {@link ExcludeRootJSONProvider} with priority {@code 2002}.</li>
+ * </ul>
+ *
+ * @see IncludeRootJSONProvider
+ * @see ExcludeRootJSONProvider
+ * @see org.glassfish.jersey.CommonProperties#MOXY_JSON_FEATURE_DISABLE
+ */
+public class JsonProviderFeature implements Feature {
+
+ /**
+ * Do not use default constructor.
+ */
+ public JsonProviderFeature() {
+ }
+
+ /**
+ * Configures the feature by registering the custom JSON providers.
+ *
+ * @param context the {@link FeatureContext} provided by the JAX-RS runtime
+ * @return {@code true} to indicate that the feature was successfully configured
+ */
+ @Override
+ public boolean configure(FeatureContext context) {
+ // Priorities are used to maintain order between the JSONProviders.
+ // This way, we can improve the determinism of the app.
+ context.register(IncludeRootJSONProvider.class, 2001);
+ context.register(ExcludeRootJSONProvider.class, 2002);
+ return true;
+ }
+}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java
index 884da531b4b..9503a435a4b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMHA.java
@@ -46,6 +46,7 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.glassfish.jersey.jettison.internal.entity.JettisonObjectProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
@@ -80,7 +81,6 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
-import org.glassfish.jersey.jettison.internal.entity.JettisonObjectProvider;
public class TestRMHA extends AbstractHadoopTestBase {
private static final Logger LOG = LoggerFactory.getLogger(TestRMHA.class);
@@ -166,9 +166,9 @@ private void checkActiveRMFunctionality() throws Exception {
private void checkActiveRMWebServices() throws JSONException {
// Validate web-service
- Client webServiceClient = ClientBuilder.
- newClient().
- register(new JettisonObjectProvider.App());
+ Client webServiceClient = ClientBuilder
+ .newClient()
+ .register(new JettisonObjectProvider.App());
InetSocketAddress rmWebappAddr =
NetUtils.getConnectAddress(rm.getWebapp().getListenerAddress());
String webappURL =
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java
index 92c337b0773..c5633c62016 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/federation/TestFederationRMStateStoreService.java
@@ -17,13 +17,13 @@
package org.apache.hadoop.yarn.server.resourcemanager.federation;
+import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.fromJson;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
-import java.io.StringReader;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
@@ -83,9 +83,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonUnmarshaller;
-
import static org.mockito.Mockito.mock;
/**
@@ -103,15 +100,11 @@ public class TestFederationRMStateStoreService {
private Configuration conf;
private FederationStateStore stateStore;
private long lastHearbeatTS = 0;
- private JettisonJaxbContext jettisonJaxbContext;
- private JettisonUnmarshaller jsonUnmarshaller;
private MockRM mockRM;
@BeforeEach
public void setUp() throws IOException, YarnException, JAXBException {
conf = new YarnConfiguration();
- this.jettisonJaxbContext = new JettisonJaxbContext(ClusterMetricsInfo.class);
- this.jsonUnmarshaller = jettisonJaxbContext.createJsonUnmarshaller();
conf.setBoolean(YarnConfiguration.FEDERATION_ENABLED, true);
conf.setInt(YarnConfiguration.FEDERATION_STATESTORE_HEARTBEAT_INITIAL_DELAY, 10);
conf.set(YarnConfiguration.RM_CLUSTER_ID, subClusterId.getId());
@@ -124,8 +117,6 @@ public void setUp() throws IOException, YarnException, JAXBException {
@AfterEach
public void tearDown() throws Exception {
- jettisonJaxbContext = null;
- jsonUnmarshaller = null;
mockRM.stop();
mockRM = null;
}
@@ -199,10 +190,8 @@ private void explicitFailover(MockRM rm) throws IOException {
stateStore = rm.getFederationStateStoreService().getStateStoreClient();
}
- private void checkClusterMetricsInfo(String capability, int numNodes)
- throws JAXBException {
- ClusterMetricsInfo clusterMetricsInfo = jsonUnmarshaller.unmarshalFromJSON(
- new StringReader(capability), ClusterMetricsInfo.class);
+ private void checkClusterMetricsInfo(String capability, int numNodes) {
+ ClusterMetricsInfo clusterMetricsInfo = fromJson(capability, ClusterMetricsInfo.class);
assertEquals(numNodes, clusterMetricsInfo.getTotalNodes());
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java
index b5e41cb4635..1e84f085792 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServiceAppsNodelabel.java
@@ -51,6 +51,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.codehaus.jettison.json.JSONArray;
@@ -60,7 +61,6 @@
import org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableMap;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
@@ -84,7 +84,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -198,7 +199,10 @@ public void testAppsRunning() throws JSONException, Exception {
// Verify apps resource
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject jsonObject = apps.getJSONObject("app").getJSONObject("resourceInfo");
+ JSONObject jsonObject = apps
+ .getJSONArray("app")
+ .getJSONObject(0)
+ .getJSONObject("resourceInfo");
JSONArray jsonArray = jsonObject.getJSONArray("resourceUsagesByPartition");
assertEquals(2, jsonArray.length(), "Partition expected is 2");
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java
index 3ea45d1d3cd..ebfc4e341c9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java
@@ -97,6 +97,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ApplicationSubmissionContextInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppsInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ClusterUserInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.server.security.ApplicationACLsManager;
import org.apache.hadoop.yarn.util.AdHocLogDumper;
import org.apache.hadoop.yarn.util.AppsCacheKey;
@@ -121,7 +122,6 @@
import org.xml.sax.InputSource;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
@@ -137,7 +137,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -420,7 +421,7 @@ public void testClusterMetricsDefault() throws JSONException, Exception {
assertEquals(MediaType.APPLICATION_JSON + ";" + JettyUtils.UTF_8,
response.getMediaType().toString());
- JSONObject json =response.readEntity(JSONObject.class);
+ JSONObject json = response.readEntity(JSONObject.class);
verifyClusterMetricsJSON(json);
}
@@ -634,7 +635,7 @@ public void verifyClusterSchedulerFifo(JSONObject json) throws JSONException,
LOG.debug("schedulerInfo: {}", info);
assertEquals(11, info.length(), "incorrect number of elements in: " + info);
- verifyClusterSchedulerFifoGeneric(info.getString("@xsi.type"),
+ verifyClusterSchedulerFifoGeneric(info.getString("type"),
info.getString("qstate"), (float) info.getDouble("capacity"),
(float) info.getDouble("usedCapacity"),
info.getInt("minQueueMemoryCapacity"),
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppAttempts.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppAttempts.java
index 4592d9a7585..47a6a66b3d0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppAttempts.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppAttempts.java
@@ -17,7 +17,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.apache.hadoop.conf.Configuration;
@@ -37,6 +36,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.apache.hadoop.yarn.webapp.WebServicesTestUtils;
@@ -83,7 +83,7 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -156,9 +156,7 @@ public void testCompletedAppAttempt() throws Exception {
.get(Response.class);
JSONObject json = response.readEntity(JSONObject.class);
JSONObject jsonAppAttempts = json.getJSONObject("appAttempts");
- JSONObject jsonAppAttempt = jsonAppAttempts.getJSONObject("appAttempt");
- JSONArray jsonArray = new JSONArray();
- jsonArray.put(jsonAppAttempt);
+ JSONArray jsonArray = jsonAppAttempts.getJSONArray("appAttempt");
JSONObject info = jsonArray.getJSONObject(0);
String logsLink = info.getString("logsLink");
String containerId = app1.getCurrentAppAttempt().getMasterContainer()
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppCustomResourceTypes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppCustomResourceTypes.java
index 947fe7a231e..70566a5ee78 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppCustomResourceTypes.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppCustomResourceTypes.java
@@ -17,7 +17,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.apache.hadoop.conf.Configuration;
@@ -31,6 +30,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.resource.CustomResourceTypesConfigurationProvider;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.helper.BufferedClientResponse;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.helper.JsonCustomResourceTypeTestcase;
@@ -72,7 +72,7 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
index 8885540de15..819d20fef3a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java
@@ -19,7 +19,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.apache.hadoop.conf.Configuration;
@@ -44,6 +43,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.apache.hadoop.yarn.webapp.WebServicesTestUtils;
@@ -89,7 +89,7 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -280,9 +280,7 @@ public void testAppsHelper(String path, RMApp app, String media,
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject jSONObjectApp = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(jSONObjectApp);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
verifyAppInfo(array.getJSONObject(0), app, hasResourceReq);
@@ -306,9 +304,7 @@ public void testAppsQueryState() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject app = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(app);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
verifyAppInfo(array.getJSONObject(0), app1, false);
rm.stop();
@@ -334,9 +330,7 @@ public void testAppsQueryStates() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject app = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(app);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
assertEquals("ACCEPTED", array.getJSONObject(0).getString("state"),
"state not equal to ACCEPTED");
@@ -384,9 +378,7 @@ public void testAppsQueryStatesComma() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject app = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(app);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
assertEquals("ACCEPTED", array.getJSONObject(0).getString("state"),
"state not equal to ACCEPTED");
@@ -430,7 +422,7 @@ public void testAppsQueryStatesNone() throws JSONException, Exception {
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- assertEquals("", json.get("apps").toString(), "apps is not empty");
+ assertEquals("{}", json.get("apps").toString(), "apps is not empty");
rm.stop();
}
@@ -450,7 +442,7 @@ public void testAppsQueryStateNone() throws JSONException, Exception {
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- assertEquals("", json.get("apps").toString(), "apps is not empty");
+ assertEquals("{}", json.get("apps").toString(), "apps is not empty");
rm.stop();
}
@@ -543,9 +535,7 @@ public void testAppsQueryFinalStatus() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject app = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(app);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
verifyAppInfo(array.getJSONObject(0), app1, false);
rm.stop();
@@ -566,7 +556,7 @@ public void testAppsQueryFinalStatusNone() throws JSONException, Exception {
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- assertEquals("", json.get("apps").toString(), "apps is not null");
+ assertEquals("{}", json.get("apps").toString(), "apps is not null");
rm.stop();
}
@@ -719,9 +709,7 @@ public void testAppsQueryQueueAndStateOneFinishedApp() throws Exception {
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject app = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(app);
+ JSONArray array = apps.getJSONArray("app");
Set<String> appIds = getApplicationIds(array);
assertFalse(appIds.contains(runningApp.getApplicationId().toString()),
@@ -833,9 +821,7 @@ public void testAppsQueryStartBeginSome() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject app = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(app);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
rm.stop();
}
@@ -857,7 +843,7 @@ public void testAppsQueryStartEnd() throws JSONException, Exception {
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- assertEquals("", json.get("apps").toString(), "apps is not empty");
+ assertEquals("{}", json.get("apps").toString(), "apps is not empty");
rm.stop();
}
@@ -910,9 +896,7 @@ public void testAppsQueryFinishBegin() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject appsJSONObject = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(appsJSONObject);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
rm.stop();
}
@@ -981,9 +965,7 @@ public void testAppsQueryFinishBeginEnd() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject appsJSONObject = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(appsJSONObject);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
rm.stop();
}
@@ -1033,9 +1015,7 @@ public void testAppsQueryAppTypes() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject appsJSONObject = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(appsJSONObject);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
assertEquals("MAPREDUCE",
array.getJSONObject(0).getString("applicationType"));
@@ -1120,9 +1100,7 @@ public void testAppsQueryAppTypes() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- appsJSONObject = apps.getJSONObject("app");
- array = new JSONArray();
- array.put(appsJSONObject);
+ array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
assertEquals("YARN",
array.getJSONObject(0).getString("applicationType"));
@@ -1138,9 +1116,7 @@ public void testAppsQueryAppTypes() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- appsJSONObject = apps.getJSONObject("app");
- array = new JSONArray();
- array.put(appsJSONObject);
+ array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
assertEquals("YARN",
array.getJSONObject(0).getString("applicationType"));
@@ -1255,9 +1231,7 @@ public void testAppsQueryWithDeselects()
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- JSONObject appsJSONObject = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(appsJSONObject);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
JSONObject app = array.getJSONObject(0);
assertTrue(!app.has("resourceRequests"), "resource requests shouldn't exist");
@@ -1272,9 +1246,7 @@ public void testAppsQueryWithDeselects()
assertEquals(1, json.length(), "incorrect number of elements");
apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- appsJSONObject = apps.getJSONObject("app");
- array = new JSONArray();
- array.put(appsJSONObject);
+ array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
app = array.getJSONObject(0);
assertTrue(!app.has("amNodeLabelExpression"),
@@ -1290,9 +1262,7 @@ public void testAppsQueryWithDeselects()
assertEquals(1, json.length(), "incorrect number of elements");
apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- appsJSONObject = apps.getJSONObject("app");
- array = new JSONArray();
- array.put(appsJSONObject);
+ array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
app = array.getJSONObject(0);
assertTrue(!app.has("timeouts"), "Timeouts shouldn't exist");
@@ -1309,9 +1279,7 @@ public void testAppsQueryWithDeselects()
assertEquals(1, json.length(), "incorrect number of elements");
apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- appsJSONObject = apps.getJSONObject("app");
- array = new JSONArray();
- array.put(appsJSONObject);
+ array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
app = array.getJSONObject(0);
assertTrue(!app.has("appNodeLabelExpression"), "AppNodeLabelExpression shouldn't exist");
@@ -1328,9 +1296,7 @@ public void testAppsQueryWithDeselects()
assertEquals(1, json.length(), "incorrect number of elements");
apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of elements");
- appsJSONObject = apps.getJSONObject("app");
- array = new JSONArray();
- array.put(appsJSONObject);
+ array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect number of elements");
app = array.getJSONObject(0);
assertTrue(!app.has("resourceInfo"), "Resource info shouldn't exist");
@@ -1421,9 +1387,7 @@ public void testAppStatistics() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
appsStatInfo = json.getJSONObject("appStatInfo");
assertEquals(1, appsStatInfo.length(), "incorrect number of elements");
- JSONObject statItem = appsStatInfo.getJSONObject("statItem");
- statItems = new JSONArray();
- statItems.put(statItem);
+ statItems = appsStatInfo.getJSONArray("statItem");
assertEquals(1, statItems.length(), "incorrect number of elements");
assertEquals("ACCEPTED", statItems.getJSONObject(0).getString("state"));
assertEquals("*", statItems.getJSONObject(0).getString("type"));
@@ -1789,7 +1753,7 @@ public void verifyAppsXML(NodeList nodes, RMApp app, boolean hasResourceReq)
public void verifyAppInfo(JSONObject info, RMApp app, boolean hasResourceReqs)
throws JSONException, Exception {
- int expectedNumberOfElements = 41 + (hasResourceReqs ? 2 : 0);
+ int expectedNumberOfElements = 40 + (hasResourceReqs ? 2 : 0);
String appNodeLabelExpression = null;
String amNodeLabelExpression = null;
if (app.getApplicationSubmissionContext()
@@ -1836,10 +1800,8 @@ public void verifyAppInfo(JSONObject info, RMApp app, boolean hasResourceReqs)
amRPCAddress);
if (hasResourceReqs) {
- JSONObject resourceRequests = info.getJSONObject("resourceRequests");
- JSONArray array = new JSONArray();
- array.put(resourceRequests);
- verifyResourceRequests(array, app);
+ JSONArray resourceRequests = info.getJSONArray("resourceRequests");
+ verifyResourceRequests(resourceRequests, app);
}
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsCustomResourceTypes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsCustomResourceTypes.java
index f1c8dd3137e..b92d9fa2ddb 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsCustomResourceTypes.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsCustomResourceTypes.java
@@ -19,7 +19,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.apache.hadoop.conf.Configuration;
@@ -34,6 +33,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.resource.CustomResourceTypesConfigurationProvider;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.helper.BufferedClientResponse;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.helper.JsonCustomResourceTypeTestcase;
@@ -79,7 +79,7 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -174,9 +174,7 @@ public void testRunningAppsJson() throws Exception {
assertEquals(1, json.length(), "incorrect number of apps elements");
JSONObject apps = json.getJSONObject("apps");
assertEquals(1, apps.length(), "incorrect number of app elements");
- JSONObject app = apps.getJSONObject("app");
- JSONArray array = new JSONArray();
- array.put(app);
+ JSONArray array = apps.getJSONArray("app");
assertEquals(1, array.length(), "incorrect count of app");
verifyAppInfoJson(array.getJSONObject(0), app1, rm);
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsModification.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsModification.java
index a28e0e90844..a88f8a1acae 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsModification.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsModification.java
@@ -18,6 +18,7 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
+import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.toJson;
import static org.apache.hadoop.yarn.webapp.WebServicesTestUtils.assertResponseStatusCode;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -29,7 +30,6 @@
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
-import java.io.StringWriter;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.security.Principal;
@@ -55,7 +55,6 @@
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import javax.xml.bind.JAXBException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -105,15 +104,18 @@
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.CredentialsInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LocalResourceInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LogAggregationContextInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.AppStateReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.ExcludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.IncludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.Times;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.apache.hadoop.yarn.webapp.WebServicesTestUtils;
+
+import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
+import org.glassfish.jersey.jettison.internal.entity.JettisonObjectProvider;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.params.ParameterizedTest;
@@ -125,11 +127,7 @@
import org.xml.sax.SAXException;
import com.google.inject.Singleton;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonMarshaller;
-import org.glassfish.jersey.jettison.internal.entity.JettisonObjectProvider.App;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import static javax.ws.rs.core.Response.Status.ACCEPTED;
@@ -159,55 +157,14 @@ public class TestRMWebServicesAppsModification extends JerseyTestBase {
private HttpServletRequest hsRequest = mock(HttpServletRequest.class);
private HttpServletResponse hsResponse = mock(HttpServletResponse.class);
- private static final JettisonMarshaller APP_STATE_WRITER;
- static {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(AppState.class);
- APP_STATE_WRITER = jettisonJaxbContext.createJsonMarshaller();
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
- }
-
- private static final JettisonMarshaller APP_PRIORITY_WRITER;
- static {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(AppPriority.class);
- APP_PRIORITY_WRITER = jettisonJaxbContext.createJsonMarshaller();
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
- }
-
- private static final JettisonMarshaller APP_QUEUE_WRITER;
- static {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(AppQueue.class);
- APP_QUEUE_WRITER = jettisonJaxbContext.createJsonMarshaller();
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
- }
-
- private static final JettisonMarshaller APP_TIMEOUT_WRITER;
- static {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(AppTimeoutInfo.class);
- APP_TIMEOUT_WRITER = jettisonJaxbContext.createJsonMarshaller();
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
- }
-
@Override
protected Application configure() {
config = new ResourceConfig();
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -379,10 +336,9 @@ private WebTarget constructWebResource(WebTarget r, String... paths) {
private WebTarget constructWebResource(String... paths) {
WebTarget r = target()
- .register(App.class)
- .register(AppStateReader.class)
- .register(ApplicationSubmissionContextInfoReader.class)
- .register(ApplicationSubmissionContextInfoWriter.class);
+ .register(JettisonObjectProvider.App.class)
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
WebTarget ws = r.path("ws").path("v1").path("cluster");
return this.constructWebResource(ws, paths);
}
@@ -444,7 +400,7 @@ public void testSingleAppKill(int run) throws Exception {
Object entity;
if (contentType.equals(MediaType.APPLICATION_JSON_TYPE)) {
- entity = appStateToJSON(targetState);
+ entity = toJson(targetState, AppState.class);
} else {
entity = targetState;
}
@@ -540,7 +496,7 @@ public void testSingleAppKillInvalidState(int run) throws Exception {
AppState targetState = new AppState(targetStateString);
Object entity;
if (contentType.equals(MediaType.APPLICATION_JSON_TYPE)) {
- entity = appStateToJSON(targetState);
+ entity = toJson(targetState, AppState.class);
} else {
entity = targetState;
}
@@ -564,12 +520,6 @@ public void testSingleAppKillInvalidState(int run) throws Exception {
rm.stop();
}
- private static String appStateToJSON(AppState state) throws Exception {
- StringWriter stringWriter = new StringWriter();
- APP_STATE_WRITER.marshallToJSON(state, stringWriter);
- return stringWriter.toString();
- }
-
protected static void verifyAppStateJson(Response response,
RMAppState... states) throws JSONException {
@@ -577,7 +527,7 @@ protected static void verifyAppStateJson(Response response,
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- String responseState = json.getJSONObject("appstate").getString("state");
+ String responseState = json.getString("state");
boolean valid = false;
for (RMAppState state : states) {
if (state.toString().equals(responseState)) {
@@ -774,8 +724,7 @@ protected String validateGetNewApplicationResponse(Response resp)
String ret = "";
if (resp.getMediaType().toString().contains(MediaType.APPLICATION_JSON)) {
JSONObject json = resp.readEntity(JSONObject.class);
- JSONObject newApplication = json.getJSONObject("NewApplication");
- ret = validateGetNewApplicationJsonResponse(newApplication);
+ ret = validateGetNewApplicationJsonResponse(json);
} else if (resp.getMediaType().toString().contains(MediaType.APPLICATION_XML)) {
String xml = resp.readEntity(String.class);
ret = validateGetNewApplicationXMLResponse(xml);
@@ -938,10 +887,11 @@ public void testAppSubmit(String acceptMedia, String contentMedia)
String reservationId = ReservationId.newInstance(
System.currentTimeMillis(), 1).toString();
appInfo.setReservationId(reservationId);
+ Entity<ApplicationSubmissionContextInfo> entity = Entity.entity(appInfo, contentMedia);
Response response =
this.constructWebResource(urlPath).request(acceptMedia)
- .post(Entity.entity(appInfo, contentMedia), Response.class);
+ .post(entity, Response.class);
if (!this.isAuthenticationEnabled()) {
assertResponseStatusCode(Response.Status.UNAUTHORIZED, response.getStatusInfo());
@@ -1198,7 +1148,7 @@ public void testUpdateAppPriority(int run) throws Exception {
AppPriority priority = new AppPriority(modifiedPriority);
Object entity;
if (contentType.equals(MediaType.APPLICATION_JSON_TYPE)) {
- entity = appPriorityToJSON(priority);
+ entity = toJson(priority, AppPriority.class);
} else {
entity = priority;
}
@@ -1287,7 +1237,7 @@ public void testAppMove(int run) throws Exception {
AppQueue targetQueue = new AppQueue("test");
Object entity;
if (contentType.equals(MediaType.APPLICATION_JSON_TYPE)) {
- entity = appQueueToJSON(targetQueue);
+ entity = toJson(targetQueue, AppQueue.class);
} else {
entity = targetQueue;
}
@@ -1334,27 +1284,13 @@ public void testAppMove(int run) throws Exception {
rm.stop();
}
- protected static String appPriorityToJSON(AppPriority targetPriority)
- throws Exception {
- StringWriter stringWriter = new StringWriter();
- APP_PRIORITY_WRITER.marshallToJSON(targetPriority, stringWriter);
- return stringWriter.toString();
- }
-
- protected static String appQueueToJSON(AppQueue targetQueue) throws Exception {
- StringWriter stringWriter = new StringWriter();
- APP_QUEUE_WRITER.marshallToJSON(targetQueue, stringWriter);
- return stringWriter.toString();
- }
-
protected static void verifyAppPriorityJson(Response response,
int expectedPriority) throws JSONException {
assertEquals(MediaType.APPLICATION_JSON_TYPE + ";" + JettyUtils.UTF_8,
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- JSONObject applicationpriority = json.getJSONObject("applicationpriority");
- int responsePriority = applicationpriority.getInt("priority");
+ int responsePriority = json.getInt("priority");
assertEquals(expectedPriority, responsePriority);
}
@@ -1382,7 +1318,7 @@ protected static void verifyAppQueueJson(Response response, String queue)
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- String responseQueue = json.getJSONObject("appqueue").getString("queue");
+ String responseQueue = json.getString("queue");
assertEquals(queue, responseQueue);
}
@@ -1433,8 +1369,8 @@ public void testUpdateAppTimeout(int run) throws Exception {
response.getMediaType().toString());
JSONObject js =
response.readEntity(JSONObject.class).getJSONObject("timeouts");
- JSONObject entity = js.getJSONObject("timeout");
- verifyAppTimeoutJson(entity,
+ JSONArray entity = js.getJSONArray("timeout");
+ verifyAppTimeoutJson(entity.getJSONObject(0),
ApplicationTimeoutType.LIFETIME, "UNLIMITED", -1);
}
@@ -1454,6 +1390,7 @@ public void testUpdateAppTimeout(int run) throws Exception {
response.getStatusInfo());
continue;
}
+
assertResponseStatusCode(Response.Status.OK, response.getStatusInfo());
if (mediaType.contains(MediaType.APPLICATION_JSON)) {
verifyAppTimeoutJson(response, ApplicationTimeoutType.LIFETIME,
@@ -1496,7 +1433,7 @@ private Object getAppTimeoutInfoEntity(ApplicationTimeoutType type,
Object entity;
if (contentType.equals(MediaType.APPLICATION_JSON_TYPE)) {
- entity = appTimeoutToJSON(timeoutUpdate);
+ entity = toJson(timeoutUpdate, AppTimeoutInfo.class);
} else {
entity = timeoutUpdate;
}
@@ -1544,11 +1481,4 @@ protected static void verifyAppTimeoutXML(Response response,
assertTrue(WebServicesTestUtils.getXmlLong(element,
"remainingTimeInSeconds") < timeOutFromNow);
}
-
- protected static String appTimeoutToJSON(AppTimeoutInfo timeout)
- throws Exception {
- StringWriter stringWriter = new StringWriter();
- APP_TIMEOUT_WRITER.marshallToJSON(timeout, stringWriter);
- return stringWriter.toString();
- }
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java
index 3e9f7f30ea6..df23270da5f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySched.java
@@ -31,12 +31,10 @@
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.codehaus.jettison.json.JSONObject;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
@@ -78,10 +76,8 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDefaultLabel.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDefaultLabel.java
index 49c5f9f46f9..9e1d3d3f32f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDefaultLabel.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDefaultLabel.java
@@ -24,12 +24,10 @@
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
@@ -69,10 +67,8 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfig.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfig.java
index 042defbc6f3..bf95db64a89 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfig.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfig.java
@@ -25,11 +25,9 @@
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
@@ -91,10 +89,9 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigAbsoluteMode.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigAbsoluteMode.java
index 2e16928ab97..3268be75fb3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigAbsoluteMode.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigAbsoluteMode.java
@@ -24,12 +24,10 @@
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
@@ -91,10 +89,9 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigWeightMode.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigWeightMode.java
index 586954be7e8..4324b24c7c1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigWeightMode.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigWeightMode.java
@@ -24,12 +24,10 @@
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
@@ -90,10 +88,9 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigWeightModeDQC.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigWeightModeDQC.java
index 563d888a575..99d0dc3b617 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigWeightModeDQC.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDynamicConfigWeightModeDQC.java
@@ -26,12 +26,10 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerQueueManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
@@ -101,10 +99,9 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreation.java
index 2b00bb99c46..870b897baba 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreation.java
@@ -31,11 +31,9 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
@@ -70,10 +68,9 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreationAbsoluteMode.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreationAbsoluteMode.java
index ee85faa00c5..553438046df 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreationAbsoluteMode.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedLegacyQueueCreationAbsoluteMode.java
@@ -25,10 +25,10 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerQueueManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.junit.jupiter.api.AfterAll;
@@ -72,7 +72,7 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerConfigMutation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerConfigMutation.java
index a470bcb8c07..d76cd87ef22 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerConfigMutation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerConfigMutation.java
@@ -36,14 +36,13 @@
import org.apache.hadoop.yarn.conf.YarnConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.SchedConfUpdateInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.ExcludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.IncludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.dao.QueueConfigInfo;
import org.apache.hadoop.yarn.webapp.dao.SchedConfUpdateInfo;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
@@ -83,11 +82,9 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(SchedConfUpdateInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
@@ -161,7 +158,9 @@ public void testUpdateAbsoluteHierarchyWithZeroCapacities(boolean pLegacyQueueMo
QueueConfigInfo b = new QueueConfigInfo("root.a", capacityChange);
updateInfo.getUpdateQueueInfo().add(b);
- Response response = target().register(SchedConfUpdateInfoWriter.class)
+ Response response = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider())
.path("ws/v1/cluster/scheduler-conf")
.queryParam("user.name", userName)
.request(MediaType.APPLICATION_JSON)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedMode.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedMode.java
index 8141cee7e81..19f564b70e8 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedMode.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedMode.java
@@ -24,10 +24,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -79,7 +79,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentage.java
index 4782b44c127..88bb76c02f4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentage.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentage.java
@@ -20,10 +20,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -79,7 +79,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageAndWeight.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageAndWeight.java
index a300c10f33f..08c4176aac5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageAndWeight.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageAndWeight.java
@@ -20,10 +20,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -78,7 +78,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageAndWeightVector.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageAndWeightVector.java
index a1cc259060e..4875c65dbd6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageAndWeightVector.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageAndWeightVector.java
@@ -20,10 +20,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -78,7 +78,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageVector.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageVector.java
index 0829f24d545..643d83321a0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageVector.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndPercentageVector.java
@@ -20,10 +20,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -78,7 +78,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndWeight.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndWeight.java
index 40cc024052d..c977f457e39 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndWeight.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndWeight.java
@@ -20,10 +20,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -78,7 +78,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndWeightVector.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndWeightVector.java
index 71c2cb5bb69..801e70b2fa9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndWeightVector.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModeAbsoluteAndWeightVector.java
@@ -20,10 +20,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -78,7 +78,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModePercentageAndWeight.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModePercentageAndWeight.java
index 25ba549f7f2..74485dbc5f4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModePercentageAndWeight.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModePercentageAndWeight.java
@@ -20,10 +20,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -77,7 +77,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModePercentageAndWeightVector.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModePercentageAndWeightVector.java
index 058acf8080b..3cecbdeede4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModePercentageAndWeightVector.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedulerMixedModePercentageAndWeightVector.java
@@ -20,10 +20,10 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.server.resourcemanager.MockRM;
import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
@@ -78,7 +78,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesConfigurationMutation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesConfigurationMutation.java
index 5ddaf054be4..62306fa67e5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesConfigurationMutation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesConfigurationMutation.java
@@ -19,7 +19,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.http.JettyUtils;
@@ -36,8 +35,9 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePrefixes;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeLabelInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeLabelsInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.NodeLabelsInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.SchedConfUpdateInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.ExcludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.IncludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.apache.hadoop.yarn.webapp.dao.QueueConfigInfo;
@@ -110,9 +110,9 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(NodeLabelsInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
@@ -207,8 +207,7 @@ private CapacitySchedulerConfiguration getSchedulerConf()
.request(MediaType.APPLICATION_JSON)
.get(Response.class);
assertEquals(Status.OK.getStatusCode(), response.getStatus());
- JSONObject json = response.readEntity(JSONObject.class).
- getJSONObject("configuration");
+ JSONObject json = response.readEntity(JSONObject.class);
JSONArray items = (JSONArray) json.get("property");
CapacitySchedulerConfiguration parsedConf =
new CapacitySchedulerConfiguration();
@@ -248,7 +247,9 @@ public void testFormatSchedulerConf() throws Exception {
updateInfo.getUpdateQueueInfo().add(stoppedInfo);
// Add a queue root.formattest to the existing three queues
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response = r.path("ws").path("v1").path("cluster")
.path("scheduler-conf").queryParam("user.name", userName)
.request(MediaType.APPLICATION_JSON)
@@ -293,7 +294,9 @@ public void testAddNestedQueue() throws Exception {
assertNotNull(orgConf);
assertEquals(4, orgConf.getQueues(ROOT).size());
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -338,7 +341,9 @@ public void testAddNestedQueue() throws Exception {
@Test
public void testAddWithUpdate() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -368,7 +373,9 @@ public void testAddWithUpdate() throws Exception {
@Test
public void testUnsetParentQueueOrderingPolicy() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
// Update ordering policy of Leaf Queue root.b to fair
@@ -415,7 +422,9 @@ public void testUnsetParentQueueOrderingPolicy() throws Exception {
@Test
public void testUnsetLeafQueueOrderingPolicy() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
// Update ordering policy of Parent Queue root.c to priority-utilization
@@ -459,8 +468,9 @@ public void testUnsetLeafQueueOrderingPolicy() throws Exception {
@Test
public void testRemoveQueue() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
-
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
stopQueue(ROOT_A_A2);
@@ -485,7 +495,9 @@ public void testRemoveQueue() throws Exception {
@Test
public void testStopWithRemoveQueue() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -514,7 +526,9 @@ public void testStopWithRemoveQueue() throws Exception {
@Test
public void testRemoveQueueWhichHasQueueMapping() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
@@ -553,7 +567,9 @@ public void testRemoveQueueWhichHasQueueMapping() throws Exception {
@Test
public void testStopWithConvertLeafToParentQueue() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
// Set state of queues to STOPPED.
@@ -584,7 +600,9 @@ public void testStopWithConvertLeafToParentQueue() throws Exception {
@Test
public void testRemoveParentQueue() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -607,7 +625,9 @@ public void testRemoveParentQueue() throws Exception {
@Test
public void testRemoveParentQueueWithCapacity() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -637,7 +657,9 @@ public void testRemoveParentQueueWithCapacity() throws Exception {
@Test
public void testRemoveMultipleQueues() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -664,7 +686,9 @@ public void testRemoveMultipleQueues() throws Exception {
}
private void stopQueue(QueuePath... queuePaths) throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -692,7 +716,9 @@ private void stopQueue(QueuePath... queuePaths) throws Exception {
@Test
public void testUpdateQueue() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -743,7 +769,9 @@ public void testUpdateQueue() throws Exception {
@Test
public void testUpdateQueueCapacity() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -770,7 +798,9 @@ public void testUpdateQueueCapacity() throws Exception {
@Test
public void testGlobalConfChange() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
@@ -807,7 +837,9 @@ public void testGlobalConfChange() throws Exception {
@Test
public void testNodeLabelRemovalResidualConfigsAreCleared() throws Exception {
- WebTarget r = target().register(NodeLabelsInfoReader.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
Response response;
// 1. Create Node Label: label1
@@ -1010,7 +1042,9 @@ private String getAccessibleNodeLabelsMaxCapacityPropertyName(String label) {
@Test
public void testValidateWithClusterMaxAllocation() throws Exception {
- WebTarget r = target().register(SchedConfUpdateInfoWriter.class);
+ WebTarget r = target()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider());
int clusterMax = YarnConfiguration.
DEFAULT_RM_SCHEDULER_MAXIMUM_ALLOCATION_MB * 2;
conf.setInt(YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB,
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesContainers.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesContainers.java
index 4869cdd4c52..a77d0add7ef 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesContainers.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesContainers.java
@@ -46,15 +46,13 @@
import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptState;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ApplicationSubmissionContextInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ApplicationSubmissionContextInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
@@ -72,10 +70,9 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(ApplicationSubmissionContextInfoWriter.class);
- config.register(ApplicationSubmissionContextInfoReader.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCustomResourceTypesCommons.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCustomResourceTypesCommons.java
index 3307056dee1..bbd5a5c71d1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCustomResourceTypesCommons.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCustomResourceTypesCommons.java
@@ -93,7 +93,7 @@ public static JSONArray parseResourceRequests(JSONObject info) throws JSONExcept
}
static int getExpectedNumberOfElements(RMApp app) {
- int expectedNumberOfElements = 40 + 2; // 2 -> resourceRequests
+ int expectedNumberOfElements = 39 + 2; // 2 -> resourceRequests
if (app.getApplicationSubmissionContext()
.getNodeLabelExpression() != null) {
expectedNumberOfElements++;
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java
index c813f477f9d..aa6a1c1ffd5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokenAuthentication.java
@@ -374,7 +374,7 @@ public Void call() throws Exception {
try {
reader = new BufferedReader(new InputStreamReader(response, StandardCharsets.UTF_8));
for (String line; (line = reader.readLine()) != null;) {
- JSONObject obj = new JSONObject(line).getJSONObject("delegation-token");
+ JSONObject obj = new JSONObject(line);
if (obj.has("token")) {
token = obj.getString("token");
}
@@ -457,7 +457,7 @@ public String call() throws Exception {
String line;
while ((line = reader.readLine()) != null) {
String dtoken = line;
- JSONObject obj = new JSONObject(dtoken).getJSONObject("delegation-token");
+ JSONObject obj = new JSONObject(dtoken);
if (obj.has("token")) {
reader.close();
response.close();
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokens.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokens.java
index 45b7cd39525..bb60d45abd0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokens.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesDelegationTokens.java
@@ -63,6 +63,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.DelegationToken;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.apache.hadoop.yarn.webapp.WebServicesTestUtils;
@@ -88,7 +89,6 @@
import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.toJson;
import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.toEntity;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.logging.LoggingFeature;
import org.glassfish.jersey.server.ResourceConfig;
@@ -111,7 +111,8 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
config.register(TestRMWebServicesAppsModification.TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
return config;
}
@@ -747,8 +748,7 @@ private void verifySimpleAuthCancel() {
throws IOException, ParserConfigurationException, SAXException,
JSONException {
if (response.getMediaType().toString().contains(MediaType.APPLICATION_JSON)) {
- return getDelegationTokenFromJson(
- response.readEntity(JSONObject.class).getJSONObject("delegation-token"));
+ return getDelegationTokenFromJson(response.readEntity(JSONObject.class));
}
return getDelegationTokenFromXML(response.readEntity(String.class));
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java
index 3d42dd8c9b1..8b4b2fa3f74 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java
@@ -71,6 +71,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.activities.ActivityState;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.resource.Resources;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
@@ -88,7 +89,6 @@
import org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableSet;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
@@ -130,7 +130,8 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodeLabels.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodeLabels.java
index d04488d871d..26b8382d65d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodeLabels.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodeLabels.java
@@ -18,6 +18,7 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
+import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.toJson;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -26,7 +27,6 @@
import static org.mockito.Mockito.when;
import java.io.IOException;
-import java.io.StringWriter;
import java.security.Principal;
import java.util.ArrayList;
import java.util.List;
@@ -46,6 +46,7 @@
import org.apache.commons.lang3.tuple.Pair;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.Lists;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.http.JettyUtils;
@@ -59,9 +60,9 @@
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeToLabelsEntry;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeToLabelsInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeToLabelsEntryList;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.NodeLabelsInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.LabelsToNodesInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.NodeToLabelsInfoReader;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.ExcludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.IncludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.apache.hadoop.yarn.webapp.WebServicesTestUtils;
@@ -71,9 +72,6 @@
import org.junit.jupiter.api.Test;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonMarshaller;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
public class TestRMWebServicesNodeLabels extends JerseyTestBase {
@@ -121,8 +119,8 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(NodeLabelsInfoReader.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -166,11 +164,10 @@ public TestRMWebServicesNodeLabels() {
}
private WebTarget getClusterWebResource() {
- return targetWithJsonObject().
- register(NodeLabelsInfoReader.class).
- register(LabelsToNodesInfoReader.class).
- register(NodeToLabelsInfoReader.class).
- path(PATH_WS).path(PATH_V1).path(PATH_CLUSTER);
+ return targetWithJsonObject()
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider())
+ .path(PATH_WS).path(PATH_V1).path(PATH_CLUSTER);
}
private Response get(String path) {
@@ -215,9 +212,11 @@ private Response post(String path, String queryUserName, Object payload,
webTarget = webTarget.queryParam(param.getKey(), value);
}
}
- return webTarget.request(MediaType.APPLICATION_JSON)
- .post(Entity.entity(toJson(payload, payloadClass),
- MediaType.APPLICATION_JSON), Response.class);
+ Entity<String> entity = payload == null
+ ? null
+ : Entity.entity(toJson(payload, payloadClass), MediaType.APPLICATION_JSON);
+
+ return webTarget.request(MediaType.APPLICATION_JSON).post(entity, Response.class);
}
@Test
@@ -697,16 +696,4 @@ public void testNodeLabelPartitionInfo() throws Exception {
assertNotNull(nodes.getPartitionInfo());
assertNotNull(nodes.getPartitionInfo().getResourceAvailable());
}
-
- @SuppressWarnings("rawtypes")
- private String toJson(Object obj, Class klass) throws Exception {
- if (obj == null) {
- return null;
- }
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(klass);
- JettisonMarshaller jsonMarshaller = jettisonJaxbContext.createJsonMarshaller();
- StringWriter stringWriter = new StringWriter();
- jsonMarshaller.marshallToJSON(obj, stringWriter);
- return stringWriter.toString();
- }
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
index aa3157b5d06..f2295ab777d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesNodes.java
@@ -88,8 +88,9 @@
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceOptionInfo;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.ResourceOptionInfoReader;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.writer.ResourceOptionInfoWriter;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.ExcludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.IncludeRootJSONProvider;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.Records;
import org.apache.hadoop.yarn.util.RackResolver;
import org.apache.hadoop.yarn.util.resource.Resources;
@@ -97,6 +98,7 @@
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.apache.hadoop.yarn.webapp.WebServicesTestUtils;
+
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
@@ -109,7 +111,6 @@
import org.apache.hadoop.thirdparty.com.google.common.base.Joiner;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
@@ -127,7 +128,8 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
config.register(TestRMCustomAuthFilter.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -292,10 +294,7 @@ public void testNodesQueryNew() throws Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject nodes = json.getJSONObject("nodes");
assertEquals(1, nodes.length(), "incorrect number of elements");
- JSONObject node = nodes.getJSONObject("node");
- JSONArray nodeArray = new JSONArray();
- nodeArray.put(node);
-
+ JSONArray nodeArray = nodes.getJSONArray("node");
assertEquals(1, nodeArray.length(), "incorrect number of elements");
JSONObject info = nodeArray.getJSONObject(0);
@@ -316,7 +315,7 @@ public void testNodesQueryStateNone() throws JSONException, Exception {
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- assertEquals("", json.get("nodes").toString(), "nodes is not empty");
+ assertEquals("{}", json.get("nodes").toString(), "nodes is not empty");
}
@Test
@@ -428,9 +427,7 @@ public void testNodesQueryRunning() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject nodes = json.getJSONObject("nodes");
assertEquals(1, nodes.length(), "incorrect number of elements");
- JSONObject node = nodes.getJSONObject("node");
- JSONArray nodeArray = new JSONArray();
- nodeArray.put(node);
+ JSONArray nodeArray = nodes.getJSONArray("node");
assertEquals(1, nodeArray.length(), "incorrect number of elements");
}
@@ -447,7 +444,7 @@ public void testNodesQueryHealthyFalse() throws JSONException, Exception {
response.getMediaType().toString());
JSONObject json = response.readEntity(JSONObject.class);
assertEquals(1, json.length(), "incorrect number of elements");
- assertEquals("", json.get("nodes").toString(), "nodes is not empty");
+ assertEquals("{}", json.get("nodes").toString(), "nodes is not empty");
}
public void testNodesHelper(String path, String media) throws JSONException,
@@ -739,9 +736,7 @@ public void testNodesResourceUtilization() throws JSONException, Exception {
assertEquals(1, json.length(), "incorrect number of elements");
JSONObject nodes = json.getJSONObject("nodes");
assertEquals(1, nodes.length(), "incorrect number of elements");
- JSONObject jsonNode = nodes.getJSONObject("node");
- JSONArray nodeArray = new JSONArray();
- nodeArray.put(jsonNode);
+ JSONArray nodeArray = nodes.getJSONArray("node");
assertEquals(1, nodeArray.length(), "incorrect number of elements");
JSONObject info = nodeArray.getJSONObject(0);
@@ -752,8 +747,8 @@ public void testNodesResourceUtilization() throws JSONException, Exception {
@Test
public void testUpdateNodeResource() throws Exception {
WebTarget r = targetWithJsonObject()
- .register(ResourceOptionInfoReader.class)
- .register(ResourceOptionInfoWriter.class)
+ .register(new IncludeRootJSONProvider())
+ .register(new ExcludeRootJSONProvider())
.path(RMWSConsts.RM_WEB_SERVICE_PATH);
r = r.queryParam("user.name", userName);
@@ -1023,10 +1018,8 @@ public void testNodeAttributesInfo() throws Exception {
String entity = response.readEntity(String.class);
JSONObject nodesInfoJson = new JSONObject(entity);
- JSONObject jsonNodes = nodesInfoJson.getJSONObject("nodes");
- JSONObject jsonNode = jsonNodes.getJSONObject("node");
- JSONArray nodes = new JSONArray();
- nodes.put(jsonNode);
+ JSONArray nodes = nodesInfoJson.getJSONObject("nodes")
+ .getJSONArray("node");
JSONObject nodeJson = nodes.getJSONObject(0);
JSONArray nodeAttributesInfo = nodeJson.getJSONObject("nodeAttributesInfo")
.getJSONArray("nodeAttributeInfo");
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
index 1d8c6bab87f..40f78b44b98 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java
@@ -18,6 +18,7 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
+import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.fromJson;
import static org.apache.hadoop.yarn.server.resourcemanager.webapp.TestWebServiceUtil.toJson;
import static org.assertj.core.api.Assertions.assertThat;
import static org.apache.hadoop.yarn.webapp.WebServicesTestUtils.assertResponseStatusCode;
@@ -28,7 +29,6 @@
import java.io.File;
import java.io.IOException;
-import java.io.StringReader;
import java.net.URL;
import java.security.Principal;
import java.util.Arrays;
@@ -45,7 +45,6 @@
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import javax.xml.bind.JAXBException;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
@@ -71,6 +70,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationDeleteRequestInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationSubmissionRequestInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationUpdateRequestInfo;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.Clock;
import org.apache.hadoop.yarn.util.UTCClock;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
@@ -82,9 +82,6 @@
import org.junit.jupiter.api.AfterEach;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonUnmarshaller;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.junit.jupiter.params.ParameterizedTest;
@@ -112,17 +109,6 @@ public class TestRMWebServicesReservation extends JerseyTestBase {
private static final String GET_NEW_RESERVATION_PATH =
"reservation/new-reservation";
- private static JettisonUnmarshaller reservationSubmissionRequestInfoReader;
- static {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(
- ReservationSubmissionRequestInfo.class);
- reservationSubmissionRequestInfoReader = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
- }
-
private ResourceConfig config;
private HttpServletRequest hsRequest = mock(HttpServletRequest.class);
private HttpServletResponse hsResponse = mock(HttpServletResponse.class);
@@ -162,7 +148,8 @@ protected Application configure() {
if (setAuthFilter) {
config.register(TestRMCustomAuthFilter.class);
}
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -480,9 +467,7 @@ public void testTimeIntervalRequestListReservation(int run, boolean recurrence)
return;
}
- JSONObject reservations = json.
- getJSONObject("reservationListInfo").
- getJSONObject("reservations");
+ JSONObject reservations = json.getJSONArray("reservations").getJSONObject(0);
testRDLHelper(reservations);
@@ -530,8 +515,7 @@ public void testSameTimeIntervalRequestListReservation(int run, boolean recurren
return;
}
- JSONObject reservations =
- json.getJSONObject("reservationListInfo").getJSONObject("reservations");
+ JSONObject reservations = json.getJSONArray("reservations").getJSONObject(0);
testRDLHelper(reservations);
@@ -573,9 +557,7 @@ public void testInvalidTimeIntervalRequestListReservation(int run, boolean recur
return;
}
- JSONArray reservations = json.
- getJSONObject("reservationListInfo").
- getJSONArray("reservations");
+ JSONArray reservations = json.getJSONArray("reservations");
assertEquals(2, reservations.length());
@@ -619,8 +601,8 @@ public void testInvalidEndTimeRequestListReservation(int run, boolean recurrence
if (!enableRecurrence) {
JSONObject reservations = json.
- getJSONObject("reservationListInfo").
- getJSONObject("reservations");
+ getJSONArray("reservations")
+ .getJSONObject(0);
testRDLHelper(reservations);
@@ -633,7 +615,7 @@ public void testInvalidEndTimeRequestListReservation(int run, boolean recurrence
// picked up by the search interval since it is greater than the period
// of the reservation.
JSONArray reservations =
- json.getJSONObject("reservationListInfo").getJSONArray("reservations");
+ json.getJSONArray("reservations");
assertEquals(2, reservations.length());
}
@@ -671,8 +653,7 @@ public void testEmptyEndTimeRequestListReservation(int run, boolean recurrence)
}
if (!enableRecurrence) {
- JSONObject reservations = json.
- getJSONObject("reservationListInfo").getJSONObject("reservations");
+ JSONObject reservations = json.getJSONArray("reservations").getJSONObject(0);
testRDLHelper(reservations);
@@ -685,7 +666,7 @@ public void testEmptyEndTimeRequestListReservation(int run, boolean recurrence)
// picked up by the search interval since it is greater than the period
// of the reservation.
JSONArray reservations =
- json.getJSONObject("reservationListInfo").getJSONArray("reservations");
+ json.getJSONArray("reservations");
assertEquals(2, reservations.length());
}
@@ -724,9 +705,7 @@ public void testInvalidStartTimeRequestListReservation(int run, boolean recurren
return;
}
- JSONObject reservations = json.
- getJSONObject("reservationListInfo").
- getJSONObject("reservations");
+ JSONObject reservations = json.getJSONArray("reservations").getJSONObject(0);
testRDLHelper(reservations);
@@ -770,8 +749,7 @@ public void testEmptyStartTimeRequestListReservation(int run, boolean recurrence
return;
}
- JSONObject reservations = json.
- getJSONObject("reservationListInfo").getJSONObject("reservations");
+ JSONObject reservations = json.getJSONArray("reservations").getJSONObject(0);
testRDLHelper(reservations);
@@ -807,12 +785,9 @@ public void testQueueOnlyRequestListReservation(int run, boolean recurrence) thr
return;
}
- assertThat(json.getJSONObject("reservationListInfo")
- .getJSONArray("reservations").length()).isEqualTo(2);
- testRDLHelper(json.getJSONObject("reservationListInfo")
- .getJSONArray("reservations").getJSONObject(0));
- testRDLHelper(json.getJSONObject("reservationListInfo")
- .getJSONArray("reservations").getJSONObject(1));
+ assertThat(json.getJSONArray("reservations").length()).isEqualTo(2);
+ testRDLHelper(json.getJSONArray("reservations").getJSONObject(0));
+ testRDLHelper(json.getJSONArray("reservations").getJSONObject(1));
rm.stop();
}
@@ -895,9 +870,7 @@ public void testReservationIdRequestListReservation(int run, boolean recurrence)
return;
}
- JSONObject reservations = json.
- getJSONObject("reservationListInfo").
- getJSONObject("reservations");
+ JSONObject reservations = json.getJSONArray("reservations").getJSONObject(0);
testRDLHelper(reservations);
@@ -959,7 +932,7 @@ public void testIncludeResourceAllocations(int run, boolean recurrence) throws E
}
JSONObject reservations =
- json.getJSONObject("reservationListInfo").getJSONObject("reservations");
+ json.getJSONArray("reservations").getJSONObject(0);
testRDLHelper(reservations);
@@ -998,8 +971,8 @@ public void testExcludeResourceAllocations(int run, boolean recurrence) throws E
}
JSONObject reservations = json.
- getJSONObject("reservationListInfo").
- getJSONObject("reservations");
+ getJSONArray("reservations")
+ .getJSONObject(0);
testRDLHelper(reservations);
@@ -1061,13 +1034,9 @@ private ReservationId getReservationIdTestHelper(int fallbackReservationId)
return ReservationId.newInstance(clock.getTime(), fallbackReservationId);
}
- System.out.println("RESPONSE:" + response);
assertEquals(MediaType.APPLICATION_JSON_TYPE + ";" + JettyUtils.UTF_8,
response.getMediaType().toString());
- JSONObject json =
- response.
- readEntity(JSONObject.class).
- getJSONObject("new-reservation");
+ JSONObject json = response.readEntity(JSONObject.class).getJSONObject("new-reservation");
assertEquals(1, json.length(), "incorrect number of elements");
ReservationId rid = null;
@@ -1107,9 +1076,9 @@ private Response reservationSubmissionTestHelper(String path,
private Response submitAndVerifyReservation(String path, String media,
String reservationJson) throws Exception {
- ReservationSubmissionRequestInfo rsci = reservationSubmissionRequestInfoReader.
- unmarshalFromJSON(new StringReader(reservationJson),
- ReservationSubmissionRequestInfo.class);
+ ReservationSubmissionRequestInfo rsci =
+ fromJson(reservationJson, ReservationSubmissionRequestInfo.class);
+
Thread.sleep(1000);
Response response = constructWebResource(path)
.request(MediaType.APPLICATION_JSON)
@@ -1129,18 +1098,8 @@ private void updateReservationTestHelper(String path,
String reservationJson = loadJsonFile("update-reservation.json");
- JettisonUnmarshaller reservationUpdateRequestInfoReader;
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(
- ReservationUpdateRequestInfo.class);
- reservationUpdateRequestInfoReader = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
-
- ReservationUpdateRequestInfo rsci = reservationUpdateRequestInfoReader.
- unmarshalFromJSON(new StringReader(reservationJson),
- ReservationUpdateRequestInfo.class);
+ ReservationUpdateRequestInfo rsci =
+ fromJson(reservationJson, ReservationUpdateRequestInfo.class);
if (this.isAuthenticationEnabled()) {
// only works when previous submit worked
@@ -1187,18 +1146,8 @@ private void testDeleteReservationHelper(String path,
String reservationJson = loadJsonFile("delete-reservation.json");
- JettisonUnmarshaller reader;
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(
- ReservationDeleteRequestInfo.class);
- reader = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- throw new RuntimeException(e);
- }
-
- ReservationDeleteRequestInfo rsci = reader.
- unmarshalFromJSON(new StringReader(reservationJson),
- ReservationDeleteRequestInfo.class);
+ ReservationDeleteRequestInfo rsci =
+ fromJson(reservationJson, ReservationDeleteRequestInfo.class);
if (this.isAuthenticationEnabled()) {
// only works when previous submit worked
@@ -1214,7 +1163,6 @@ private void testDeleteReservationHelper(String path,
.accept(media)
.post(Entity.entity(toJson(rsci, ReservationDeleteRequestInfo.class),
MediaType.APPLICATION_JSON_TYPE), Response.class);
-
if (!this.isAuthenticationEnabled()) {
assertResponseStatusCode(Response.Status.UNAUTHORIZED, response.getStatusInfo());
return;
@@ -1244,7 +1192,7 @@ private JSONObject testListReservationHelper(WebTarget target) throws Exception
private JSONObject testListReservationHelper(WebTarget target, Response.Status
status) throws Exception {
Thread.sleep(1000);
- Response response = target.request().get(Response.class);
+ Response response = target.request(MediaType.APPLICATION_JSON_TYPE).get(Response.class);
if (!this.isAuthenticationEnabled()) {
assertResponseStatusCode(Response.Status.UNAUTHORIZED, response.getStatusInfo());
@@ -1264,13 +1212,8 @@ private void verifyReservationCount(int count) throws Exception {
JSONObject json = testListReservationHelper(target);
- if (count == 1) {
- // If there are any number other than one reservation, this will throw.
- json.getJSONObject("reservationListInfo").getJSONObject("reservations");
- } else {
- JSONArray reservations = json.getJSONArray("reservations");
- assertTrue(reservations.length() == count);
- }
+ JSONArray reservations = json.getJSONArray("reservations");
+ assertEquals(reservations.length(), count);
}
private boolean isHttpSuccessResponse(Response response) {
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesSchedulerActivities.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesSchedulerActivities.java
index a027c87fb24..4a4054c0a8c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesSchedulerActivities.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesSchedulerActivities.java
@@ -19,7 +19,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
@@ -32,7 +31,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.activities.ActivityDiagnosticConstant;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.activities.ActivityState;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.reader.NodeLabelsInfoReader;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.junit.jupiter.api.BeforeEach;
@@ -120,8 +119,8 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(NodeLabelsInfoReader.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesSchedulerActivitiesWithMultiNodesEnabled.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesSchedulerActivitiesWithMultiNodesEnabled.java
index a588b527b11..ac9a31fef88 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesSchedulerActivitiesWithMultiNodesEnabled.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesSchedulerActivitiesWithMultiNodesEnabled.java
@@ -18,7 +18,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.apache.hadoop.conf.Configuration;
@@ -42,6 +41,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.NodeUpdateSchedulerEvent;
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.placement.ResourceUsageMultiNodeLookupPolicy;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.resource.Resources;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
@@ -104,7 +104,8 @@ protected Application configure() {
config.register(RMWebServices.class);
config.register(new JerseyBinder());
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestWebServiceUtil.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestWebServiceUtil.java
index 642443b15b2..f3e2a504df6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestWebServiceUtil.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestWebServiceUtil.java
@@ -36,8 +36,9 @@
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import javax.xml.bind.JAXBException;
+import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
@@ -46,6 +47,7 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -53,8 +55,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.SerializationFeature;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonMarshaller;
+import org.eclipse.persistence.jaxb.MarshallerProperties;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
@@ -195,13 +196,7 @@ public static void assertJsonResponse(Response response,
String actual = OBJECT_WRITER.writeValueAsString(jsonNode);
updateTestDataAutomatically(expectedResourceFilename, actual);
- assertEquals(
- // Deserialize/serialise again with the exact same settings
- // to make sure jackson upgrade doesn't break the test
- OBJECT_WRITER.writeValueAsString(
- MAPPER.readTree(
- Objects.requireNonNull(getResourceAsString(expectedResourceFilename)))),
- actual);
+ assertEquals(getResourceAsString(expectedResourceFilename), actual);
}
/**
@@ -350,28 +345,46 @@ public static void restoreSchedulerConfigFileInTarget() {
public static String toEntity(Object obj, Class<?> klass, String mediaType)
throws Exception {
- if (mediaType == MediaType.APPLICATION_JSON) {
+ if (MediaType.APPLICATION_JSON.equals(mediaType)) {
return toJson(obj, klass);
}
- if(mediaType == MediaType.APPLICATION_XML) {
+ if(MediaType.APPLICATION_XML.equals(mediaType)) {
return toXml(obj, klass);
}
return null;
}
public static String toJson(Object obj, Class<?> klass) throws Exception {
+ JAXBContext jc = new JAXBContextResolver().getContext(klass);
+ Marshaller marshaller = jc.createMarshaller();
+ marshaller.setProperty(MarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_JSON);
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
StringWriter stringWriter = new StringWriter();
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(klass);
- JettisonMarshaller jettisonMarshaller = jettisonJaxbContext.createJsonMarshaller();
- jettisonMarshaller.marshallToJSON(obj, stringWriter);
+ marshaller.marshal(obj, stringWriter);
return stringWriter.toString();
}
- public static String toXml(Object obj, Class<?> klass) throws JAXBException {
+ public static String toXml(Object obj, Class<?> klass) throws Exception {
+ JAXBContext jc = new JAXBContextResolver().getContext(klass);
+ Marshaller marshaller = jc.createMarshaller();
+ marshaller.setProperty(MarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_XML);
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
StringWriter stringWriter = new StringWriter();
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(klass);
- Marshaller marshaller = jettisonJaxbContext.createMarshaller();
marshaller.marshal(obj, stringWriter);
return stringWriter.toString();
}
+
+ public static <T> T fromJson(String json, Class<T> klass) {
+ try {
+ JAXBContext jc = new JAXBContextResolver().getContext(klass);
+ if (jc == null) {
+ jc = JAXBContext.newInstance(klass);
+ }
+ Unmarshaller unmarshaller = jc.createUnmarshaller();
+ unmarshaller.setProperty(MarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_JSON);
+ return unmarshaller.unmarshal(new StreamSource(new StringReader(json)), klass).getValue();
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to read from json: " + json, e);
+ }
+ }
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/fairscheduler/TestRMWebServicesFairScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/fairscheduler/TestRMWebServicesFairScheduler.java
index 7535ad260a7..bc7b02caf61 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/fairscheduler/TestRMWebServicesFairScheduler.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/fairscheduler/TestRMWebServicesFairScheduler.java
@@ -19,7 +19,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp.fairscheduler;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.apache.hadoop.conf.Configuration;
@@ -34,6 +33,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.webapp.JAXBContextResolver;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServices;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.TestRMWebServices;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
import org.apache.hadoop.yarn.webapp.JerseyTestBase;
import org.codehaus.jettison.json.JSONArray;
@@ -65,7 +65,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -135,7 +136,7 @@ public void testClusterSchedulerWithSubQueues()
JSONObject json = response.readEntity(JSONObject.class);
JSONArray subQueueInfo = json.getJSONObject("scheduler")
.getJSONObject("schedulerInfo").getJSONObject("rootQueue")
- .getJSONObject("childQueues").getJSONObject("queue")
+ .getJSONObject("childQueues").getJSONArray("queue").getJSONObject(0)
.getJSONObject("childQueues").getJSONArray("queue");
// subQueueInfo is consist of subqueue1 and subqueue2 info
assertEquals(2, subQueueInfo.length());
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/fairscheduler/TestRMWebServicesFairSchedulerCustomResourceTypes.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/fairscheduler/TestRMWebServicesFairSchedulerCustomResourceTypes.java
index 7fecd4b6aac..723dc334c64 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/fairscheduler/TestRMWebServicesFairSchedulerCustomResourceTypes.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/fairscheduler/TestRMWebServicesFairSchedulerCustomResourceTypes.java
@@ -19,7 +19,6 @@
package org.apache.hadoop.yarn.server.resourcemanager.webapp.fairscheduler;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.apache.hadoop.conf.Configuration;
@@ -36,6 +35,7 @@
import org.apache.hadoop.yarn.server.resourcemanager.webapp.helper.BufferedClientResponse;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.helper.JsonCustomResourceTypeTestcase;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.helper.XmlCustomResourceTypeTestCase;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.resource.CustomResourceTypesConfigurationProvider;
import org.apache.hadoop.yarn.util.resource.ResourceUtils;
import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
@@ -77,7 +77,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
@@ -217,11 +218,9 @@ private void verifyJsonResponse(WebTarget path, Response response,
testCase.verify(json -> {
try {
- JSONObject queue = json.getJSONObject("scheduler")
+ JSONArray queues = json.getJSONObject("scheduler")
.getJSONObject("schedulerInfo").getJSONObject("rootQueue")
- .getJSONObject("childQueues").getJSONObject("queue");
- JSONArray queues = new JSONArray();
- queues.put(queue);
+ .getJSONObject("childQueues").getJSONArray("queue");
assertEquals(1, queues.length());
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/helper/AppInfoJsonVerifications.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/helper/AppInfoJsonVerifications.java
index 7bc8f6a0ab3..951336da2d1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/helper/AppInfoJsonVerifications.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/helper/AppInfoJsonVerifications.java
@@ -26,7 +26,6 @@
import static org.apache.hadoop.yarn.webapp.WebServicesTestUtils.checkStringEqual;
import static org.apache.hadoop.yarn.webapp.WebServicesTestUtils.checkStringMatch;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
@@ -88,8 +87,8 @@ public static void verify(JSONObject info, RMApp app) throws JSONException {
"clusterUsagePerc doesn't match");
assertEquals(1, info.getInt("runningContainers"),
"numContainers doesn't match");
- assertNotNull(info.get("preemptedResourceSecondsMap"),
- "preemptedResourceSecondsMap should not be null");
+ assertTrue(info.isNull("preemptedResourceSecondsMap"),
+ "preemptedResourceSecondsMap should be null, cause it is empty");
assertEquals(app.getRMAppMetrics().getResourcePreempted().getMemorySize(),
info.getInt("preemptedResourceMB"), "preemptedResourceMB doesn't match");
assertEquals(app.getRMAppMetrics().getResourcePreempted().getVirtualCores(),
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/AppStateReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/AppStateReader.java
deleted file mode 100644
index 3531fdb8557..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/AppStateReader.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.reader;
-
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppState;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonUnmarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * We have defined a dedicated Reader for AppState,
- * aimed at adapting to the Jersey2 framework
- * to ensure that JSON can be converted into AppState.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class AppStateReader implements MessageBodyReader<AppState> {
-
- private JettisonUnmarshaller jsonUnmarshaller;
-
- public AppStateReader() {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(AppState.class);
- jsonUnmarshaller = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations,
- MediaType mediaType) {
- return type == AppState.class;
- }
-
- @Override
- public AppState readFrom(Class<AppState> type, Type genericType, Annotation[] annotations,
- MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
- throws IOException, WebApplicationException {
- try {
- return jsonUnmarshaller.unmarshalFromJSON(entityStream, AppState.class);
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/ApplicationSubmissionContextInfoReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/ApplicationSubmissionContextInfoReader.java
deleted file mode 100644
index cf94940fe2e..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/ApplicationSubmissionContextInfoReader.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.reader;
-
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ApplicationSubmissionContextInfo;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonUnmarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * We have defined a dedicated Reader for ApplicationSubmissionContextInfo,
- * aimed at adapting to the Jersey2 framework
- * to ensure that JSON can be converted into ApplicationSubmissionContextInfo.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class ApplicationSubmissionContextInfoReader
- implements MessageBodyReader<ApplicationSubmissionContextInfo> {
-
- private JettisonUnmarshaller jsonUnmarshaller;
-
- public ApplicationSubmissionContextInfoReader() {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(
- ApplicationSubmissionContextInfo.class);
- jsonUnmarshaller = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return type == ApplicationSubmissionContextInfo.class;
- }
-
- @Override
- public ApplicationSubmissionContextInfo readFrom(Class<ApplicationSubmissionContextInfo> type,
- Type genericType, Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
- throws IOException, WebApplicationException {
- try {
- return jsonUnmarshaller.unmarshalFromJSON(entityStream,
- ApplicationSubmissionContextInfo.class);
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/LabelsToNodesInfoReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/LabelsToNodesInfoReader.java
deleted file mode 100644
index 7f8373205f8..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/LabelsToNodesInfoReader.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.reader;
-
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LabelsToNodesInfo;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonUnmarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * We have defined a dedicated Reader for LabelsToNodesInfo,
- * aimed at adapting to the Jersey2 framework
- * to ensure that JSON can be converted into LabelsToNodesInfo.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class LabelsToNodesInfoReader implements MessageBodyReader<LabelsToNodesInfo> {
-
- private JettisonUnmarshaller jsonUnmarshaller;
-
- public LabelsToNodesInfoReader() {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(LabelsToNodesInfo.class);
- jsonUnmarshaller = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return type == LabelsToNodesInfo.class;
- }
-
- @Override
- public LabelsToNodesInfo readFrom(Class<LabelsToNodesInfo> type, Type genericType,
- Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
- throws IOException, WebApplicationException {
- try {
- LabelsToNodesInfo labelsToNodesInfo =
- jsonUnmarshaller.unmarshalFromJSON(entityStream, LabelsToNodesInfo.class);
- return labelsToNodesInfo;
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/NodeLabelsInfoReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/NodeLabelsInfoReader.java
deleted file mode 100644
index 71afb95280b..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/NodeLabelsInfoReader.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.reader;
-
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeLabelsInfo;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonUnmarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * We have defined a dedicated Reader for NodeLabelsInfo,
- * aimed at adapting to the Jersey2 framework
- * to ensure that JSON can be converted into NodeLabelsInfo.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class NodeLabelsInfoReader implements MessageBodyReader<NodeLabelsInfo> {
-
- private JettisonUnmarshaller jsonUnmarshaller;
-
- public NodeLabelsInfoReader() {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(NodeLabelsInfo.class);
- jsonUnmarshaller = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return type == NodeLabelsInfo.class;
- }
-
- @Override
- public NodeLabelsInfo readFrom(Class<NodeLabelsInfo> type, Type genericType,
- Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
- throws IOException, WebApplicationException {
- try {
- NodeLabelsInfo nodeLabelsInfo =
- jsonUnmarshaller.unmarshalFromJSON(entityStream, NodeLabelsInfo.class);
- return nodeLabelsInfo;
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/NodeToLabelsInfoReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/NodeToLabelsInfoReader.java
deleted file mode 100644
index d78460f81ee..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/NodeToLabelsInfoReader.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.reader;
-
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeToLabelsInfo;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonUnmarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * We have defined a dedicated Reader for NodeToLabelsInfo,
- * aimed at adapting to the Jersey2 framework
- * to ensure that JSON can be converted into NodeToLabelsInfo.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class NodeToLabelsInfoReader implements MessageBodyReader<NodeToLabelsInfo> {
-
- private JettisonUnmarshaller jsonUnmarshaller;
-
- public NodeToLabelsInfoReader() {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(NodeToLabelsInfo.class);
- jsonUnmarshaller = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isReadable(Class<?> type,
- Type genericType, Annotation[] annotations, MediaType mediaType) {
- return type == NodeToLabelsInfo.class;
- }
-
- @Override
- public NodeToLabelsInfo readFrom(Class<NodeToLabelsInfo> type, Type genericType,
- Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException, WebApplicationException {
- try {
- NodeToLabelsInfo nodeLabelsInfo =
- jsonUnmarshaller.unmarshalFromJSON(entityStream, NodeToLabelsInfo.class);
- return nodeLabelsInfo;
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/ResourceOptionInfoReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/ResourceOptionInfoReader.java
deleted file mode 100644
index 352e266fbf2..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/reader/ResourceOptionInfoReader.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.reader;
-
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceOptionInfo;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonUnmarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * We have defined a dedicated Reader for ResourceOptionInfo,
- * aimed at adapting to the Jersey2 framework
- * to ensure that JSON can be converted into ResourceOptionInfo.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class ResourceOptionInfoReader implements MessageBodyReader<ResourceOptionInfo> {
-
- private JettisonUnmarshaller jsonUnmarshaller;
-
- public ResourceOptionInfoReader() {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(ResourceOptionInfo.class);
- jsonUnmarshaller = jettisonJaxbContext.createJsonUnmarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return type == ResourceOptionInfo.class;
- }
-
- @Override
- public ResourceOptionInfo readFrom(Class<ResourceOptionInfo> type, Type genericType,
- Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
- throws IOException, WebApplicationException {
- try {
- ResourceOptionInfo resourceOptionInfo =
- jsonUnmarshaller.unmarshalFromJSON(entityStream, ResourceOptionInfo.class);
- return resourceOptionInfo;
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/ApplicationSubmissionContextInfoWriter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/ApplicationSubmissionContextInfoWriter.java
deleted file mode 100644
index ace28592b28..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/ApplicationSubmissionContextInfoWriter.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.writer;
-
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ApplicationSubmissionContextInfo;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonMarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.nio.charset.StandardCharsets;
-
-/**
- * We have defined a dedicated Writer for ApplicationSubmissionContextInfo,
- * aimed at adapting to the Jersey2 framework to ensure
- * that ApplicationSubmissionContextInfo can be converted into JSON format.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class ApplicationSubmissionContextInfoWriter
- implements MessageBodyWriter<ApplicationSubmissionContextInfo> {
-
- private JettisonMarshaller jettisonMarshaller;
- private Marshaller marshaller;
-
- public ApplicationSubmissionContextInfoWriter() {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(
- ApplicationSubmissionContextInfo.class);
- jettisonMarshaller = jettisonJaxbContext.createJsonMarshaller();
- marshaller = jettisonJaxbContext.createMarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return type == ApplicationSubmissionContextInfo.class;
- }
-
- @Override
- public void writeTo(ApplicationSubmissionContextInfo applicationSubmissionContextInfo,
- Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
- throws IOException, WebApplicationException {
- StringWriter stringWriter = new StringWriter();
- try {
- if (mediaType.toString().equals(MediaType.APPLICATION_JSON)) {
- jettisonMarshaller.marshallToJSON(applicationSubmissionContextInfo, stringWriter);
- entityStream.write(stringWriter.toString().getBytes(StandardCharsets.UTF_8));
- }
-
- if (mediaType.toString().equals(MediaType.APPLICATION_XML)) {
- marshaller.marshal(applicationSubmissionContextInfo, stringWriter);
- entityStream.write(stringWriter.toString().getBytes(StandardCharsets.UTF_8));
- }
-
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/ResourceOptionInfoWriter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/ResourceOptionInfoWriter.java
deleted file mode 100644
index 4cfe6a5777e..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/ResourceOptionInfoWriter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.writer;
-
-import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ResourceOptionInfo;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonMarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.nio.charset.StandardCharsets;
-
-/**
- * We have defined a dedicated Writer for ResourceOptionInfo,
- * aimed at adapting to the Jersey2 framework to ensure
- * that ResourceOptionInfo can be converted into JSON format.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class ResourceOptionInfoWriter implements MessageBodyWriter<ResourceOptionInfo> {
-
- private JettisonMarshaller jettisonMarshaller;
- private Marshaller marshaller;
-
- public ResourceOptionInfoWriter() {
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(
- ResourceOptionInfo.class);
- jettisonMarshaller = jettisonJaxbContext.createJsonMarshaller();
- marshaller = jettisonJaxbContext.createMarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return type == ResourceOptionInfo.class;
- }
-
- @Override
- public void writeTo(ResourceOptionInfo resourceOptionInfo, Class<?> type,
- Type genericType, Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException, WebApplicationException {
- StringWriter stringWriter = new StringWriter();
- try {
- if (mediaType.toString().equals(MediaType.APPLICATION_JSON)) {
- jettisonMarshaller.marshallToJSON(resourceOptionInfo, stringWriter);
- entityStream.write(stringWriter.toString().getBytes(StandardCharsets.UTF_8));
- }
-
- if (mediaType.toString().equals(MediaType.APPLICATION_XML)) {
- marshaller.marshal(resourceOptionInfo, stringWriter);
- entityStream.write(stringWriter.toString().getBytes(StandardCharsets.UTF_8));
- }
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/SchedConfUpdateInfoWriter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/SchedConfUpdateInfoWriter.java
deleted file mode 100644
index 4863c37a34a..00000000000
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/writer/SchedConfUpdateInfoWriter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.yarn.server.resourcemanager.webapp.writer;
-
-import org.apache.hadoop.yarn.webapp.dao.SchedConfUpdateInfo;
-import org.glassfish.jersey.jettison.JettisonJaxbContext;
-import org.glassfish.jersey.jettison.JettisonMarshaller;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.nio.charset.StandardCharsets;
-
-/**
- * We have defined a dedicated Writer for SchedConfUpdateInfo,
- * aimed at adapting to the Jersey2 framework to ensure
- * that SchedConfUpdateInfo can be converted into JSON format.
- */
-@Provider
-@Consumes(MediaType.APPLICATION_JSON)
-public class SchedConfUpdateInfoWriter implements MessageBodyWriter<SchedConfUpdateInfo> {
-
- private JettisonMarshaller jettisonMarshaller;
- private Marshaller marshaller;
-
- public SchedConfUpdateInfoWriter(){
- try {
- JettisonJaxbContext jettisonJaxbContext = new JettisonJaxbContext(
- SchedConfUpdateInfo.class);
- jettisonMarshaller = jettisonJaxbContext.createJsonMarshaller();
- marshaller = jettisonJaxbContext.createMarshaller();
- } catch (JAXBException e) {
- }
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return type == SchedConfUpdateInfo.class;
- }
-
- @Override
- public void writeTo(SchedConfUpdateInfo schedConfUpdateInfo, Class<?> type,
- Type genericType, Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
- throws IOException, WebApplicationException {
- StringWriter stringWriter = new StringWriter();
- try {
- if (mediaType.toString().equals(MediaType.APPLICATION_JSON)) {
- jettisonMarshaller.marshallToJSON(schedConfUpdateInfo, stringWriter);
- entityStream.write(stringWriter.toString().getBytes(StandardCharsets.UTF_8));
- }
-
- if (mediaType.toString().equals(MediaType.APPLICATION_XML)) {
- marshaller.marshal(schedConfUpdateInfo, stringWriter);
- entityStream.write(stringWriter.toString().getBytes(StandardCharsets.UTF_8));
- }
- } catch (JAXBException e) {
- throw new IOException(e);
- }
- }
-}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/webapp/TestRMWithCSRFFilter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/webapp/TestRMWithCSRFFilter.java
index ef17057e89e..142cd12eea0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/webapp/TestRMWithCSRFFilter.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/webapp/TestRMWithCSRFFilter.java
@@ -31,9 +31,9 @@
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.JAXBContextResolver;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServices;
+import org.apache.hadoop.yarn.server.resourcemanager.webapp.jsonprovider.JsonProviderFeature;
import org.apache.hadoop.yarn.util.YarnVersionInfo;
import org.glassfish.jersey.internal.inject.AbstractBinder;
-import org.glassfish.jersey.jettison.JettisonFeature;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.TestProperties;
import org.junit.jupiter.api.BeforeEach;
@@ -74,7 +74,8 @@ protected Application configure() {
config.register(new JerseyBinder());
config.register(RMWebServices.class);
config.register(GenericExceptionHandler.class);
- config.register(new JettisonFeature()).register(JAXBContextResolver.class);
+ config.register(JsonProviderFeature.class);
+ config.register(JAXBContextResolver.class);
forceSet(TestProperties.CONTAINER_PORT, JERSEY_RANDOM_PORT);
return config;
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-after-update.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-after-update.json
index 8c2f22446d5..7444be0c81b 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-after-update.json
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-after-update.json
@@ -1,12 +1,12 @@
{
"scheduler" : {
"schedulerInfo" : {
- "@xsi.type" : "capacityScheduler",
- "capacity" : 100,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "type" : "capacityScheduler",
+ "capacity" : 100.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=100.0%,vcores=100.0%]",
"capacityVectorEntries" : [ {
@@ -25,13 +25,13 @@
"queue" : [ {
"queuePath" : "root.a",
"capacity" : 12.5,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 12.5,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "a",
@@ -39,16 +39,16 @@
"state" : "RUNNING",
"queues" : {
"queue" : [ {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.a.b",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "b",
@@ -59,7 +59,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -67,7 +66,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -78,38 +76,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=0.0,vcores=0.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
} ]
},
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -117,7 +114,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -132,7 +128,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -140,7 +135,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -155,7 +149,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -163,7 +156,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -178,7 +170,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -186,7 +177,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -196,17 +186,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -214,7 +203,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -229,7 +217,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -237,7 +224,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -252,7 +238,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -260,7 +245,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -275,7 +259,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -283,7 +266,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -298,7 +280,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -306,7 +287,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -321,7 +301,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -329,7 +308,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -339,14 +317,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -354,7 +331,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -369,7 +345,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -377,7 +352,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -392,7 +366,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -400,7 +373,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -425,29 +397,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 0,
"maxApplicationsPerUser" : 0,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -455,7 +426,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -470,7 +440,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -478,7 +447,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -493,7 +461,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -501,7 +468,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -518,16 +484,16 @@
"maxApplicationLifetime" : -1,
"defaultApplicationLifetime" : -1
}, {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.a.c",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "c",
@@ -538,7 +504,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -546,7 +511,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -557,38 +521,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=0.0,vcores=0.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
} ]
},
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -596,7 +559,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -611,7 +573,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -619,7 +580,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -634,7 +594,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -642,7 +601,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -657,7 +615,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -665,7 +622,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -675,17 +631,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -693,7 +648,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -708,7 +662,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -716,7 +669,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -731,7 +683,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -739,7 +690,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -754,7 +704,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -762,7 +711,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -777,7 +725,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -785,7 +732,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -800,7 +746,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -808,7 +753,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -818,14 +762,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -833,7 +776,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -848,7 +790,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -856,7 +797,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -871,7 +811,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -879,7 +818,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -904,29 +842,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 0,
"maxApplicationsPerUser" : 0,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -934,7 +871,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -949,7 +885,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -957,7 +892,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -972,7 +906,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -980,7 +913,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1003,7 +935,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1011,7 +942,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1022,38 +952,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=4096.0,vcores=4.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 4096
+ "resourceValue" : "4096.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 4
+ "resourceValue" : "4.0"
} ]
},
"capacity" : 12.5,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 12.5,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 4096,
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1061,7 +990,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1076,7 +1004,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1084,7 +1011,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1099,7 +1025,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1107,7 +1032,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1122,7 +1046,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1130,7 +1053,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1140,17 +1062,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1158,7 +1079,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1173,7 +1093,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1181,7 +1100,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1196,7 +1114,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1204,7 +1121,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1214,14 +1130,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 4096,
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1229,7 +1144,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1244,7 +1158,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1252,7 +1165,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1267,7 +1179,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1275,7 +1186,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1300,25 +1210,25 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "utilization",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "parent",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : ""
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { }
}, {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.default",
"capacity" : 3.125,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 3.125,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "default",
@@ -1329,7 +1239,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1337,7 +1246,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1348,38 +1256,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=1024.0,vcores=1.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 1024
+ "resourceValue" : "1024.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 1
+ "resourceValue" : "1.0"
} ]
},
"capacity" : 3.125,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 3.125,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 1024,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1387,7 +1294,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1402,7 +1308,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -1410,7 +1315,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -1425,7 +1329,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1433,7 +1336,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1448,7 +1350,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1456,7 +1357,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1466,17 +1366,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1484,7 +1383,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1499,7 +1397,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1507,7 +1404,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1522,7 +1418,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1530,7 +1425,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1545,7 +1439,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1553,7 +1446,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1568,7 +1460,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1576,7 +1467,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1591,7 +1481,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1599,7 +1488,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1609,14 +1497,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 1024,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1624,7 +1511,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1639,7 +1525,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1647,7 +1532,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1662,7 +1546,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1670,7 +1553,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1695,29 +1577,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 312,
"maxApplicationsPerUser" : 312,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1725,7 +1606,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1740,7 +1620,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1748,7 +1627,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1763,7 +1641,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1771,7 +1648,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1790,7 +1666,7 @@
} ]
},
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=100.0%,vcores=100.0%]",
@@ -1802,21 +1678,20 @@
"resourceValue" : "100.0%"
} ]
},
- "capacity" : 100,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 100.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 32768,
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1824,7 +1699,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1839,7 +1713,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -1847,7 +1720,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -1862,7 +1734,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1870,7 +1741,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1885,7 +1755,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1893,7 +1762,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1903,7 +1771,7 @@
} ]
}
}
- }
+ } ]
},
"health" : {
"lastrun" : 0,
@@ -1936,7 +1804,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1944,7 +1811,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1962,7 +1828,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1970,7 +1835,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1988,7 +1852,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1996,7 +1859,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -2013,7 +1875,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -2021,7 +1882,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -2049,9 +1909,9 @@
"queueType" : "parent",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : ""
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { }
}
}
}
\ No newline at end of file
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-before-update.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-before-update.json
index 36f16241f67..2e9bf9d9fee 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-before-update.json
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-before-update.json
@@ -1,12 +1,12 @@
{
"scheduler" : {
"schedulerInfo" : {
- "@xsi.type" : "capacityScheduler",
- "capacity" : 100,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "type" : "capacityScheduler",
+ "capacity" : 100.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=100.0%,vcores=100.0%]",
"capacityVectorEntries" : [ {
@@ -24,14 +24,14 @@
"queues" : {
"queue" : [ {
"queuePath" : "root.a",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "a",
@@ -39,16 +39,16 @@
"state" : "RUNNING",
"queues" : {
"queue" : [ {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.a.b",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "b",
@@ -59,7 +59,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -67,7 +66,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -78,38 +76,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=0.0,vcores=0.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
} ]
},
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -117,7 +114,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -132,7 +128,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -140,7 +135,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -155,7 +149,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -163,7 +156,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -178,7 +170,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -186,7 +177,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -196,17 +186,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -214,7 +203,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -229,7 +217,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -237,7 +224,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -252,7 +238,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -260,7 +245,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -275,7 +259,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -283,7 +266,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -298,7 +280,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -306,7 +287,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -321,7 +301,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -329,7 +308,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -339,14 +317,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -354,7 +331,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -369,7 +345,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -377,7 +352,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -392,7 +366,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -400,7 +373,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -425,29 +397,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 0,
"maxApplicationsPerUser" : 0,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -455,7 +426,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -470,7 +440,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -478,7 +447,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -493,7 +461,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -501,7 +468,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -518,16 +484,16 @@
"maxApplicationLifetime" : -1,
"defaultApplicationLifetime" : -1
}, {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.a.c",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "c",
@@ -538,7 +504,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -546,7 +511,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -557,38 +521,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=0.0,vcores=0.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
} ]
},
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -596,7 +559,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -611,7 +573,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -619,7 +580,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -634,7 +594,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -642,7 +601,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -657,7 +615,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -665,7 +622,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -675,17 +631,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -693,7 +648,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -708,7 +662,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -716,7 +669,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -731,7 +683,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -739,7 +690,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -754,7 +704,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -762,7 +711,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -777,7 +725,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -785,7 +732,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -800,7 +746,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -808,7 +753,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -818,14 +762,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -833,7 +776,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -848,7 +790,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -856,7 +797,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -871,7 +811,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -879,7 +818,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -904,29 +842,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 0,
"maxApplicationsPerUser" : 0,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -934,7 +871,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -949,7 +885,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -957,7 +892,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -972,7 +906,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -980,7 +913,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1003,7 +935,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1011,7 +942,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1022,38 +952,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=0.0,vcores=0.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
} ]
},
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -1061,7 +990,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -1076,7 +1004,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -1084,7 +1011,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -1099,7 +1025,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1107,7 +1032,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1122,7 +1046,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1130,7 +1053,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1140,17 +1062,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1158,7 +1079,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1173,7 +1093,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1181,7 +1100,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1196,7 +1114,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1204,7 +1121,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1214,14 +1130,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1229,7 +1144,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1244,7 +1158,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1252,7 +1165,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1267,7 +1179,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1275,7 +1186,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1300,25 +1210,25 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "utilization",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "parent",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : ""
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { }
}, {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.default",
"capacity" : 3.125,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 3.125,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "default",
@@ -1329,7 +1239,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1337,7 +1246,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1348,38 +1256,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=1024.0,vcores=1.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 1024
+ "resourceValue" : "1024.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 1
+ "resourceValue" : "1.0"
} ]
},
"capacity" : 3.125,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 3.125,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 1024,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1387,7 +1294,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1402,7 +1308,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -1410,7 +1315,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -1425,7 +1329,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1433,7 +1336,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1448,7 +1350,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1456,7 +1357,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1466,17 +1366,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1484,7 +1383,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1499,7 +1397,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1507,7 +1404,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1522,7 +1418,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1530,7 +1425,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1545,7 +1439,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1553,7 +1446,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1568,7 +1460,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1576,7 +1467,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1591,7 +1481,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1599,7 +1488,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1609,14 +1497,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 1024,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1624,7 +1511,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1639,7 +1525,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1647,7 +1532,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1662,7 +1546,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1670,7 +1553,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1695,29 +1577,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 312,
"maxApplicationsPerUser" : 312,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1725,7 +1606,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1740,7 +1620,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1748,7 +1627,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1763,7 +1641,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1771,7 +1648,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1790,7 +1666,7 @@
} ]
},
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=100.0%,vcores=100.0%]",
@@ -1802,21 +1678,20 @@
"resourceValue" : "100.0%"
} ]
},
- "capacity" : 100,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 100.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 32768,
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1824,7 +1699,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1839,7 +1713,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -1847,7 +1720,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -1862,7 +1734,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1870,7 +1741,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1885,7 +1755,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1893,7 +1762,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1903,7 +1771,7 @@
} ]
}
}
- }
+ } ]
},
"health" : {
"lastrun" : 0,
@@ -1936,7 +1804,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1944,7 +1811,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1962,7 +1828,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1970,7 +1835,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1988,7 +1852,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1996,7 +1859,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -2013,7 +1875,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -2021,7 +1882,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -2049,9 +1909,9 @@
"queueType" : "parent",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : ""
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { }
}
}
}
\ No newline at end of file
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-legacy-after-update.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-legacy-after-update.json
index bcfd64ca9e1..fbb205aad88 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-legacy-after-update.json
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-legacy-after-update.json
@@ -1,12 +1,12 @@
{
"scheduler" : {
"schedulerInfo" : {
- "@xsi.type" : "capacityScheduler",
- "capacity" : 100,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "type" : "capacityScheduler",
+ "capacity" : 100.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=100.0%,vcores=100.0%]",
"capacityVectorEntries" : [ {
@@ -25,13 +25,13 @@
"queue" : [ {
"queuePath" : "root.a",
"capacity" : 12.5,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 12.5,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "a",
@@ -39,16 +39,16 @@
"state" : "RUNNING",
"queues" : {
"queue" : [ {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.a.b",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "b",
@@ -59,7 +59,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -67,7 +66,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -78,38 +76,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=0.0,vcores=0.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
} ]
},
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -117,7 +114,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -132,7 +128,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -140,7 +135,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -155,7 +149,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -163,7 +156,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -178,7 +170,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -186,7 +177,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -196,17 +186,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -214,7 +203,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -229,7 +217,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -237,7 +224,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -252,7 +238,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -260,7 +245,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -275,7 +259,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -283,7 +266,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -298,7 +280,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -306,7 +287,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -321,7 +301,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -329,7 +308,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -339,14 +317,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -354,7 +331,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -369,7 +345,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -377,7 +352,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -392,7 +366,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -400,7 +373,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -425,29 +397,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 0,
"maxApplicationsPerUser" : 0,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -455,7 +426,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -470,7 +440,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -478,7 +447,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -493,7 +461,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -501,7 +468,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -518,16 +484,16 @@
"maxApplicationLifetime" : -1,
"defaultApplicationLifetime" : -1
}, {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.a.c",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "c",
@@ -538,7 +504,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -546,7 +511,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -557,38 +521,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=0.0,vcores=0.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
} ]
},
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -596,7 +559,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -611,7 +573,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -619,7 +580,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -634,7 +594,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -642,7 +601,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -657,7 +615,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -665,7 +622,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -675,17 +631,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -693,7 +648,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -708,7 +662,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -716,7 +669,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -731,7 +683,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -739,7 +690,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -754,7 +704,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -762,7 +711,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -777,7 +725,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -785,7 +732,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -800,7 +746,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -808,7 +753,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -818,14 +762,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -833,7 +776,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -848,7 +790,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -856,7 +797,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -871,7 +811,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -879,7 +818,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -904,29 +842,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 0,
"maxApplicationsPerUser" : 0,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -934,7 +871,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -949,7 +885,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -957,7 +892,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -972,7 +906,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -980,7 +913,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1003,7 +935,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1011,7 +942,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1022,38 +952,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=4096.0,vcores=4.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 4096
+ "resourceValue" : "4096.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 4
+ "resourceValue" : "4.0"
} ]
},
"capacity" : 12.5,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 12.5,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 4096,
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1061,7 +990,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1076,7 +1004,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1084,7 +1011,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1099,7 +1025,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1107,7 +1032,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1122,7 +1046,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1130,7 +1053,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1140,17 +1062,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1158,7 +1079,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1173,7 +1093,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1181,7 +1100,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1196,7 +1114,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1204,7 +1121,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1214,14 +1130,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 4096,
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1229,7 +1144,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1244,7 +1158,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1252,7 +1165,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1267,7 +1179,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1275,7 +1186,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1300,25 +1210,25 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "utilization",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "parent",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : ""
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { }
}, {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.default",
"capacity" : 3.125,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 3.125,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "default",
@@ -1329,7 +1239,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1337,7 +1246,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1348,38 +1256,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=1024.0,vcores=1.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 1024
+ "resourceValue" : "1024.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 1
+ "resourceValue" : "1.0"
} ]
},
"capacity" : 3.125,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
"absoluteCapacity" : 3.125,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 1024,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1387,7 +1294,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1402,7 +1308,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -1410,7 +1315,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -1425,7 +1329,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1433,7 +1336,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1448,7 +1350,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1456,7 +1357,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1466,17 +1366,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1484,7 +1383,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1499,7 +1397,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1507,7 +1404,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1522,7 +1418,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1530,7 +1425,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1545,7 +1439,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1553,7 +1446,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1568,7 +1460,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1576,7 +1467,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1591,7 +1481,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1599,7 +1488,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1609,14 +1497,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 1024,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1624,7 +1511,6 @@
"units" : "Mi",
"value" : 1024
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1639,7 +1525,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1647,7 +1532,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1662,7 +1546,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1670,7 +1553,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1695,29 +1577,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 312,
"maxApplicationsPerUser" : 312,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1725,7 +1606,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1740,7 +1620,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1748,7 +1627,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1763,7 +1641,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1771,7 +1648,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1790,7 +1666,7 @@
} ]
},
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=100.0%,vcores=100.0%]",
@@ -1802,21 +1678,20 @@
"resourceValue" : "100.0%"
} ]
},
- "capacity" : 100,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 100.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 32768,
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1824,7 +1699,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1839,7 +1713,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -1847,7 +1720,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -1862,7 +1734,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1870,7 +1741,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1885,7 +1755,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1893,7 +1762,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1903,7 +1771,7 @@
} ]
}
}
- }
+ } ]
},
"health" : {
"lastrun" : 0,
@@ -1936,7 +1804,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1944,7 +1811,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1962,7 +1828,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1970,7 +1835,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -1988,7 +1852,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -1996,7 +1859,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -2013,7 +1875,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -2021,7 +1882,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -2049,9 +1909,9 @@
"queueType" : "parent",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : ""
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { }
}
}
}
\ No newline at end of file
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-legacy-before-update.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-legacy-before-update.json
index b58ba19e6c6..0e597b84b3e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-legacy-before-update.json
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/resources/webapp/configmutation-absolute-hierarchy-legacy-before-update.json
@@ -1,12 +1,12 @@
{
"scheduler" : {
"schedulerInfo" : {
- "@xsi.type" : "capacityScheduler",
- "capacity" : 100,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "type" : "capacityScheduler",
+ "capacity" : 100.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=100.0%,vcores=100.0%]",
"capacityVectorEntries" : [ {
@@ -24,14 +24,14 @@
"queues" : {
"queue" : [ {
"queuePath" : "root.a",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "a",
@@ -39,16 +39,16 @@
"state" : "RUNNING",
"queues" : {
"queue" : [ {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.a.b",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "b",
@@ -59,7 +59,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -67,7 +66,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -78,38 +76,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
- "queueCapacitiesByPartition" : {
+ "queueCapacitiesByPartition" : [ {
"partitionName" : "",
"queueCapacityVectorInfo" : {
"configuredCapacityVector" : "[memory-mb=0.0,vcores=0.0]",
"capacityVectorEntries" : [ {
"resourceName" : "memory-mb",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
}, {
"resourceName" : "vcores",
- "resourceValue" : 0
+ "resourceValue" : "0.0"
} ]
},
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteUsedCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "maxAMLimitPercentage" : 10,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteUsedCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "maxAMLimitPercentage" : 10.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"configuredMinResource" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -117,7 +114,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -132,7 +128,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 8192,
"minimumAllocation" : 1024,
"name" : "memory-mb",
@@ -140,7 +135,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 4,
"minimumAllocation" : 1,
"name" : "vcores",
@@ -155,7 +149,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -163,7 +156,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -178,7 +170,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -186,7 +177,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -196,17 +186,16 @@
} ]
}
}
- }
+ } ]
},
"resources" : {
- "resourceUsagesByPartition" : {
+ "resourceUsagesByPartition" : [ {
"partitionName" : "",
"used" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -214,7 +203,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -229,7 +217,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -237,7 +224,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -252,7 +238,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -260,7 +245,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -275,7 +259,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -283,7 +266,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -298,7 +280,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -306,7 +287,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -321,7 +301,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -329,7 +308,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -339,14 +317,13 @@
} ]
}
}
- }
+ } ]
},
"minEffectiveCapacity" : {
"memory" : 0,
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -354,7 +331,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -369,7 +345,6 @@
"vCores" : 32,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -377,7 +352,6 @@
"units" : "Mi",
"value" : 32768
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -392,7 +366,6 @@
"vCores" : 4,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -400,7 +373,6 @@
"units" : "Mi",
"value" : 8192
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -425,29 +397,28 @@
"queuePriority" : 0,
"orderingPolicyInfo" : "fifo",
"autoCreateChildQueueEnabled" : false,
- "leafQueueTemplate" : "",
+ "leafQueueTemplate" : { },
"mode" : "absolute",
"queueType" : "leaf",
"creationMethod" : "static",
"autoCreationEligibility" : "off",
- "autoQueueTemplateProperties" : "",
- "autoQueueParentTemplateProperties" : "",
- "autoQueueLeafTemplateProperties" : "",
+ "autoQueueTemplateProperties" : { },
+ "autoQueueParentTemplateProperties" : { },
+ "autoQueueLeafTemplateProperties" : { },
"numActiveApplications" : 0,
"numPendingApplications" : 0,
"numContainers" : 0,
"maxApplications" : 0,
"maxApplicationsPerUser" : 0,
- "userLimit" : 100,
- "users" : "",
- "userLimitFactor" : 1,
+ "userLimit" : 100.0,
+ "users" : { },
+ "userLimitFactor" : 1.0,
"configuredMaxAMResourceLimit" : 0.1,
"AMResourceLimit" : {
"memory" : 4096,
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -455,7 +426,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -470,7 +440,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -478,7 +447,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -493,7 +461,6 @@
"vCores" : 1,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -501,7 +468,6 @@
"units" : "Mi",
"value" : 4096
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -518,16 +484,16 @@
"maxApplicationLifetime" : -1,
"defaultApplicationLifetime" : -1
}, {
- "@xsi.type" : "capacitySchedulerLeafQueueInfo",
+ "type" : "capacitySchedulerLeafQueueInfo",
"queuePath" : "root.a.c",
- "capacity" : 0,
- "usedCapacity" : 0,
- "maxCapacity" : 100,
- "absoluteCapacity" : 0,
- "absoluteMaxCapacity" : 100,
- "absoluteUsedCapacity" : 0,
- "weight" : -1,
- "normalizedWeight" : 0,
+ "capacity" : 0.0,
+ "usedCapacity" : 0.0,
+ "maxCapacity" : 100.0,
+ "absoluteCapacity" : 0.0,
+ "absoluteMaxCapacity" : 100.0,
+ "absoluteUsedCapacity" : 0.0,
+ "weight" : -1.0,
+ "normalizedWeight" : 0.0,
"numApplications" : 0,
"maxParallelApps" : 2147483647,
"queueName" : "c",
@@ -538,7 +504,6 @@
"vCores" : 0,
"resourceInformations" : {
"resourceInformation" : [ {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "memory-mb",
@@ -546,7 +511,6 @@
"units" : "Mi",
"value" : 0
}, {
- "attributes" : "",
"maximumAllocation" : 9223372036854775807,
"minimumAllocation" : 0,
"name" : "vcores",
@@ -557,38 +521,37 @@
}
},
"hideReservationQueues" : false,
- "nodeLabels" : "*",
+ "nodeLabels" : [ "*" ],
"allocatedContainers" : 0,
"reservedContainers" : 0,
"pendingContainers" : 0,
"capacities" : {
... 93477 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org