You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2024/12/01 20:29:44 UTC
[PR] [MNG-8396] Add a cache layer to the filtered dependency graph [maven]
gnodet opened a new pull request, #1944:
URL: https://github.com/apache/maven/pull/1944
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8396] Add a cache layer to the filtered dependency graph [maven]
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1944:
URL: https://github.com/apache/maven/pull/1944#discussion_r1865019649
##########
impl/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java:
##########
@@ -74,12 +79,24 @@ public List<MavenProject> getSortedProjects() {
@Override
public List<MavenProject> getDownstreamProjects(MavenProject project, boolean transitive) {
- return applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), transitive, false);
+ Key key = new Key(project, transitive, false);
+ List<MavenProject> list = cache.get(key);
+ if (list == null) {
+ list = applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), transitive, false);
+ cache.put(key, list);
+ }
Review Comment:
comments here why not use `computeIfAbsenta` - can help in future
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8396] Add a cache layer to the filtered dependency graph [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1944:
URL: https://github.com/apache/maven/pull/1944#discussion_r1865013461
##########
impl/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java:
##########
@@ -74,12 +79,24 @@ public List<MavenProject> getSortedProjects() {
@Override
public List<MavenProject> getDownstreamProjects(MavenProject project, boolean transitive) {
- return applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), transitive, false);
+ Key key = new Key(project, transitive, false);
+ List<MavenProject> list = cache.get(key);
+ if (list == null) {
+ list = applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), transitive, false);
+ cache.put(key, list);
+ }
Review Comment:
No, that's what cause failures with #1943
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8396] Add a cache layer to the filtered dependency graph [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet merged PR #1944:
URL: https://github.com/apache/maven/pull/1944
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8396] Add a cache layer to the filtered dependency graph [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1944:
URL: https://github.com/apache/maven/pull/1944#discussion_r1865013461
##########
impl/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java:
##########
@@ -74,12 +79,24 @@ public List<MavenProject> getSortedProjects() {
@Override
public List<MavenProject> getDownstreamProjects(MavenProject project, boolean transitive) {
- return applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), transitive, false);
+ Key key = new Key(project, transitive, false);
+ List<MavenProject> list = cache.get(key);
+ if (list == null) {
+ list = applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), transitive, false);
+ cache.put(key, list);
+ }
Review Comment:
No, that's what cause failures with #1943 because of a recursive computation, which is not allowed by `computeIfAbsent`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MNG-8396] Add a cache layer to the filtered dependency graph [maven]
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1944:
URL: https://github.com/apache/maven/pull/1944#discussion_r1865010816
##########
impl/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java:
##########
@@ -74,12 +79,24 @@ public List<MavenProject> getSortedProjects() {
@Override
public List<MavenProject> getDownstreamProjects(MavenProject project, boolean transitive) {
- return applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), transitive, false);
+ Key key = new Key(project, transitive, false);
+ List<MavenProject> list = cache.get(key);
+ if (list == null) {
+ list = applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), transitive, false);
+ cache.put(key, list);
+ }
Review Comment:
`computeIfAbsent`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org