Pārlūkot izejas kodu

AMBARI-18178. yarn capacity scheduler queue issue. (Akhil PB via gauravn7)

Gaurav Nagar 9 gadi atpakaļ
vecāks
revīzija
f556e0e4f6

+ 4 - 4
contrib/views/capacity-scheduler/src/main/java/org/apache/ambari/view/capacityscheduler/ConfigurationService.java

@@ -390,10 +390,10 @@ public class ConfigurationService {
    * @return the http response
    * @return the http response
    */
    */
   @PUT
   @PUT
-  @Consumes(MediaType.APPLICATION_JSON)
+  @Consumes(MediaType.TEXT_PLAIN)
   @Produces(MediaType.APPLICATION_JSON)
   @Produces(MediaType.APPLICATION_JSON)
-  public Response writeConfiguration(JSONObject request) {
-    LOG.debug("writeConfiguration for request : {} ", request);
+  public Response writeConfiguration(String requestBody) {
+    LOG.debug("writeConfiguration for request : {} ", requestBody);
     JSONObject response;
     JSONObject response;
     try {
     try {
 
 
@@ -404,7 +404,7 @@ public class ConfigurationService {
 
 
       Map<String, String> headers = new HashMap<String, String>();
       Map<String, String> headers = new HashMap<String, String>();
       headers.put("Content-Type", "application/x-www-form-urlencoded");
       headers.put("Content-Type", "application/x-www-form-urlencoded");
-      String responseString = ambariApi.requestClusterAPI("", "PUT", request.toJSONString(), headers);
+      String responseString = ambariApi.requestClusterAPI("", "PUT",requestBody, headers);
       response = getJsonObject(responseString);
       response = getJsonObject(responseString);
 
 
     } catch (WebApplicationException ex) {
     } catch (WebApplicationException ex) {

+ 1 - 1
contrib/views/capacity-scheduler/src/main/resources/ui/app/adapters.js

@@ -158,7 +158,7 @@ App.QueueAdapter = DS.Adapter.extend({
     });
     });
 
 
     return new Ember.RSVP.Promise(function(resolve, reject) {
     return new Ember.RSVP.Promise(function(resolve, reject) {
-      _ajax(uri,'PUT',{contentType:'application/json; charset=utf-8',data:data}).then(function(data) {
+      _ajax(uri,'PUT',{contentType:'text/plain; charset=utf-8',data:data}).then(function(data) {
         store.setProperties({'current_tag':new_tag,'tag':new_tag});
         store.setProperties({'current_tag':new_tag,'tag':new_tag});
         Ember.run(null, resolve, data.resources.objectAt(0).configurations.objectAt(0).configs);
         Ember.run(null, resolve, data.resources.objectAt(0).configurations.objectAt(0).configs);
       }, function(jqXHR) {
       }, function(jqXHR) {