falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject falcon git commit: Revert "FALCON-1317 Inconsistent JSON serialization. Contributed by Ajay Yadava"
Date Thu, 23 Jul 2015 12:46:58 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 0ff87bce8 -> 952a9e6c3


Revert "FALCON-1317 Inconsistent JSON serialization. Contributed by Ajay Yadava"

This reverts commit 0ff87bce85e1be6c36b18b7a435e5c30dbda6c90.


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

Branch: refs/heads/master
Commit: 952a9e6c37b0eb035efbfb43ed73c75951bbaab4
Parents: 0ff87bc
Author: Ajay Yadava <ajaynsit@gmail.com>
Authored: Thu Jul 23 18:16:05 2015 +0530
Committer: Ajay Yadava <ajaynsit@gmail.com>
Committed: Thu Jul 23 18:16:05 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 -
 hadoop-dependencies/pom.xml                     | 14 -------
 pom.xml                                         |  4 +-
 .../resource/provider/JAXBContextResolver.java  | 44 ++++++++++++++------
 prism/src/main/webapp/WEB-INF/web.xml           |  5 ---
 .../src/main/webapp/WEB-INF/distributed/web.xml |  4 --
 webapp/src/main/webapp/WEB-INF/embedded/web.xml |  4 --
 7 files changed, 34 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/952a9e6c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 58a26ae..0c8e31a 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,8 +9,6 @@ Trunk (Unreleased)
     FALCON-796 Enable users to triage data processing issues through falcon (Ajay Yadava)
     
   IMPROVEMENTS
-    FALCON-1317 Inconsistent JSON serialization(Ajay Yadava)
-
     FALCON-1320 Adding equals() and hashCode() method in LineageGraphResult.Edge(Pragya Mittal
via Ajay Yadava)
 
     FALCON-1139 Validation issues in Falcon UI(Pallavi Rao via Ajay Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/952a9e6c/hadoop-dependencies/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-dependencies/pom.xml b/hadoop-dependencies/pom.xml
index 653ac95..b647077 100644
--- a/hadoop-dependencies/pom.xml
+++ b/hadoop-dependencies/pom.xml
@@ -36,20 +36,6 @@
             <activation>
                 <activeByDefault>true</activeByDefault>
             </activation>
-            <dependencyManagement>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.codehaus.jackson</groupId>
-                        <artifactId>jackson-core-asl</artifactId>
-                        <version>1.8.3</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.codehaus.jackson</groupId>
-                        <artifactId>jackson-mapper-asl</artifactId>
-                        <version>1.8.3</version>
-                    </dependency>
-                </dependencies>
-            </dependencyManagement>
             <dependencies>
                 <dependency>
                     <groupId>org.apache.hadoop</groupId>

http://git-wip-us.apache.org/repos/asf/falcon/blob/952a9e6c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2900bc4..31997e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -502,13 +502,13 @@
             <dependency>
                 <groupId>org.codehaus.jackson</groupId>
                 <artifactId>jackson-core-asl</artifactId>
-                <version>1.8.3</version>
+                <version>1.5.2</version>
             </dependency>
 
             <dependency>
                 <groupId>org.codehaus.jackson</groupId>
                 <artifactId>jackson-mapper-asl</artifactId>
-                <version>1.8.3</version>
+                <version>1.5.2</version>
             </dependency>
 
             <dependency>

http://git-wip-us.apache.org/repos/asf/falcon/blob/952a9e6c/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
b/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
index ee5e132..4469e02 100644
--- a/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
+++ b/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
@@ -18,34 +18,54 @@
 
 package org.apache.falcon.resource.provider;
 
-import org.codehaus.jackson.map.ObjectMapper;
+import com.sun.jersey.api.json.JSONConfiguration;
+import com.sun.jersey.api.json.JSONJAXBContext;
+import org.apache.falcon.resource.APIResult;
+import org.apache.falcon.resource.InstancesResult;
+import org.apache.falcon.resource.InstancesSummaryResult;
+import org.apache.falcon.resource.InstancesSummaryResult.InstanceSummary;
 
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.ext.ContextResolver;
 import javax.ws.rs.ext.Provider;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
 
 /**
  * An implementation of Context Resolver for JAXB.
  */
 @Provider
 @Produces(MediaType.APPLICATION_JSON)
-public class JAXBContextResolver implements ContextResolver<ObjectMapper> {
+public class JAXBContextResolver implements ContextResolver<JAXBContext> {
 
-    private final ObjectMapper defaultObjectMapper;
+    private static JAXBContext context;
+    private static Class<?>[] types = {
+        InstancesResult.class,
+        APIResult.class,
+        InstancesResult.Instance.class,
+        InstancesResult.WorkflowStatus.class,
+        InstancesSummaryResult.class,
+        InstanceSummary.class,
+    };
 
-
-    public JAXBContextResolver() {
-        defaultObjectMapper = createDefaultMapper();
+    static {
+        try {
+            context = new JSONJAXBContext(JSONConfiguration.natural().build(), types);
+        } catch (JAXBException e) {
+            throw new RuntimeException(e);
+        }
     }
 
-    private static ObjectMapper createDefaultMapper() {
-        final ObjectMapper result = new ObjectMapper();
-        // you can customize it here e.g. result.enable(SerializationFeature.INDENT_OUTPUT);
-        return result;
+    public JAXBContextResolver() {
     }
 
-    public  ObjectMapper getContext(Class<?> objectType) {
-        return defaultObjectMapper;
+    public JAXBContext getContext(Class<?> objectType) {
+        for (Class<?> type : types) {
+            if (type == objectType) {
+                return context;
+            }
+        }
+        return null;
     }
 }

http://git-wip-us.apache.org/repos/asf/falcon/blob/952a9e6c/prism/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/prism/src/main/webapp/WEB-INF/web.xml b/prism/src/main/webapp/WEB-INF/web.xml
index 4719834..551bf56 100644
--- a/prism/src/main/webapp/WEB-INF/web.xml
+++ b/prism/src/main/webapp/WEB-INF/web.xml
@@ -72,11 +72,6 @@
                 org.apache.falcon.resource.admin,org.apache.falcon.resource.provider,org.apache.falcon.resource.proxy,org.apache.falcon.resource.metadata
             </param-value>
         </init-param>
-        <init-param>
-            <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
-            <param-value>true</param-value>
-        </init-param>
-
         <load-on-startup>1</load-on-startup>
     </servlet>
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/952a9e6c/webapp/src/main/webapp/WEB-INF/distributed/web.xml
----------------------------------------------------------------------
diff --git a/webapp/src/main/webapp/WEB-INF/distributed/web.xml b/webapp/src/main/webapp/WEB-INF/distributed/web.xml
index 619fd2f..31d78a2 100644
--- a/webapp/src/main/webapp/WEB-INF/distributed/web.xml
+++ b/webapp/src/main/webapp/WEB-INF/distributed/web.xml
@@ -108,10 +108,6 @@
                 org.apache.falcon.resource.provider.JAXBContextResolver,org.apache.falcon.resource.ConfigSyncService
             </param-value>
         </init-param>
-        <init-param>
-            <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
-            <param-value>true</param-value>
-        </init-param>
         <load-on-startup>1</load-on-startup>
     </servlet>
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/952a9e6c/webapp/src/main/webapp/WEB-INF/embedded/web.xml
----------------------------------------------------------------------
diff --git a/webapp/src/main/webapp/WEB-INF/embedded/web.xml b/webapp/src/main/webapp/WEB-INF/embedded/web.xml
index 8fccf6b..fa2db39 100644
--- a/webapp/src/main/webapp/WEB-INF/embedded/web.xml
+++ b/webapp/src/main/webapp/WEB-INF/embedded/web.xml
@@ -72,10 +72,6 @@
                 org.apache.falcon.resource.admin,org.apache.falcon.resource.provider,org.apache.falcon.resource.proxy,org.apache.falcon.resource.metadata
             </param-value>
         </init-param>
-        <init-param>
-            <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
-            <param-value>true</param-value>
-        </init-param>
         <load-on-startup>1</load-on-startup>
     </servlet>
 


Mime
View raw message