Skip to content

Commit

Permalink
Remove hppc from http server transport
Browse files Browse the repository at this point in the history
The http server transport uses an hppc integer set to find the first
open port. This commit changes it to use a standard HashSet.

relates elastic#84735
  • Loading branch information
rjernst committed Apr 20, 2022
1 parent b2c9028 commit 4186dd9
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

package org.elasticsearch.http;

import com.carrotsearch.hppc.IntHashSet;
import com.carrotsearch.hppc.IntSet;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -51,6 +48,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -260,12 +258,12 @@ static int resolvePublishPort(Settings settings, List<TransportAddress> boundAdd

// if no matching boundAddress found, check if there is a unique port for all bound addresses
if (publishPort < 0) {
final IntSet ports = new IntHashSet();
final Set<Integer> ports = new HashSet<>();
for (TransportAddress boundAddress : boundAddresses) {
ports.add(boundAddress.getPort());
}
if (ports.size() == 1) {
publishPort = ports.iterator().next().value;
publishPort = ports.iterator().next();
}
}

Expand Down

0 comments on commit 4186dd9

Please sign in to comment.