Package org.apache.hadoop.hbase
Class HBaseCommonTestingUtility.PortAllocator
java.lang.Object
org.apache.hadoop.hbase.HBaseCommonTestingUtility.PortAllocator
- Enclosing class:
- HBaseCommonTestingUtility
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static interface
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private static final int
A set of ports that have been claimed usingrandomFreePort()
. -
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionint
Returns a random free port and marks that port as taken.private int
Returns a random port.
-
Field Details
-
MIN_RANDOM_PORT
- See Also:
-
MAX_RANDOM_PORT
- See Also:
-
takenRandomPorts
A set of ports that have been claimed usingrandomFreePort()
. -
portChecker
-
-
Constructor Details
-
PortAllocator
public PortAllocator() -
PortAllocator
-
-
Method Details
-
randomFreePort
Returns a random free port and marks that port as taken. Not thread-safe. Expected to be called from single-threaded test setup code/ -
randomPort
Returns a random port. These ports cannot be registered with IANA and are intended for dynamic allocation (see http://bit.ly/dynports).
-