[ https://issues.apache.org/jira/browse/TINKERPOP-2033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613651#comment-16613651 ]
ASF GitHub Bot commented on TINKERPOP-2033: ------------------------------------------- GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/932 TINKERPOP-2033 Maintain order in profile() annotations https://issues.apache.org/jira/browse/TINKERPOP-2033 Used a synchronized map around a `LinkedHashMap` rather than `ConcurrentHashMap`. Not expecting a performance issue with this as its for `profile()` step which doesn't have to be "fast" necessarily as it is a debugging step. Tested manually for backward compatibility across a number of different versions. That was quite time consuming because I'd not realized that the we'd introduced a perhaps unintended break between 3.3.0 and 3.2.x when it comes to "metrics" serialization in Gryo 1.0. Ultimately, I should have just accepted the output i was seeing in the IO tests as being correct in terms of what the compatibility was. Note that while the Gryo 1.0 test file changed for 3.4.0 it still remains compatible with previous versions - there is just a different representation of a {{Map}} in the binary. All of this seems somehow a non-issue because Gryo 3.0 has been the default since 3.3.0 released. VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-2033 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/932.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #932 ---- commit 788bf8703488f02ed1a609c6d2abf56cc4c24b3f Author: Stephen Mallette <spmva@...> Date: 2018-09-11T16:44:07Z TINKERPOP-2033 Maintain order in profile() annotations Used a synchronized map around a LinkedHashMap rather than ConcurrentHashMap. Not expecting a performance issue with this as its for profile() step which doesn't have to be "fast" per se as it is a debugging step. Affected gryo more than graphson - specifically gryo 1.0 which didn't coerce "metrics" to an interfaces as it does in 3.0. Added a custom serializer to force the annotations to a regular LinkedHashMap and then back to synchronized LinkedHashMap during serder to keep compatibility. ---- > 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)