public class IntegrationTestingUtility extends HBaseTestingUtility
HBaseTestingUtility
and adds-in the functionality needed by integration and system tests. This class understands
distributed and pseudo-distributed/local cluster deployments, and abstracts those from the tests
in this module.
IntegrationTestingUtility is constructed and used by the integration tests, but the tests
themselves should not assume a particular deployment. They can rely on the methods in this
class and HBaseCluster. Before the testing begins, the test should initialize the cluster by
calling initializeCluster(int)
.
The cluster that is used defaults to a mini cluster, but it can be forced to use a distributed
cluster by calling setUseDistributedCluster(Configuration)
. This method is invoked by
test drivers (maven, IntegrationTestsDriver, etc) before initializing the cluster
via initializeCluster(int)
. Individual tests should not directly call
setUseDistributedCluster(Configuration)
.
HBaseTestingUtility.SeenRowTracker
Modifier and Type | Field and Description |
---|---|
static String |
IS_DISTRIBUTED_CLUSTER
Configuration that controls whether this utility assumes a running/deployed cluster.
|
BLOOM_AND_COMPRESSION_COMBINATIONS, BOOLEAN_PARAMETERIZED, COLUMNS, COMPRESSION_ALGORITHMS, COMPRESSION_ALGORITHMS_PARAMETERIZED, DEFAULT_REGIONS_PER_SERVER, fam1, fam2, fam3, FIRST_CHAR, KEYS, KEYS_FOR_HBA_CREATE_TABLE, LAST_CHAR, MEMSTORETS_TAGS_PARAMETRIZED, REGIONS_PER_SERVER_KEY, ROWS, START_KEY, START_KEY_BYTES
BASE_TEST_DIRECTORY_KEY, conf, DEFAULT_BASE_TEST_DIRECTORY, LOG
Constructor and Description |
---|
IntegrationTestingUtility() |
IntegrationTestingUtility(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
checkNodeCount(int numSlaves)
Checks whether we have more than numSlaves nodes.
|
void |
createDistributedHBaseCluster() |
void |
initializeCluster(int numSlaves)
Initializes the state of the cluster.
|
boolean |
isDistributedCluster() |
void |
restoreCluster()
Restores the cluster to the initial state if it is a distributed cluster, otherwise, shutdowns the
mini cluster.
|
static void |
setUseDistributedCluster(Configuration conf)
Sets the configuration property to use a distributed cluster for the integration tests.
|
assertKVListsEqual, assertRegionOnlyOnServer, assertRegionOnServer, checksumRows, cleanupDataTestDirOnTestFS, cleanupDataTestDirOnTestFS, cleanupTestDir, closeRegion, closeRegion, closeRegion, closeRegionAndWAL, closeRegionAndWAL, closeRegionByRow, closeRegionByRow, compact, compact, countRows, countRows, countRows, createAndForceNodeToOpenedState, createAndForceNodeToOpenedState, createHRegion, createLocalHRegion, createLocalHRegion, createLocalHRegion, createLocalHRegion, createLocalHTU, createLocalHTU, createMockRegionServerService, createMockRegionServerService, createMockRegionServerService, createMultiRegionsInMeta, createMultiRegionTable, createMultiRegionTable, createMultiRegionTable, createMultiRegionTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createRandomTable, createRegionAndWAL, createRegionAndWAL, createRootDir, createRootDir, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTableDescriptor, createTableDescriptor, createTestRegion, createWal, deleteNumericRows, deleteTable, deleteTable, deleteTable, deleteTableData, deleteTableData, deleteTableIfAny, enableDebug, ensureSomeNonStoppedRegionServersAvailable, ensureSomeRegionServersAvailable, expireMasterSession, expireRegionServerSession, expireSession, expireSession, expireSession, explainTableAvailability, explainTableState, flush, flush, generateColumnDescriptors, generateColumnDescriptors, getAllOnlineRegions, getClusterKey, getConfiguration, getConnection, getDataTestDirOnTestFS, getDataTestDirOnTestFS, getDefaultRootDirPath, getDefaultRootDirPath, getDFSCluster, getDifferentUser, getFromStoreFile, getFromStoreFile, getHBaseAdmin, getHBaseCluster, getHBaseClusterInterface, getMetaRSPort, getMetaTableDescriptor, getMetaTableRows, getMetaTableRows, getMiniHBaseCluster, getRegionSplitStartKeys, getRSForFirstRegionInTable, getSplittableRegion, getSupportedCompressionAlgorithms, getTestFileSystem, getZkCluster, getZooKeeperWatcher, getZooKeeperWatcher, isReadShortCircuitOn, loadNumericRows, loadRegion, loadRegion, loadRegion, loadTable, loadTable, loadTable, loadTable, loadTable, modifyTableSync, predicateNoRegionsInTransition, predicateTableAvailable, predicateTableDisabled, predicateTableEnabled, randomFreePort, randomMultiCastAddress, randomPort, restartHBaseCluster, safeGetAsStr, setDFSCluster, setDFSCluster, setFileSystemURI, setHBaseCluster, setMaxRecoveryErrorCount, setReplicas, setupDataTestDir, setZkCluster, shutdownMiniCluster, shutdownMiniDFSCluster, shutdownMiniHBaseCluster, shutdownMiniMapReduceCluster, shutdownMiniZKCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniDFSCluster, startMiniDFSCluster, startMiniDFSCluster, startMiniDFSCluster, startMiniDFSClusterForTestWAL, startMiniHBaseCluster, startMiniHBaseCluster, startMiniMapReduceCluster, startMiniZKCluster, startMiniZKCluster, truncateTable, truncateTable, truncateTable, truncateTable, verifyNumericRows, verifyNumericRows, verifyNumericRows, verifyNumericRows, verifyNumericRows, waitFor, waitFor, waitFor, waitForHostPort, waitLabelAvailable, waitTableAvailable, waitTableAvailable, waitTableAvailable, waitTableAvailable, waitTableDisabled, waitTableDisabled, waitTableDisabled, waitTableDisabled, waitTableEnabled, waitTableEnabled, waitTableEnabled, waitUntilAllRegionsAssigned, waitUntilAllRegionsAssigned, waitUntilNoRegionsInTransition
createSubDir, getDataTestDir, getDataTestDir
public static final String IS_DISTRIBUTED_CLUSTER
public IntegrationTestingUtility()
public IntegrationTestingUtility(Configuration conf)
public void initializeCluster(int numSlaves) throws Exception
numSlaves
- Number of slaves to start up if we are booting a mini cluster. Otherwise
we check whether this many nodes are available and throw an exception if not.Exception
public void checkNodeCount(int numSlaves) throws Exception
Exception
public void restoreCluster() throws IOException
IOException
public static void setUseDistributedCluster(Configuration conf)
public boolean isDistributedCluster()
setUseDistributedCluster(Configuration)
public void createDistributedHBaseCluster() throws IOException
IOException