public class ReachableSocketFinder
extends java.lang.Object
Constructor and Description |
---|
ReachableSocketFinder(com.google.common.util.concurrent.ListeningExecutorService userExecutor) |
ReachableSocketFinder(com.google.common.base.Predicate<? super com.google.common.net.HostAndPort> socketTester,
com.google.common.util.concurrent.ListeningExecutorService userExecutor) |
Modifier and Type | Method and Description |
---|---|
com.google.common.net.HostAndPort |
findOpenSocketOnNode(java.util.Collection<? extends com.google.common.net.HostAndPort> sockets,
Duration timeout) |
public ReachableSocketFinder(com.google.common.util.concurrent.ListeningExecutorService userExecutor)
public ReachableSocketFinder(com.google.common.base.Predicate<? super com.google.common.net.HostAndPort> socketTester, com.google.common.util.concurrent.ListeningExecutorService userExecutor)
public com.google.common.net.HostAndPort findOpenSocketOnNode(java.util.Collection<? extends com.google.common.net.HostAndPort> sockets, Duration timeout)
sockets
- The host-and-ports to testtimeout
- Max time to try to connect to the ip:portjava.util.NoSuchElementException
- If no ports accessible within the given timejava.lang.NullPointerException
- If the sockets or duration is nulljava.lang.IllegalStateException
- If the sockets to test is empty