Reduce Guava usage - #2026
Conversation
| HttpUrl baseUrl; | ||
|
|
||
| ImmutableList<String> path; | ||
| List<String> path; |
There was a problem hiding this comment.
The class is package-private so no backward compatibility issues
| private Set<String> registeredNetworks = Sets.newConcurrentHashSet(); | ||
| private Set<String> registeredImages = Sets.newConcurrentHashSet(); | ||
| private final Map<String, String> registeredContainers = new ConcurrentHashMap<>(); | ||
| private final Set<String> registeredNetworks = synchronizedSet(new HashSet<>()); |
There was a problem hiding this comment.
Sets.newConcurrentHashSet wraps ConcurrentHashMap and exposes it as Set - we don't really benefit from its fine-grained locking here so I used a classic synchronized HashSet
|
Thanks for submitting this PR! The Guava dependency comes from Since the PR's title says "reduce", I wonder if there are more uses left? |
|
@bsideup sure, I can work towards removing all of it - wanted to probe your thoughts first! |
Not sure if removing Guava dependency is something on your roadmap, but there are multiple spots where its usage doesn't introduce much value, for example:
Charsets.UTF_8is already provided by Java asStandardCharsets.UTF_8Sets.newConcurrentHashSet()doesn't provide any extra value over a simple synchronized collection (in those particular spots)Maps.newHashMap()is just a wrappedHashMap's constructor