@InterfaceAudience.Public public class HBaseCommonTestingUtility extends Object
HBaseCommonTestingUtility
Modifier and Type | Class and Description |
---|---|
(package private) static class |
HBaseCommonTestingUtility.PortAllocator |
Modifier and Type | Field and Description |
---|---|
static String |
BASE_TEST_DIRECTORY_KEY
System property key to get base test directory value
|
static List<Object[]> |
BOOLEAN_PARAMETERIZED
This is for unit tests parameterized with a two booleans.
|
static org.apache.hadoop.hbase.io.compress.Compression.Algorithm[] |
COMPRESSION_ALGORITHMS
Compression algorithms to use in testing
|
static List<Object[]> |
COMPRESSION_ALGORITHMS_PARAMETERIZED
Compression algorithms to use in parameterized JUnit 4 tests
|
protected org.apache.hadoop.conf.Configuration |
conf |
private File |
dataTestDir
Directory where we put the data for this instance of HBaseTestingUtility
|
static String |
DEFAULT_BASE_TEST_DIRECTORY
Default base directory for test output.
|
protected static org.slf4j.Logger |
LOG |
private static HBaseCommonTestingUtility.PortAllocator |
portAllocator |
(package private) static Random |
random |
Constructor and Description |
---|
HBaseCommonTestingUtility() |
HBaseCommonTestingUtility(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
boolean |
cleanupTestDir() |
(package private) boolean |
cleanupTestDir(String subdir) |
protected void |
createSubDir(String propertyName,
org.apache.hadoop.fs.Path parent,
String subDirName) |
(package private) boolean |
deleteDir(File dir) |
(package private) boolean |
deleteOnExit() |
private org.apache.hadoop.fs.Path |
getBaseTestDir() |
org.apache.hadoop.conf.Configuration |
getConfiguration()
Returns this classes's instance of
Configuration . |
org.apache.hadoop.fs.Path |
getDataTestDir() |
org.apache.hadoop.fs.Path |
getDataTestDir(String name) |
org.apache.hadoop.fs.Path |
getRandomDir() |
static UUID |
getRandomUUID() |
static int |
randomFreePort() |
protected org.apache.hadoop.fs.Path |
setupDataTestDir()
Sets up a directory for a test to use.
|
<E extends Exception> |
waitFor(long timeout,
long interval,
boolean failIfTimeout,
Waiter.Predicate<E> predicate)
Wrapper method for
Waiter.waitFor(Configuration, long, long, boolean, Predicate) . |
<E extends Exception> |
waitFor(long timeout,
long interval,
Waiter.Predicate<E> predicate)
Wrapper method for
Waiter.waitFor(Configuration, long, long, Predicate) . |
<E extends Exception> |
waitFor(long timeout,
Waiter.Predicate<E> predicate)
Wrapper method for
Waiter.waitFor(Configuration, long, Predicate) . |
protected static final org.slf4j.Logger LOG
public static final List<Object[]> COMPRESSION_ALGORITHMS_PARAMETERIZED
public static final List<Object[]> BOOLEAN_PARAMETERIZED
public static final org.apache.hadoop.hbase.io.compress.Compression.Algorithm[] COMPRESSION_ALGORITHMS
protected org.apache.hadoop.conf.Configuration conf
public static final String BASE_TEST_DIRECTORY_KEY
public static final String DEFAULT_BASE_TEST_DIRECTORY
private File dataTestDir
private static final HBaseCommonTestingUtility.PortAllocator portAllocator
public HBaseCommonTestingUtility()
public HBaseCommonTestingUtility(org.apache.hadoop.conf.Configuration conf)
public org.apache.hadoop.conf.Configuration getConfiguration()
Configuration
.public org.apache.hadoop.fs.Path getDataTestDir()
public org.apache.hadoop.fs.Path getDataTestDir(String name)
name
- the name of a subdirectory or file in the test data directorygetDataTestDir()
. Does *NOT* create the directory or file if it does not exist.protected org.apache.hadoop.fs.Path setupDataTestDir()
public org.apache.hadoop.fs.Path getRandomDir()
getBaseTestDir()
public static UUID getRandomUUID()
protected void createSubDir(String propertyName, org.apache.hadoop.fs.Path parent, String subDirName)
boolean deleteOnExit()
public boolean cleanupTestDir()
boolean cleanupTestDir(String subdir)
subdir
- Test subdir name.private org.apache.hadoop.fs.Path getBaseTestDir()
DEFAULT_BASE_TEST_DIRECTORY
Should not be used by the unit tests, hence its's private.
Unit test will use a subdirectory of this directory.setupDataTestDir()
boolean deleteDir(File dir)
dir
- Directory to deletepublic <E extends Exception> long waitFor(long timeout, Waiter.Predicate<E> predicate) throws E extends Exception
Waiter.waitFor(Configuration, long, Predicate)
.E extends Exception
public <E extends Exception> long waitFor(long timeout, long interval, Waiter.Predicate<E> predicate) throws E extends Exception
Waiter.waitFor(Configuration, long, long, Predicate)
.E extends Exception
public <E extends Exception> long waitFor(long timeout, long interval, boolean failIfTimeout, Waiter.Predicate<E> predicate) throws E extends Exception
Waiter.waitFor(Configuration, long, long, boolean, Predicate)
.E extends Exception
public static int randomFreePort()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.