Skip to content

Commit c8ccc3d

Browse files
authored
Remove hppc from tcp transport (#85843)
The TcpTransport uses an hppc int set when falling back to determine if there is a unique port bound. Since the expectation is this is a single value, the map should be very small. This commit switches to using a HashSet. relates #84735
1 parent 2da5d75 commit c8ccc3d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

server/src/main/java/org/elasticsearch/transport/TcpTransport.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
*/
88
package org.elasticsearch.transport;
99

10-
import com.carrotsearch.hppc.IntHashSet;
11-
import com.carrotsearch.hppc.IntSet;
12-
1310
import org.apache.logging.log4j.Level;
1411
import org.apache.logging.log4j.LogManager;
1512
import org.apache.logging.log4j.Logger;
@@ -545,12 +542,12 @@ static int resolvePublishPort(ProfileSettings profileSettings, List<InetSocketAd
545542

546543
// if no matching boundAddress found, check if there is a unique port for all bound addresses
547544
if (publishPort < 0) {
548-
final IntSet ports = new IntHashSet();
545+
final Set<Integer> ports = new HashSet<>();
549546
for (InetSocketAddress boundAddress : boundAddresses) {
550547
ports.add(boundAddress.getPort());
551548
}
552549
if (ports.size() == 1) {
553-
publishPort = ports.iterator().next().value;
550+
publishPort = ports.iterator().next();
554551
}
555552
}
556553

0 commit comments

Comments
 (0)