flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetz...@apache.org
Subject [4/7] flink git commit: [FLINK-1395] Add support for JodaTime in KryoSerializer
Date Wed, 18 Feb 2015 15:37:24 GMT
[FLINK-1395] Add support for JodaTime in KryoSerializer

Also fix tests for JodaTime.

Conflicts:
	flink-dist/src/main/flink-bin/LICENSE
	flink-java/pom.xml
	flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoSerializer.java
	flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/KryoGenericTypeSerializerTest.scala
	flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/TupleSerializerTest.scala


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

Branch: refs/heads/master
Commit: 5015ab490f89d384ac93752c22caf201ceb43776
Parents: 77c4548
Author: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Authored: Tue Jan 13 15:23:46 2015 +0100
Committer: Robert Metzger <rmetzger@apache.org>
Committed: Wed Feb 18 15:52:08 2015 +0100

----------------------------------------------------------------------
 flink-dist/src/main/flink-bin/LICENSE                |  4 ++++
 flink-dist/src/main/flink-bin/NOTICE                 |  6 ++++++
 flink-java/pom.xml                                   | 12 ++++++++++++
 .../runtime/AbstractGenericTypeSerializerTest.java   |  3 +++
 .../runtime/KryoGenericTypeSerializerTest.java       | 10 ++++++++++
 flink-tests/pom.xml                                  |  6 ++++++
 .../runtime/KryoGenericTypeSerializerTest.scala      |  7 +++++++
 .../api/scala/runtime/TupleSerializerTest.scala      | 15 +++++++++++++++
 8 files changed, 63 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/5015ab49/flink-dist/src/main/flink-bin/LICENSE
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/LICENSE b/flink-dist/src/main/flink-bin/LICENSE
index 2838497..25f91d4 100644
--- a/flink-dist/src/main/flink-bin/LICENSE
+++ b/flink-dist/src/main/flink-bin/LICENSE
@@ -235,6 +235,10 @@ under the Apache License (v 2.0):
  - Apache Sling (http://sling.apache.org)
  - Google Guava (https://code.google.com/p/guava-libraries/)
  - Netty v4.0.21 (http://netty.io)
+ - Powermock (http://www.powermock.org)
+ - Javassist (http://www.javassist.org)
+ - Kryo-Serializers (https://github.com/magro/kryo-serializers/)
+ - Joda-Time (http://www.joda.org/joda-time/)
  - Chill_2.10 v0.5.1 (https://github.com/twitter/chill)
  - Jetty Web Container (http://www.eclipse.org/jetty/)
  - Amazon Web Services SDK for Java (http://aws.amazon.com/sdkforjava/)

http://git-wip-us.apache.org/repos/asf/flink/blob/5015ab49/flink-dist/src/main/flink-bin/NOTICE
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/flink-bin/NOTICE b/flink-dist/src/main/flink-bin/NOTICE
index 45b189d..726f231 100644
--- a/flink-dist/src/main/flink-bin/NOTICE
+++ b/flink-dist/src/main/flink-bin/NOTICE
@@ -148,6 +148,12 @@ This software includes third party software subject to the following
copyrights:
 
 The licenses for these third party components are included in LICENSE.txt
 
+-----------------------------------------------------------------------
+                   Joda-Time Library
+-----------------------------------------------------------------------
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
 
 -----------------------------------------------------------------------
                       Twitter Chill Library

http://git-wip-us.apache.org/repos/asf/flink/blob/5015ab49/flink-java/pom.xml
----------------------------------------------------------------------
diff --git a/flink-java/pom.xml b/flink-java/pom.xml
index a842d96..dc5076a 100644
--- a/flink-java/pom.xml
+++ b/flink-java/pom.xml
@@ -103,6 +103,18 @@ under the License.
 			</exclusions>
 		</dependency>
 
+		<dependency>
+			<groupId>de.javakaffee</groupId>
+			<artifactId>kryo-serializers</artifactId>
+			<version>0.27</version>
+		</dependency>
+
+		<dependency>
+			<groupId>joda-time</groupId>
+			<artifactId>joda-time</artifactId>
+			<version>2.7</version>
+		</dependency>
+
 		<!--  guava needs to be in "provided" scope, to make sure it is not included into the
jars by the shading -->
 		<dependency>
 			<groupId>com.google.guava</groupId>

http://git-wip-us.apache.org/repos/asf/flink/blob/5015ab49/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java
index 059c78d..2a11bd7 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/AbstractGenericTypeSerializerTest.java
@@ -21,10 +21,13 @@ package org.apache.flink.api.java.typeutils.runtime;
 import org.apache.flink.api.common.typeutils.SerializerTestInstance;
 import org.apache.flink.api.common.typeutils.TypeSerializer;
 import org.apache.flink.util.StringUtils;
+import org.joda.time.DateTime;
 import org.junit.Test;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Random;

http://git-wip-us.apache.org/repos/asf/flink/blob/5015ab49/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/KryoGenericTypeSerializerTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/KryoGenericTypeSerializerTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/KryoGenericTypeSerializerTest.java
index afa8c52..2f47e51 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/KryoGenericTypeSerializerTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/typeutils/runtime/KryoGenericTypeSerializerTest.java
@@ -62,6 +62,16 @@ public class KryoGenericTypeSerializerTest extends AbstractGenericTypeSerializer
 		runTests(c);
 	}
 
+	@Test
+	public void testJodaTime(){
+		Collection<DateTime> b = new HashSet<DateTime>();
+
+		b.add(new DateTime(1));
+		b.add(new DateTime(2));
+
+		runTests(b);
+	}
+
 	private void fillCollection(Collection<Integer> coll){
 		coll.add(42);
 		coll.add(1337);

http://git-wip-us.apache.org/repos/asf/flink/blob/5015ab49/flink-tests/pom.xml
----------------------------------------------------------------------
diff --git a/flink-tests/pom.xml b/flink-tests/pom.xml
index cfccc1e..42d3202 100644
--- a/flink-tests/pom.xml
+++ b/flink-tests/pom.xml
@@ -122,6 +122,12 @@ under the License.
 			<type>test-jar</type>
 			<scope>test</scope>
 		</dependency>
+
+		<dependency>
+			<groupId>joda-time</groupId>
+			<artifactId>joda-time</artifactId>
+			<version>2.7</version>
+		</dependency>
 		
 		<!--<dependency>-->
 			<!--<groupId>com.google.guava</groupId>-->

http://git-wip-us.apache.org/repos/asf/flink/blob/5015ab49/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/KryoGenericTypeSerializerTest.scala
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/KryoGenericTypeSerializerTest.scala
b/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/KryoGenericTypeSerializerTest.scala
index ce4efb3..3a0001e 100644
--- a/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/KryoGenericTypeSerializerTest.scala
+++ b/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/KryoGenericTypeSerializerTest.scala
@@ -94,6 +94,13 @@ class KryoGenericTypeSerializerTest {
 
   @Test
   def jodaSerialization: Unit = {
+    val a = List(new DateTime(1), new DateTime(2))
+
+    runTests(a)
+  }
+
+  @Test
+  def jodaSerialization: Unit = {
     val a = List(new LocalDate(1), new LocalDate(2))
     
     runTests(a)

http://git-wip-us.apache.org/repos/asf/flink/blob/5015ab49/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/TupleSerializerTest.scala
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/TupleSerializerTest.scala
b/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/TupleSerializerTest.scala
index 9371604..5ac7529 100644
--- a/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/TupleSerializerTest.scala
+++ b/flink-tests/src/test/scala/org/apache/flink/api/scala/runtime/TupleSerializerTest.scala
@@ -24,6 +24,7 @@ import org.apache.flink.api.java.typeutils.TupleTypeInfoBase
 import org.apache.flink.api.java.typeutils.runtime.AbstractGenericTypeSerializerTest._
 import org.apache.flink.api.common.typeinfo.TypeInformation
 import org.apache.flink.util.StringUtils
+import org.joda.time.DateTime
 import org.joda.time.LocalDate
 import org.junit.Assert
 import org.junit.Test
@@ -96,6 +97,20 @@ class TupleSerializerTest {
     val rnd: Random = new Random(807346528946L)
 
     val testTuples = Array(
+      (StringUtils.getRandomString(rnd, 10, 100), new DateTime(rnd.nextInt)),
+      (StringUtils.getRandomString(rnd, 10, 100), new DateTime(rnd.nextInt)),
+      (StringUtils.getRandomString(rnd, 10, 100), new DateTime(rnd.nextInt)),
+      ("", rnd.nextDouble),
+      (StringUtils.getRandomString(rnd, 10, 100), new DateTime(rnd.nextInt)),
+      (StringUtils.getRandomString(rnd, 10, 100), new DateTime(rnd.nextInt)))
+    runTests(testTuples)
+  }
+
+  @Test
+  def testTuple2StringJodaTime2(): Unit = {
+    val rnd: Random = new Random(807346528946L)
+
+    val testTuples = Array(
       (StringUtils.getRandomString(rnd, 10, 100), new LocalDate(rnd.nextInt)),
       (StringUtils.getRandomString(rnd, 10, 100), new LocalDate(rnd.nextInt)),
       (StringUtils.getRandomString(rnd, 10, 100), new LocalDate(rnd.nextInt)),


Mime
View raw message