atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shweth...@apache.org
Subject incubator-atlas git commit: ATLAS-25 Fix Atlas on Java 8 (sandeep.samudrala via shwethags)
Date Mon, 03 Aug 2015 06:23:37 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master b93fe4a46 -> 96059e0a9


ATLAS-25 Fix Atlas on Java 8 (sandeep.samudrala via shwethags)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/96059e0a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/96059e0a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/96059e0a

Branch: refs/heads/master
Commit: 96059e0a9cd1ae7cd25e4e9a365bdde3633228ff
Parents: b93fe4a
Author: Shwetha GS <sshivalingamurthy@hortonworks.com>
Authored: Mon Aug 3 11:53:30 2015 +0530
Committer: Shwetha GS <sshivalingamurthy@hortonworks.com>
Committed: Mon Aug 3 11:53:30 2015 +0530

----------------------------------------------------------------------
 pom.xml                                         | 25 ++++++++---
 release-log.txt                                 |  1 +
 .../atlas/repository/graph/GraphHelper.java     |  2 +-
 .../atlas/repository/memory/EnumTest.java       |  8 ++--
 .../atlas/repository/memory/StructTest.java     |  4 +-
 .../typesystem/types/AbstractDataType.java      | 11 ++++-
 .../apache/atlas/typesystem/types/EnumTest.java |  4 +-
 .../atlas/typesystem/types/StructTest.java      |  2 +-
 .../typesystem/json/SerializationTest.scala     | 12 ++---
 webapp/pom.xml                                  | 46 ++++++++++++--------
 10 files changed, 74 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 602e70f..b98e02b 100755
--- a/pom.xml
+++ b/pom.xml
@@ -327,7 +327,7 @@
         <jackson.version>1.8.3</jackson.version>
         <tinkerpop.version>2.6.0</tinkerpop.version>
         <titan.version>0.5.4</titan.version>
-        <hadoop.version>2.6.0</hadoop.version>
+        <hadoop.version>2.7.0</hadoop.version>
         <hbase.version>0.98.9-hadoop2</hbase.version>
 
         <!-- scala versions -->
@@ -402,6 +402,21 @@
             </properties>
         </profile>
 
+        <profile>
+            <id>jdk7</id>
+            <activation>
+                <jdk>[1.7,1.8)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.enunciate</groupId>
+                        <artifactId>maven-enunciate-plugin</artifactId>
+                        <version>1.29</version>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
     <modules>
         <module>typesystem</module>
@@ -1192,8 +1207,9 @@
                 <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>findbugs-maven-plugin</artifactId>
-                    <version>2.5.2</version>
+                    <version>3.0.1</version>
                 </plugin>
+                
                 <!-- Source code metrics: mvn javancss:report or mvn site -->
                 <plugin>
                     <groupId>org.codehaus.mojo</groupId>
@@ -1276,11 +1292,6 @@
                     </configuration>
                 </plugin>
 
-                <plugin>
-                    <groupId>org.codehaus.enunciate</groupId>
-                    <artifactId>maven-enunciate-plugin</artifactId>
-                    <version>1.29</version>
-                </plugin>
             </plugins>
         </pluginManagement>
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 93c1288..3642095 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -8,6 +8,7 @@ ATLAS-54 Rename configs in hive hook (shwethags)
 ATLAS-3 Mixed Index creation fails with Date types (suma.shivaprasad via shwethags)
 
 ALL CHANGES:
+ATLAS-25 Fix Atlas on Java 8 (sandeep.samudrala via shwethags)
 ATLAS-86 Jenkins build failing as of build #41 (shwethags)
 ATLAS-80 Support for variables in application properties (shwethags)
 ATLAS-37 atlas repository, webapp, hive-bridge tests fails with Hbase and Solr as Titan storage
backend (suma.shivaprasad via shwethags)

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
index d617bd2..ceb8a65 100755
--- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
+++ b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
@@ -96,7 +96,7 @@ public final class GraphHelper {
     public static String vertexString(final Vertex vertex) {
         StringBuilder properties = new StringBuilder();
         for (String propertyKey : vertex.getPropertyKeys()) {
-            properties.append(propertyKey).append("=").append(vertex.getProperty(propertyKey)).append(",
");
+            properties.append(propertyKey).append("=").append(vertex.getProperty(propertyKey).toString()).append(",
");
         }
 
         return "v[" + vertex.getId() + "], Properties[" + properties + "]";

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/repository/src/test/java/org/apache/atlas/repository/memory/EnumTest.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/repository/memory/EnumTest.java b/repository/src/test/java/org/apache/atlas/repository/memory/EnumTest.java
index 6a0402a..4ce1085 100755
--- a/repository/src/test/java/org/apache/atlas/repository/memory/EnumTest.java
+++ b/repository/src/test/java/org/apache/atlas/repository/memory/EnumTest.java
@@ -176,7 +176,7 @@ public class EnumTest extends BaseTest {
                 "\tl : \t" + TEST_DATE + "\n" +
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.1, 1.1]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "\tenum4 : \tPARTITION\n" +
                 "}");
     }
@@ -208,7 +208,7 @@ public class EnumTest extends BaseTest {
                 "\tl : \t" + TEST_DATE + "\n" +
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.1, 1.1]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "\tenum4 : \tPARTITION\n" +
                 "}");
     }
@@ -245,7 +245,7 @@ public class EnumTest extends BaseTest {
                 "\tl : \t" + TEST_DATE + "\n" +
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.1, 1.1]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "\tenum4 : \tPARTITION\n" +
                 "}");
     }
@@ -286,7 +286,7 @@ public class EnumTest extends BaseTest {
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.100000000000000088817841970012523233890533447265625, 1" +
                 ".100000000000000088817841970012523233890533447265625]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "\tenum4 : \tPARTITION\n" +
                 "}");
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/repository/src/test/java/org/apache/atlas/repository/memory/StructTest.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/repository/memory/StructTest.java b/repository/src/test/java/org/apache/atlas/repository/memory/StructTest.java
index 369ffde..3ab7020 100755
--- a/repository/src/test/java/org/apache/atlas/repository/memory/StructTest.java
+++ b/repository/src/test/java/org/apache/atlas/repository/memory/StructTest.java
@@ -60,7 +60,7 @@ public class StructTest extends BaseTest {
                 "\tl : \t" + TEST_DATE + "\n" +
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.1, 1.1]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "}");
     }
 
@@ -104,7 +104,7 @@ public class StructTest extends BaseTest {
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.100000000000000088817841970012523233890533447265625, 1" +
                 ".100000000000000088817841970012523233890533447265625]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "}");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
b/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
index f9834b1..f2d15eb 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
@@ -18,8 +18,11 @@
 
 package org.apache.atlas.typesystem.types;
 
+import com.google.common.collect.ImmutableSortedMap;
 import org.apache.atlas.AtlasException;
 
+import java.util.Map;
+
 abstract class AbstractDataType<T> implements IDataType<T> {
 
     protected T convertNull(Multiplicity m) throws AtlasException {
@@ -31,7 +34,13 @@ abstract class AbstractDataType<T> implements IDataType<T>
{
 
     @Override
     public void output(T val, Appendable buf, String prefix) throws AtlasException {
-        TypeUtils.outputVal(val == null ? "<null>" : val.toString(), buf, prefix);
+        if (val instanceof Map) {
+            ImmutableSortedMap immutableSortedMap = ImmutableSortedMap.copyOf((Map) val);
+            TypeUtils.outputVal(val == null ? "<null>" : immutableSortedMap.toString(),
buf, prefix);
+        } else {
+            TypeUtils.outputVal(val == null ? "<null>" : val.toString(), buf, prefix);
+        }
+
     }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java
----------------------------------------------------------------------
diff --git a/typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java b/typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java
index 9074519..a179a12 100755
--- a/typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java
+++ b/typesystem/src/test/java/org/apache/atlas/typesystem/types/EnumTest.java
@@ -162,7 +162,7 @@ public class EnumTest extends BaseTest {
                 "\tl : \t" + TEST_DATE + "\n" +
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.1, 1.1]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "\tenum4 : \tPARTITION\n" +
                 "}");
     }
@@ -194,7 +194,7 @@ public class EnumTest extends BaseTest {
                 "\tl : \t" + TEST_DATE + "\n" +
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.1, 1.1]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "\tenum4 : \tPARTITION\n" +
                 "}");
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java
----------------------------------------------------------------------
diff --git a/typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java b/typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java
index 2ce4bbc..ec94058 100755
--- a/typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java
+++ b/typesystem/src/test/java/org/apache/atlas/typesystem/types/StructTest.java
@@ -56,7 +56,7 @@ public class StructTest extends BaseTest {
                 "\tl : \t" + TEST_DATE + "\n" +
                 "\tm : \t[1, 1]\n" +
                 "\tn : \t[1.1, 1.1]\n" +
-                "\to : \t{b=2.0, a=1.0}\n" +
+                "\to : \t{a=1.0, b=2.0}\n" +
                 "}");
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala
----------------------------------------------------------------------
diff --git a/typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala
b/typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala
index 5556d77..d14ac72 100755
--- a/typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala
+++ b/typesystem/src/test/scala/org/apache/atlas/typesystem/json/SerializationTest.scala
@@ -44,18 +44,18 @@ class SerializationTest extends BaseTest {
         val s: Struct = BaseTest.createStruct()
         val ts: ITypedStruct = structType.convert(s, Multiplicity.REQUIRED)
 
-        Assert.assertEquals(ts.toString, "{\n\ta : \t1\n\tb : \ttrue\n\tc : \t1\n\td : \t2\n\te
: \t1\n\tf : \t1\n\tg : \t1\n\th : \t1.0\n\ti : \t1.0\n\tj : \t1\n\tk : \t1\n\tl : \t" + BaseTest.TEST_DATE
+ "\n\tm : \t[1, 1]\n\tn : \t[1.1, 1.1]\n\to : \t{b=2.0, a=1.0}\n}")
+        Assert.assertEquals(ts.toString, "{\n\ta : \t1\n\tb : \ttrue\n\tc : \t1\n\td : \t2\n\te
: \t1\n\tf : \t1\n\tg : \t1\n\th : \t1.0\n\ti : \t1.0\n\tj : \t1\n\tk : \t1\n\tl : \t" + BaseTest.TEST_DATE
+ "\n\tm : \t[1, 1]\n\tn : \t[1.1, 1.1]\n\to : \t{a=1.0, b=2.0}\n}")
 
         implicit val formats = org.json4s.native.Serialization.formats(NoTypeHints) + new
TypedStructSerializer +
             new BigDecimalSerializer + new BigIntegerSerializer
 
         //Json representation
         val ser = swrite(ts)
-        Assert.assertEquals(ser, "{\"$typeName$\":\"t1\",\"e\":1,\"n\":[1.1,1.1],\"h\":1.0,\"b\":true,\"k\":1,\"j\":1,\"d\":2,\"m\":[1,1],\"g\":1,\"a\":1,\"i\":1.0,\"c\":1,\"l\":\""
+ BaseTest.TEST_DATE + "\",\"f\":1,\"o\":{\"b\":2.0,\"a\":1.0}}")
-
+        val ser1 = swrite(ts.toString)
+        Assert.assertEquals(ser1, "\"{\\n\\ta : \\t1\\n\\tb : \\ttrue\\n\\tc : \\t1\\n\\td
: \\t2\\n\\te : \\t1\\n\\tf : \\t1\\n\\tg : \\t1\\n\\th : \\t1.0\\n\\ti : \\t1.0\\n\\tj :
\\t1\\n\\tk : \\t1\\n\\tl : \\t" + BaseTest.TEST_DATE + "\\n\\tm : \\t[1, 1]\\n\\tn : \\t[1.1,
1.1]\\n\\to : \\t{a=1.0, b=2.0}\\n}\"");
         // Typed Struct read back
         val ts1 = read[StructInstance](ser)
-        Assert.assertEquals(ts1.toString, "{\n\ta : \t1\n\tb : \ttrue\n\tc : \t1\n\td : \t2\n\te
: \t1\n\tf : \t1\n\tg : \t1\n\th : \t1.0\n\ti : \t1.0\n\tj : \t1\n\tk : \t1\n\tl : \t" + BaseTest.TEST_DATE
+ "\n\tm : \t[1, 1]\n\tn : \t[1.100000000000000088817841970012523233890533447265625, 1.100000000000000088817841970012523233890533447265625]\n\to
: \t{b=2.0, a=1.0}\n}")
+        Assert.assertEquals(ts1.toString, "{\n\ta : \t1\n\tb : \ttrue\n\tc : \t1\n\td : \t2\n\te
: \t1\n\tf : \t1\n\tg : \t1\n\th : \t1.0\n\ti : \t1.0\n\tj : \t1\n\tk : \t1\n\tl : \t" + BaseTest.TEST_DATE
+ "\n\tm : \t[1, 1]\n\tn : \t[1.100000000000000088817841970012523233890533447265625, 1.100000000000000088817841970012523233890533447265625]\n\to
: \t{a=1.0, b=2.0}\n}")
     }
 
     @Test def test2 {
@@ -68,9 +68,9 @@ class SerializationTest extends BaseTest {
         val ts1 = read[StructInstance](
             """
         {"$typeName$":"t1","e":1,"n":[1.1,1.1],"h":1.0,"b":true,"k":1,"j":1,"d":2,"m":[1,1],"g":1,"a":1,"i":1.0,
-        "c":1,"l":"2014-12-03T19:38:55.053Z","f":1,"o":{"b":2.0,"a":1.0}}""")
+        "c":1,"l":"2014-12-03T19:38:55.053Z","f":1,"o":{"a":1.0,"b":2.0}}""")
         // Typed Struct read from string
-        Assert.assertEquals(ts1.toString, "{\n\ta : \t1\n\tb : \ttrue\n\tc : \t1\n\td : \t2\n\te
: \t1\n\tf : \t1\n\tg : \t1\n\th : \t1.0\n\ti : \t1.0\n\tj : \t1\n\tk : \t1\n\tl : \t2014-12-03T19:38:55.053Z\n\tm
: \t[1, 1]\n\tn : \t[1.100000000000000088817841970012523233890533447265625, 1.100000000000000088817841970012523233890533447265625]\n\to
: \t{b=2.0, a=1.0}\n}")
+        Assert.assertEquals(ts1.toString, "{\n\ta : \t1\n\tb : \ttrue\n\tc : \t1\n\td : \t2\n\te
: \t1\n\tf : \t1\n\tg : \t1\n\th : \t1.0\n\ti : \t1.0\n\tj : \t1\n\tk : \t1\n\tl : \t2014-12-03T19:38:55.053Z\n\tm
: \t[1, 1]\n\tn : \t[1.100000000000000088817841970012523233890533447265625, 1.100000000000000088817841970012523233890533447265625]\n\to
: \t{a=1.0, b=2.0}\n}")
     }
 
     @Test def testTrait {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/96059e0a/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/webapp/pom.xml b/webapp/pom.xml
index d558d74..05721a6 100755
--- a/webapp/pom.xml
+++ b/webapp/pom.xml
@@ -38,6 +38,35 @@
         <debug.jetty.daemon>true</debug.jetty.daemon>
     </properties>
 
+    <profiles>
+        <profile>
+            <id>jdk7</id>
+            <activation>
+                <jdk>[1.7,1.8)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.enunciate</groupId>
+                        <artifactId>maven-enunciate-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>docs</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <!-- the directory where to put the docs -->
+                            <docsDir>${project.build.directory}/apidocs</docsDir>
+                            <configFile>${basedir}/../src/build/enunciate.xml</configFile>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
     <dependencies>
         <dependency>
             <groupId>org.apache.atlas</groupId>
@@ -278,23 +307,6 @@
             </plugin>
 
             <plugin>
-                <groupId>org.codehaus.enunciate</groupId>
-                <artifactId>maven-enunciate-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>docs</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <!-- the directory where to put the docs -->
-                    <docsDir>${project.build.directory}/apidocs</docsDir>
-                    <configFile>${basedir}/../src/build/enunciate.xml</configFile>
-                </configuration>
-            </plugin>
-
-            <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>keytool-maven-plugin</artifactId>
                 <executions>


Mime
View raw message