Repository: hadoop
Updated Branches:
  refs/heads/trunk 543f3abbe -> c97d5bceb


YARN-7909. Add charset to YARN Service REST API. (Contributed by Eric Yang)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c97d5bce
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c97d5bce
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c97d5bce

Branch: refs/heads/trunk
Commit: c97d5bceb2305e02f9e8b6c2c10a2aba7fdc652b
Parents: 543f3ab
Author: Eric Yang <ey...@apache.org>
Authored: Fri Feb 9 20:01:25 2018 -0500
Committer: Eric Yang <ey...@apache.org>
Committed: Fri Feb 9 20:01:25 2018 -0500

----------------------------------------------------------------------
 .../apache/hadoop/yarn/service/webapp/ApiServer.java   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c97d5bce/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
index 16f8513..e58938e 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/webapp/ApiServer.java
@@ -94,7 +94,7 @@ public class ApiServer {
   @GET
   @Path(VERSION)
   @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON })
+  @Produces({ MediaType.APPLICATION_JSON + ";charset=utf-8" })
   public Response getVersion() {
     String version = VersionInfo.getBuildVersion();
     LOG.info(version);
@@ -104,7 +104,7 @@ public class ApiServer {
   @POST
   @Path(SERVICE_ROOT_PATH)
   @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON })
+  @Produces({ MediaType.APPLICATION_JSON + ";charset=utf-8" })
   public Response createService(@Context HttpServletRequest request,
       Service service) {
     ServiceStatus serviceStatus = new ServiceStatus();
@@ -167,7 +167,7 @@ public class ApiServer {
   @GET
   @Path(SERVICE_PATH)
   @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON })
+  @Produces({ MediaType.APPLICATION_JSON + ";charset=utf-8" })
   public Response getService(@Context HttpServletRequest request,
       @PathParam(SERVICE_NAME) String appName) {
     ServiceStatus serviceStatus = new ServiceStatus();
@@ -210,7 +210,7 @@ public class ApiServer {
   @DELETE
   @Path(SERVICE_PATH)
   @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON })
+  @Produces({ MediaType.APPLICATION_JSON + ";charset=utf-8" })
   public Response deleteService(@Context HttpServletRequest request,
       @PathParam(SERVICE_NAME) String appName) {
     try {
@@ -273,7 +273,8 @@ public class ApiServer {
   @PUT
   @Path(COMPONENT_PATH)
   @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN  })
+  @Produces({ MediaType.APPLICATION_JSON + ";charset=utf-8",
+              MediaType.TEXT_PLAIN  })
   public Response updateComponent(@Context HttpServletRequest request,
       @PathParam(SERVICE_NAME) String appName,
       @PathParam(COMPONENT_NAME) String componentName, Component component) {
@@ -322,7 +323,7 @@ public class ApiServer {
   @PUT
   @Path(SERVICE_PATH)
   @Consumes({ MediaType.APPLICATION_JSON })
-  @Produces({ MediaType.APPLICATION_JSON })
+  @Produces({ MediaType.APPLICATION_JSON + ";charset=utf-8" })
   public Response updateService(@Context HttpServletRequest request,
       @PathParam(SERVICE_NAME) String appName,
       Service updateServiceData) {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to