connect icon indicating copy to clipboard operation
connect copied to clipboard

Fully implement java.util.concurrent.ConcurrentMap for global maps

Open rbeckman-nextgen opened this issue 4 years ago • 2 comments

GlobalVariableStore and GlobalChannelVariableStore are both backed by ConcurrentHashMaps, but don't support any of the atomic methods from the ConcurrentMap interface for thread-safe operations.

Imported Issue. Original Details: Jira Issue Key: MIRTH-4468 Reporter: agermano Created: 2019-10-09T22:24:55.000-0700

rbeckman-nextgen avatar May 11 '20 21:05 rbeckman-nextgen

Those "sync" methods were created a long time ago, probably to satisfy some narrow use-case at the time. We need to overhaul those to make them easier to understand and more applicable to real use-cases around synchronization. It's probably fine to just rip out the old stuff without deprecating anything, since I doubt anyone uses them.

Imported Comment. Original Details: Author: narupley Created: 2019-10-29T12:40:10.000-0700

rbeckman-nextgen avatar May 11 '20 21:05 rbeckman-nextgen

Original issue for the sync methods: https://github.com/nextgenhealthcare/connect/issues/1277

I think it's very unlikely that they are being used, too. I would like to have access to the putIfAbsent() and computeIfAbsent() methods more than anything. If the maps themselves were ConcurrentHashMaps, all of the methods added in java 8 to support functional interfaces would be more useful and less surprising than these undocumented sync methods which appear to have been added for mirth 2.0.

tonygermano avatar Jul 22 '22 16:07 tonygermano