tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TINKERPOP-2033) Maintain order of profile() annotations
Date Tue, 18 Sep 2018 01:01:00 GMT

    [ https://issues.apache.org/jira/browse/TINKERPOP-2033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16618347#comment-16618347
] 

ASF GitHub Bot commented on TINKERPOP-2033:
-------------------------------------------

Github user spmallette commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/932#discussion_r218272943
  
    --- Diff: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV3d0.java
---
    @@ -427,7 +428,12 @@ else if (1 == arguments)
                 output.writeString(object.getName());
                 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?


> Maintain order of profile() annotations
> ---------------------------------------
>
>                 Key: TINKERPOP-2033
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2033
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.4.0
>            Reporter: stephen mallette
>            Assignee: stephen mallette
>            Priority: Minor
>             Fix For: 3.4.0
>
>
> The {{annotations}} of {{ImmutableMetrics}} uses a {{ConcurrentHashMap}} but that of
course loses the insertion order. Convert to a {{synchronizedMap}} that takes a {{LinkedHashMap}}
to maintain that order as well as the ability to support concurrent access which is an issue
for some graphs. 
> There was some question as to whether or not this change was breaking to the Gryo format
or not ,but it appears that it is not. Gryo 1.0 and 3.0 remain as intact as they were on previous
releases, though it is worth noting that Gryo 1.0 broke on release on 3.3.0 when it comes
to "metrics" serialization so that break is still intact. Therefore you can't use Gryo 1.0
between 3.2.x and 3.3.x/3.4.x. Not sure how that happened exactly.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message