Return-Path: X-Original-To: apmail-flink-commits-archive@minotaur.apache.org Delivered-To: apmail-flink-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 45C7E193D1 for ; Fri, 15 Apr 2016 17:39:48 +0000 (UTC) Received: (qmail 98795 invoked by uid 500); 15 Apr 2016 17:39:48 -0000 Delivered-To: apmail-flink-commits-archive@flink.apache.org Received: (qmail 98703 invoked by uid 500); 15 Apr 2016 17:39:48 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 98344 invoked by uid 99); 15 Apr 2016 17:39:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 17:39:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 37278E0534; Fri, 15 Apr 2016 17:39:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: fhueske@apache.org To: commits@flink.apache.org Date: Fri, 15 Apr 2016 17:39:56 -0000 Message-Id: <161900367ef54d28b2aa4d1744cb73e0@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [11/12] flink git commit: [FLINK-3762] [core] Enable Kryo reference tracking [FLINK-3762] [core] Enable Kryo reference tracking This closes #1891 Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/dc78a747 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/dc78a747 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/dc78a747 Branch: refs/heads/master Commit: dc78a7470a5da086a08140b200a20d840460ef79 Parents: f3d3a44 Author: Andrew Palumbo Authored: Thu Apr 14 14:25:46 2016 -0400 Committer: Fabian Hueske Committed: Fri Apr 15 19:38:15 2016 +0200 ---------------------------------------------------------------------- .../flink/api/java/typeutils/runtime/kryo/KryoSerializer.java | 5 ++--- .../typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/dc78a747/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java ---------------------------------------------------------------------- diff --git a/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java index d5c2f67..e74e251 100644 --- a/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java +++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoSerializer.java @@ -327,9 +327,8 @@ public class KryoSerializer extends TypeSerializer { if (this.kryo == null) { this.kryo = getKryoInstance(); - // disable reference tracking. reference tracking is costly, usually unnecessary, and - // inconsistent with Flink's own serialization (which does not do reference tracking) - kryo.setReferences(false); + // Enable reference tracking. + kryo.setReferences(true); // Throwable and all subclasses should be serialized via java serialization kryo.addDefaultSerializer(Throwable.class, new JavaSerializer()); http://git-wip-us.apache.org/repos/asf/flink/blob/dc78a747/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java ---------------------------------------------------------------------- diff --git a/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java index 8ff0b1b..12090f8 100644 --- a/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java +++ b/flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/kryo/KryoGenericTypeSerializerTest.java @@ -160,9 +160,9 @@ public class KryoGenericTypeSerializerTest extends AbstractGenericTypeSerializer } @Test - public void validateReferenceMappingDisabled() { + public void validateReferenceMappingEnabled() { KryoSerializer serializer = new KryoSerializer<>(String.class, new ExecutionConfig()); Kryo kryo = serializer.getKryo(); - assertFalse(kryo.getReferences()); + assertTrue(kryo.getReferences()); } } \ No newline at end of file