tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmallette <...@git.apache.org>
Subject [GitHub] tinkerpop pull request #932: TINKERPOP-2033 Maintain order in profile() anno...
Date Tue, 18 Sep 2018 01:00:37 GMT
Github user spmallette commented on a diff in the pull request:

    --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
    @@ -427,7 +428,12 @@ else if (1 == arguments)
                 output.writeDouble(object.getDuration(TimeUnit.NANOSECONDS) / 1000000d);
                 kryo.writeObject(output, object.getCounts());
    -            kryo.writeObject(output, object.getAnnotations());
    +            // annotations is a synchronized LinkedHashMap - get rid of the "synch" for
serialization as gryo
    +            // doesn't know how to deserialize that well and LinkedHashMap should work
with 3.3.x and previous
    +            final Map<String, Object> annotations = new LinkedHashMap<>();
    +            object.getAnnotations().forEach(annotations::put);
    +            kryo.writeObject(output, annotations);
                 // kryo might have a problem with LinkedHashMap value collections. can't
recreate it independently but
    --- End diff --
    @robertdale i thought about it some more. the problem (whatever it was) wasn't related
to `LinkedHashMap` itself which is what i'm serializing in the new code. the comment is in
relation to the collection returned from `LinkedHashMap.values()` which is why I converted
that collection to an `ArrayList`. better explanation?


View raw message