static class HBaseCommonTestingUtility.PortAllocator extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
HBaseCommonTestingUtility.PortAllocator.AvailablePortChecker |
Modifier and Type | Field and Description |
---|---|
private static int |
MAX_RANDOM_PORT |
private static int |
MIN_RANDOM_PORT |
private HBaseCommonTestingUtility.PortAllocator.AvailablePortChecker |
portChecker |
private Random |
random |
private Set<Integer> |
takenRandomPorts
A set of ports that have been claimed using
randomFreePort() . |
Constructor and Description |
---|
PortAllocator(Random random) |
PortAllocator(Random random,
HBaseCommonTestingUtility.PortAllocator.AvailablePortChecker portChecker) |
Modifier and Type | Method and Description |
---|---|
int |
randomFreePort()
Returns a random free port and marks that port as taken.
|
private int |
randomPort()
Returns a random port.
|
private static final int MIN_RANDOM_PORT
private static final int MAX_RANDOM_PORT
private final Set<Integer> takenRandomPorts
randomFreePort()
.private final HBaseCommonTestingUtility.PortAllocator.AvailablePortChecker portChecker
public PortAllocator(Random random)
public PortAllocator(Random random, HBaseCommonTestingUtility.PortAllocator.AvailablePortChecker portChecker)
public int randomFreePort()
private int randomPort()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.