-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Phillip Kruger <[email protected]>
- Loading branch information
1 parent
c43f0bd
commit 4f8235a
Showing
35 changed files
with
125 additions
and
1,157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 0 additions & 97 deletions
97
...ns/arc/deployment/src/main/java/io/quarkus/arc/deployment/devconsole/DependencyGraph.java
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...ns/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcBeanInfoBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/DependencyGraph.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.quarkus.arc.deployment.devui; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
import java.util.function.Predicate; | ||
|
||
public class DependencyGraph { | ||
|
||
public final Set<DevBeanInfo> nodes; | ||
public final Set<Link> links; | ||
public final int maxLevel; | ||
|
||
public DependencyGraph(Set<DevBeanInfo> nodes, Set<Link> links) { | ||
this.nodes = nodes; | ||
this.links = links; | ||
this.maxLevel = links.stream().mapToInt(l -> l.level).max().orElse(0); | ||
} | ||
|
||
DependencyGraph forLevel(int level) { | ||
return filterLinks(link -> link.level <= level); | ||
} | ||
|
||
DependencyGraph filterLinks(Predicate<Link> predicate) { | ||
// Filter out links first | ||
Set<Link> newLinks = new HashSet<>(); | ||
Set<DevBeanInfo> newNodes = new HashSet<>(); | ||
Set<String> usedIds = new HashSet<>(); | ||
for (Link link : links) { | ||
if (predicate.test(link)) { | ||
newLinks.add(link); | ||
usedIds.add(link.source); | ||
usedIds.add(link.target); | ||
} | ||
} | ||
// Now keep only nodes for which a link exists... | ||
for (DevBeanInfo node : nodes) { | ||
if (usedIds.contains(node.getId())) { | ||
newNodes.add(node); | ||
} | ||
} | ||
return new DependencyGraph(newNodes, newLinks); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...rc/deployment/devconsole/DevBeanInfo.java → ...kus/arc/deployment/devui/DevBeanInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/deployment/devconsole/DevBeanKind.java → ...kus/arc/deployment/devui/DevBeanKind.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.