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
HBaseCommonTestingUtility.PortAllocator
Modifier and Type | Field and Description |
---|---|
private static Class<? extends ClusterManager> |
DEFAULT_HBASE_CLUSTER_MANAGER_CLASS |
static String |
HBASE_CLUSTER_MANAGER_CLASS
Config for pluggable hbase cluster manager.
|
static String |
IS_DISTRIBUTED_CLUSTER
Configuration that controls whether this utility assumes a running/deployed cluster.
|
BLOOM_AND_COMPRESSION_COMBINATIONS, COLUMNS, DEFAULT_REGIONS_PER_SERVER, fam1, fam2, fam3, FIRST_CHAR, KEYS, KEYS_FOR_HBA_CREATE_TABLE, LAST_CHAR, MEMSTORETS_TAGS_PARAMETRIZED, PRESPLIT_TEST_TABLE, PRESPLIT_TEST_TABLE_KEY, REGIONS_PER_SERVER_KEY, ROWS, START_KEY, START_KEY_BYTES
clusterTestDir, zooKeeperWatcher
BASE_TEST_DIRECTORY_KEY, BOOLEAN_PARAMETERIZED, COMPRESSION_ALGORITHMS, COMPRESSION_ALGORITHMS_PARAMETERIZED, conf, DEFAULT_BASE_TEST_DIRECTORY, LOG
Constructor and Description |
---|
IntegrationTestingUtility() |
IntegrationTestingUtility(org.apache.hadoop.conf.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()
Returns whether we are interacting with a distributed cluster as opposed to and in-process mini
cluster or a local cluster.
|
void |
restoreCluster()
Restores the cluster to the initial state if it is a distributed cluster, otherwise, shutdowns
the mini cluster.
|
static void |
setUseDistributedCluster(org.apache.hadoop.conf.Configuration conf)
Sets the configuration property to use a distributed cluster for the integration tests.
|
assertKVListsEqual, assertRegionOnlyOnServer, assertRegionOnServer, assignRegion, available, await, checksumRows, cleanupDataTestDirOnTestFS, cleanupDataTestDirOnTestFS, closeConnection, closeRegionAndWAL, closeRegionAndWAL, compact, compact, countRows, countRows, countRows, countRows, countRows, countRows, countRows, createLocalHRegion, createLocalHRegion, createLocalHRegion, createLocalHRegion, createLocalHRegion, createLocalHRegion, createLocalHRegionWithInMemoryFlags, createLocalHTU, createLocalHTU, createMockRegionServerService, createMockRegionServerService, createMockRegionServerService, createModifyableTableDescriptor, createModifyableTableDescriptor, createMultiRegionsInMeta, createMultiRegionsInMeta, createMultiRegionTable, createMultiRegionTable, createMultiRegionTable, createMultiRegionTable, createMultiRegionTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createPreSplitLoadTestTable, createRandomTable, createRegionAndWAL, createRegionAndWAL, createRegionAndWAL, createRegionAndWAL, createRootDir, createRootDir, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTable, createTableDescriptor, createTableDescriptor, createTableDescriptor, createTableDescriptor, createTableDescriptor, createTableDescriptor, createTestRegion, createTestRegion, createWal, createWALRootDir, deleteNumericRows, deleteTable, deleteTableData, deleteTableIfAny, enableDebug, ensureSomeNonStoppedRegionServersAvailable, ensureSomeRegionServersAvailable, expireMasterSession, expireRegionServerSession, expireSession, expireSession, explainTableAvailability, explainTableState, findLastTableState, flush, flush, generateColumnDescriptors, generateColumnDescriptors, getAdmin, getAllOnlineRegions, getClosestRowBefore, getClusterKey, getConfiguration, getConnection, getDataTestDirOnTestFS, getDataTestDirOnTestFS, getDefaultRootDirPath, getDefaultRootDirPath, getDFSCluster, getDifferentUser, getFromStoreFile, getFromStoreFile, getHBaseAdmin, getHBaseCluster, getHBaseClusterInterface, getHbck, getMetaRSPort, getMetaTableDescriptor, getMetaTableDescriptorBuilder, getMetaTableRows, getMetaTableRows, getMiniHBaseCluster, getNumHFiles, getNumHFilesForRS, getOtherRegionServer, getRegionSplitStartKeys, getRSForFirstRegionInTable, getSplittableRegion, getSupportedCompressionAlgorithms, getTestFileSystem, invalidateConnection, isNewVersionBehaviorEnabled, isReadShortCircuitOn, killMiniHBaseCluster, loadNumericRows, loadRandomRows, loadRegion, loadRegion, loadRegion, loadTable, loadTable, loadTable, loadTable, loadTable, memStoreTSTagsAndOffheapCombination, modifyTableSync, moveRegionAndWait, predicateNoRegionsInTransition, predicateTableAvailable, predicateTableDisabled, predicateTableEnabled, randomFreePort, randomMultiCastAddress, restartHBaseCluster, restartHBaseCluster, restartHBaseCluster, safeGetAsStr, setDFSCluster, setDFSCluster, setFileSystemURI, setHBaseCluster, setMaxRecoveryErrorCount, setReplicas, setReplicas, setupDataTestDir, setupMiniKdc, shutdownMiniCluster, shutdownMiniDFSCluster, shutdownMiniHBaseCluster, shutdownMiniMapReduceCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniCluster, startMiniDFSCluster, startMiniDFSCluster, startMiniDFSCluster, startMiniDFSCluster, startMiniDFSClusterForTestWAL, startMiniHBaseCluster, startMiniHBaseCluster, startMiniHBaseCluster, startMiniHBaseCluster, startMiniHBaseCluster, startMiniMapReduceCluster, truncateTable, truncateTable, unassignRegion, unassignRegion, unassignRegionByRow, unassignRegionByRow, verifyNumericRows, verifyNumericRows, verifyNumericRows, verifyNumericRows, verifyNumericRows, verifyTableDescriptorIgnoreTableName, waitForHostPort, waitLabelAvailable, waitTableAvailable, waitTableAvailable, waitTableAvailable, waitTableDisabled, waitTableDisabled, waitTableDisabled, waitTableEnabled, waitTableEnabled, waitTableEnabled, waitUntilAllRegionsAssigned, waitUntilAllRegionsAssigned, waitUntilAllSystemRegionsAssigned, waitUntilNoRegionsInTransition, waitUntilNoRegionsInTransition
cleanupTestDir, getClusterTestDir, getZkCluster, getZooKeeperWatcher, getZooKeeperWatcher, setupClusterTestDir, setZkCluster, shutdownMiniZKCluster, startMiniZKCluster, startMiniZKCluster
cleanupTestDir, createSubDir, deleteDir, deleteOnExit, getDataTestDir, getDataTestDir, getRandomDir, getRandomUUID, waitFor, waitFor, waitFor
public static final String IS_DISTRIBUTED_CLUSTER
public static final String HBASE_CLUSTER_MANAGER_CLASS
private static final Class<? extends ClusterManager> DEFAULT_HBASE_CLUSTER_MANAGER_CLASS
public IntegrationTestingUtility()
public IntegrationTestingUtility(org.apache.hadoop.conf.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(org.apache.hadoop.conf.Configuration conf)
public boolean isDistributedCluster()
setUseDistributedCluster(Configuration)
public void createDistributedHBaseCluster() throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.