static class HBaseTestingUtility.PortAllocator extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
HBaseTestingUtility.PortAllocator.AvailablePortChecker |
Modifier and Type | Field and Description |
---|---|
private static int |
MAX_RANDOM_PORT |
private static int |
MIN_RANDOM_PORT |
private HBaseTestingUtility.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,
HBaseTestingUtility.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 HBaseTestingUtility.PortAllocator.AvailablePortChecker portChecker
public PortAllocator(Random random)
public PortAllocator(Random random, HBaseTestingUtility.PortAllocator.AvailablePortChecker portChecker)
public int randomFreePort()
private int randomPort()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.