Skip to content

Commit

Permalink
[FLINK-3762] [core] Enable Kryo reference tracking
Browse files Browse the repository at this point in the history
This closes apache#1891
  • Loading branch information
andrewpalumbo authored and fhueske committed Apr 15, 2016
1 parent f3d3a44 commit dc78a74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,8 @@ private void checkKryoInitialized() {
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ public void testForwardEOFExceptionWhileDeserializing() {
}

@Test
public void validateReferenceMappingDisabled() {
public void validateReferenceMappingEnabled() {
KryoSerializer<String> serializer = new KryoSerializer<>(String.class, new ExecutionConfig());
Kryo kryo = serializer.getKryo();
assertFalse(kryo.getReferences());
assertTrue(kryo.getReferences());
}
}

0 comments on commit dc78a74

Please sign in to comment.