Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use better concurrent map #457

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import graphql.nadel.engine.transform.query.NadelQueryPath
import graphql.nadel.engine.util.AnyList
import graphql.nadel.engine.util.AnyMap
import graphql.nadel.engine.util.JsonMap
import java.util.Collections
import java.util.concurrent.ConcurrentHashMap

/**
* Utility class to extract data out of the given
Expand All @@ -14,9 +14,7 @@ class JsonNodes(
private val data: JsonMap,
private val executionFlags: NadelExecutionHints,
) {
private val nodes = Collections.synchronizedMap(
mutableMapOf<NadelQueryPath, List<JsonNode>>(),
)
private val nodes = ConcurrentHashMap<NadelQueryPath, List<JsonNode>>()

/**
* Extracts the nodes at the given query selection path.
Expand Down