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

[Platform] Remove commons-collections4 and use guava instead #8856

Merged
merged 1 commit into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions managed/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.5",
"com.jayway.jsonpath" % "json-path" % "2.4.0",
"commons-io" % "commons-io" % "2.8.0",
"commons-codec" % "commons-codec" % "1.15",
"org.apache.commons" % "commons-collections4" % "4.4"
"commons-codec" % "commons-codec" % "1.15"
)
// Clear default resolvers.
appResolvers := None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.SetMultimap;
import com.google.inject.Inject;
import com.typesafe.config.Config;
import com.yugabyte.yw.cloud.AWSInitializer;
Expand All @@ -29,8 +31,6 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.MultiValuedMap;
import org.apache.commons.collections4.multimap.HashSetValuedHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import play.api.Play;
Expand Down Expand Up @@ -406,7 +406,7 @@ private void createKubernetesInstanceTypes(Provider provider, UUID customerUUID)
response = KubernetesProviderFormData.class)
public Result getSuggestedKubernetesConfigs(UUID customerUUID) {
try {
MultiValuedMap<String, String> regionToAZ = getKubernetesRegionToZoneInfo();
SetMultimap<String, String> regionToAZ = getKubernetesRegionToZoneInfo();
if (regionToAZ.isEmpty()) {
LOG.info(
"No regions and zones found, check if the region and zone labels are present on the nodes. https://k8s.io/docs/reference/labels-annotations-taints/");
Expand Down Expand Up @@ -454,9 +454,9 @@ public Result getSuggestedKubernetesConfigs(UUID customerUUID) {

// Performs region and zone discovery based on
// topology/failure-domain labels from the Kubernetes nodes.
private MultiValuedMap<String, String> getKubernetesRegionToZoneInfo() {
private SetMultimap<String, String> getKubernetesRegionToZoneInfo() {
JsonNode nodeInfos = kubernetesManager.getNodeInfos(null);
MultiValuedMap<String, String> regionToAZ = new HashSetValuedHashMap<>();
SetMultimap<String, String> regionToAZ = HashMultimap.create();
for (JsonNode nodeInfo : nodeInfos.path("items")) {
JsonNode nodeLabels = nodeInfo.path("metadata").path("labels");
// failure-domain.beta.k8s.io is deprecated as of 1.17
Expand Down