Class HBaseTestingUtility
MiniHBaseCluster, or a deployed cluster of type
DistributedHBaseCluster. Not all methods work with the real cluster. Depends on log4j
being on classpath and hbase-site.xml for logging and test-run configuration. It does not set
logging levels. In the configuration properties, default values for master-info-port and
region-server-port are overridden such that a random port will be assigned (thus avoiding port
contention if another local HBase instance is already running).
To preserve test data directories, pass the system property "hbase.testing.preserve.testdir" setting it to true.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classDeprecated.static classDeprecated.A tracker for tracking and validating table rows generated withloadTable(Table, byte[])Nested classes/interfaces inherited from class org.apache.hadoop.hbase.HBaseCommonTestingUtility
HBaseCommonTestingUtility.PortAllocator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference<AsyncClusterConnection>Deprecated.static final Collection<Object[]>Deprecated.static final byte[][]Deprecated.private org.apache.hadoop.fs.PathDeprecated.Directory on test filesystem where we put the data for this instance of HBaseTestingUtilitystatic final intDeprecated.The default number of regions per regionserver when creating a pre-split table.private org.apache.hadoop.hdfs.MiniDFSClusterDeprecated.Deprecated.static final byte[]Deprecated.static final byte[]Deprecated.static final byte[]Deprecated.static final charDeprecated.private static StringDeprecated.Filesystem URI used for map-reduce mini-cluster setupprivate StringDeprecated.private AdminDeprecated.private HBaseClusterDeprecated.static final byte[][]Deprecated.static final byte[][]Deprecated.static final charDeprecated.private static final intDeprecated.Deprecated.This is for unit tests parameterized with a single boolean.private booleanDeprecated.If there is a mini cluster running for this testing utility instance.private org.apache.hadoop.mapred.MiniMRClusterDeprecated.static final StringDeprecated.static final byte[][]Deprecated.All the row values for the data loaded byloadTable(Table, byte[])static final StringDeprecated.static final byte[]Deprecated.Fields inherited from class org.apache.hadoop.hbase.HBaseZKTestingUtility
clusterTestDir, zooKeeperWatcherFields inherited from class org.apache.hadoop.hbase.HBaseCommonTestingUtility
BASE_TEST_DIRECTORY_KEY, BOOLEAN_PARAMETERIZED, COMPRESSION_ALGORITHMS, COMPRESSION_ALGORITHMS_PARAMETERIZED, conf, DEFAULT_BASE_TEST_DIRECTORY, LOG -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Create an HBaseTestingUtility using a default configuration.HBaseTestingUtility(org.apache.hadoop.conf.Configuration conf) Deprecated.Create an HBaseTestingUtility using a given configuration. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertEquals(String message, int expected, int actual) Deprecated.static voidassertKVListsEqual(String additionalMsg, List<? extends Cell> expected, List<? extends Cell> actual) Deprecated.voidassertRegionOnlyOnServer(RegionInfo hri, ServerName server, long timeout) Deprecated.Check to make sure the region is open on the specified region server, but not on any other one.voidassertRegionOnServer(RegionInfo hri, ServerName server, long timeout) Deprecated.Due to async racing issue, a region may not be in the online region list of a region server yet, after the assignment znode is deleted and the new assignment is recorded in master.booleanassignRegion(RegionInfo regionInfo) Deprecated.Uses directly the assignment manager to assign the region.static booleanavailable(int port) Deprecated.Checks to see if a specific port is available.static voidawait(long sleepMillis, BooleanSupplier condition) Deprecated.Await the successful return ofcondition, sleepingsleepMillisbetween invocations.Deprecated.Create all combinations of Bloom filters and compression algorithms for testing.checksumRows(Table table) Deprecated.Return an md5 digest of the entire contents of a table.private voidcleanup()Deprecated.booleanDeprecated.Cleans the test data directory on the test filesystem.booleancleanupDataTestDirOnTestFS(String subdirName) Deprecated.Cleans a subdirectory under the test data directory on the test filesystem.voidDeprecated.static voidDeprecated.Close both the HRegionrand it's underlying WAL.static voidDeprecated.Close both the regionrand it's underlying WAL.voidcompact(boolean major) Deprecated.Compact all regions in the mini hbase clustervoidDeprecated.Compact all of a table's reagion in the mini hbase clusterstatic intDeprecated.Return the number of rows in the given table.intDeprecated.static intDeprecated.intcountRows(InternalScanner scanner) Deprecated.intDeprecated.intDeprecated.intDeprecated.Return the number of rows in the given table.private StringcreateDirAndSetProperty(String property) Deprecated.private StringcreateDirAndSetProperty(String relPath, String property) Deprecated.private voidDeprecated.This is used before starting HDFS and map-reduce mini-clusters Run something like the below to check for the likes of '/tmp' references -- i.e.createLocalHRegion(RegionInfo info, org.apache.hadoop.conf.Configuration conf, TableDescriptor desc, WAL wal) Deprecated.Create an HRegion that writes to the local tmp dirs with specified walcreateLocalHRegion(RegionInfo info, TableDescriptor desc) Deprecated.Create an HRegion that writes to the local tmp dirs.createLocalHRegion(TableDescriptor desc, byte[] startKey, byte[] endKey) Deprecated.Create an HRegion that writes to the local tmp dirscreateLocalHRegion(TableName tableName, byte[] startKey, byte[] stopKey, org.apache.hadoop.conf.Configuration conf, boolean isReadOnly, Durability durability, WAL wal, byte[]... families) Deprecated.Return a region on which you must callcloseRegionAndWAL(HRegion)when done.createLocalHRegionWithInMemoryFlags(TableName tableName, byte[] startKey, byte[] stopKey, org.apache.hadoop.conf.Configuration conf, boolean isReadOnly, Durability durability, WAL wal, boolean[] compactedMemStore, byte[]... families) Deprecated.Deprecated.Create a stubbed out RegionServerService, mainly for getting FS.Deprecated.Create a stubbed out RegionServerService, mainly for getting FS.Deprecated.Create a stubbed out RegionServerService, mainly for getting FS.Deprecated.createModifyableTableDescriptor(TableName name, int minVersions, int versions, int ttl, KeepDeletedCells keepDeleted) Deprecated.createMultiRegionsInMeta(org.apache.hadoop.conf.Configuration conf, TableDescriptor htd, byte[][] startKeys) Deprecated.Create rows in hbase:meta for regions of the specified table with the specified start keys.createMultiRegionTable(TableName tableName, byte[] family) Deprecated.Create a table with multiple regions.createMultiRegionTable(TableName tableName, byte[][] families) Deprecated.Create a table with multiple regions.createMultiRegionTable(TableName tableName, byte[][] families, int numVersions) Deprecated.Create a table with multiple regions.createMultiRegionTable(TableName tableName, byte[] family, int numRegions) Deprecated.Create a table with multiple regions.createMultiRegionTable(TableName tableName, int replicaCount, byte[][] families) Deprecated.Create a table with multiple regions.static intcreatePreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor desc, ColumnFamilyDescriptor hcd) Deprecated.Creates a pre-split table for load testing.static intcreatePreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor desc, ColumnFamilyDescriptor[] hcds, int numRegionsPerServer) Deprecated.Creates a pre-split table for load testing.static intcreatePreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor td, ColumnFamilyDescriptor[] cds, RegionSplitter.SplitAlgorithm splitter, int numRegionsPerServer) Deprecated.Creates a pre-split table for load testing.static intcreatePreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor desc, ColumnFamilyDescriptor hcd, int numRegionsPerServer) Deprecated.Creates a pre-split table for load testing.static intcreatePreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableName tableName, byte[][] columnFamilies, Compression.Algorithm compression, DataBlockEncoding dataBlockEncoding, int numRegionsPerServer, int regionReplication, Durability durability) Deprecated.Creates a pre-split table for load testing.static intcreatePreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableName tableName, byte[] columnFamily, Compression.Algorithm compression, DataBlockEncoding dataBlockEncoding) Deprecated.Creates a pre-split table for load testing.static intcreatePreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableName tableName, byte[] columnFamily, Compression.Algorithm compression, DataBlockEncoding dataBlockEncoding, int numRegionsPerServer, int regionReplication, Durability durability) Deprecated.Creates a pre-split table for load testing.createRandomTable(TableName tableName, Collection<String> families, int maxVersions, int numColsPerRow, int numFlushes, int numRegions, int numRowsPerFlush) Deprecated.Creates a random table with the given parametersstatic HRegioncreateRegionAndWAL(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor htd) Deprecated.Create a region with it's own WAL.static HRegioncreateRegionAndWAL(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor htd, boolean initialize) Deprecated.Create a region with it's own WAL.static HRegioncreateRegionAndWAL(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor htd, BlockCache blockCache) Deprecated.Create a region with it's own WAL.static HRegioncreateRegionAndWAL(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor htd, MobFileCache mobFileCache) Deprecated.Create a region with it's own WAL.org.apache.hadoop.fs.PathDeprecated.Same ascreateRootDir(boolean create)except thatcreateflag is false.org.apache.hadoop.fs.PathcreateRootDir(boolean create) Deprecated.Creates an hbase rootdir in user home directory.private voidcreateSubDirAndSystemProperty(String propertyName, org.apache.hadoop.fs.Path parent, String subDirName) Deprecated.createTable(TableDescriptor htd, byte[][] splitRows) Deprecated.Create a table.createTable(TableDescriptor htd, byte[][] families, byte[][] splitKeys, org.apache.hadoop.conf.Configuration c) Deprecated.Create a table.createTable(TableDescriptor htd, byte[][] families, byte[][] splitKeys, BloomType type, int blockSize, org.apache.hadoop.conf.Configuration c) Deprecated.Create a table.createTable(TableDescriptor htd, byte[][] families, org.apache.hadoop.conf.Configuration c) Deprecated.Create a table.createTable(TableName tableName, byte[] family) Deprecated.Create a table.createTable(TableName tableName, byte[][] families) Deprecated.Create a table.createTable(TableName tableName, byte[][] families, byte[][] splitKeys) Deprecated.Create a table.createTable(TableName tableName, byte[][] families, byte[][] splitKeys, int replicaCount) Deprecated.Create a table.createTable(TableName tableName, byte[][] families, byte[][] splitKeys, int replicaCount, org.apache.hadoop.conf.Configuration c) Deprecated.Create a table.createTable(TableName tableName, byte[][] families, int numVersions) Deprecated.Create a table.createTable(TableName tableName, byte[][] families, int[] numVersions) Deprecated.Create a table.createTable(TableName tableName, byte[][] families, int numVersions, byte[][] splitKeys) Deprecated.Create a table.createTable(TableName tableName, byte[][] families, int numVersions, byte[] startKey, byte[] endKey, int numRegions) Deprecated.createTable(TableName tableName, byte[][] families, int numVersions, int blockSize) Deprecated.Create a table.createTable(TableName tableName, byte[][] families, int numVersions, int blockSize, String cpName) Deprecated.createTable(TableName tableName, byte[] family, byte[][] splitRows) Deprecated.Create a table.createTable(TableName tableName, byte[] family, int numVersions) Deprecated.Create a table.createTable(TableName tableName, String family) Deprecated.Create a table.createTable(TableName tableName, String[] families) Deprecated.Create a table.Deprecated.Create a table of namename.createTableDescriptor(TableName tableName, byte[] family) Deprecated.createTableDescriptor(TableName tableName, byte[][] families, int maxVersions) Deprecated.createTableDescriptor(TableName name, int minVersions, int versions, int ttl, KeepDeletedCells keepDeleted) Deprecated.createTestRegion(String tableName, ColumnFamilyDescriptor cd) Deprecated.createTestRegion(String tableName, ColumnFamilyDescriptor cd, BlockCache blockCache) Deprecated.static WALcreateWal(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, RegionInfo hri) Deprecated.Create an unmanaged WAL.org.apache.hadoop.fs.PathDeprecated.Creates a hbase walDir in the user's home directory.private voidDeprecated.private voiddecrementMinRegionServerCount(org.apache.hadoop.conf.Configuration conf) Deprecated.voiddeleteNumericRows(Table t, byte[] f, int startRow, int endRow) Deprecated.voiddeleteTable(TableName tableName) Deprecated.Drop an existing tabledeleteTableData(TableName tableName) Deprecated.Provide an existing table name to truncate.voiddeleteTableIfAny(TableName tableName) Deprecated.Drop an existing tablevoidenableDebug(Class<?> clazz) Deprecated.In 2.3.0, will be removed in 4.0.0.private voidDeprecated.Enable the short circuit read, unless configured differently.booleanDeprecated.Make sure that at least the specified number of region servers are running.booleanensureSomeRegionServersAvailable(int num) Deprecated.Make sure that at least the specified number of region servers are runningvoidDeprecated.Expire the Master's sessionvoidexpireRegionServerSession(int index) Deprecated.Expire a region server's sessionvoidexpireSession(ZKWatcher nodeZK) Deprecated.voidexpireSession(ZKWatcher nodeZK, boolean checkStatus) Deprecated.Expire a ZooKeeper session as recommended in ZooKeeper documentation http://hbase.apache.org/book.html#trouble.zookeeper There are issues when doing this: [1] http://www.mail-archive.com/dev@zookeeper.apache.org/msg01942.html [2] https://issues.apache.org/jira/browse/ZOOKEEPER-1105explainTableAvailability(TableName tableName) Deprecated.explainTableState(TableName table, TableState.State state) Deprecated.findLastTableState(TableName table) Deprecated.voidflush()Deprecated.Flushes all caches in the mini hbase clustervoidDeprecated.Flushes all caches in the mini hbase clusterprivate voidDeprecated.Tasktracker has a bug where changing the hadoop.log.dir system property will not change its internal static LOG_DIR variable.static List<ColumnFamilyDescriptor>Deprecated.Create a set of column descriptors with the combination of compression, encoding, bloom codecs available.static List<ColumnFamilyDescriptor>generateColumnDescriptors(String prefix) Deprecated.Create a set of column descriptors with the combination of compression, encoding, bloom codecs available.getAdmin()Deprecated.Returns an Admin instance which is shared between HBaseTestingUtility instance users.static NavigableSet<String>getAllOnlineRegions(MiniHBaseCluster cluster) Deprecated.Deprecated.Get a shared AsyncClusterConnection to the cluster.getAsyncConnection(User user) Deprecated.Get a assigned AsyncClusterConnection to the cluster.private org.apache.hadoop.fs.PathDeprecated.getClosestRowBefore(Region r, byte[] row, byte[] family) Deprecated.Deprecated.since 2.7.0, will be removed in 4.0.0.org.apache.hadoop.conf.ConfigurationDeprecated.Returns this classes's instance ofConfiguration.Deprecated.Get a shared Connection to the cluster.getConnection(User user) Deprecated.Get a assigned Connection to the cluster.org.apache.hadoop.fs.PathDeprecated.Returns a Path in the test filesystem, obtained fromgetTestFileSystem()to write temporary test data.org.apache.hadoop.fs.PathgetDataTestDirOnTestFS(String subdirName) Deprecated.Returns a Path in the test filesystem, obtained fromgetTestFileSystem()to write temporary test data.org.apache.hadoop.fs.PathDeprecated.Same as {getDefaultRootDirPath(boolean create)except thatcreateflag is false.org.apache.hadoop.fs.PathgetDefaultRootDirPath(boolean create) Deprecated.Returns the path to the default root dir the minicluster uses.org.apache.hadoop.hdfs.MiniDFSClusterDeprecated.static UsergetDifferentUser(org.apache.hadoop.conf.Configuration c, String differentiatingSuffix) Deprecated.This method clones the passedcconfiguration setting a new user into the clone.getFromStoreFile(HStore store, byte[] row, NavigableSet<byte[]> columns) Deprecated.Do a small get/scan against one store.getFromStoreFile(HStore store, Get get) Deprecated.Do a small get/scan against one store.Deprecated.Get the Mini HBase cluster.Deprecated.Returns the HBaseCluster instance.getHbck()Deprecated.Returns anHbckinstance.static intgetMetaRSPort(Connection connection) Deprecated.List<byte[]>Deprecated.Returns all rows from the hbase:meta table.List<byte[]>getMetaTableRows(TableName tableName) Deprecated.Returns all rows from the hbase:meta table for a given user tableDeprecated.private org.apache.hadoop.fs.PathDeprecated.Sets up a new path in test filesystem to be used by tests.intgetNumHFiles(TableName tableName, byte[] family) Deprecated.intgetNumHFilesForRS(HRegionServer rs, TableName tableName, byte[] family) Deprecated.Deprecated.Find any other region server which is different from the one identified by parameterprivate List<RegionInfo>getRegions(TableName tableName) Deprecated.Returns all regions of the specified tablebyte[][]getRegionSplitStartKeys(byte[] startKey, byte[] endKey, int numRegions) Deprecated.Create region split keys between startkey and endKeyDeprecated.getRSForFirstRegionInTable(TableName tableName) Deprecated.Tool to get the reference to the region server object that holds the region of the specified user table.getSplittableRegion(TableName tableName, int maxAttempts) Deprecated.Retrieves a splittable region randomly from tableNamestatic Compression.Algorithm[]Deprecated.Get supported compression algorithms.org.apache.hadoop.fs.FileSystemDeprecated.Deprecated.voidDeprecated.Resets the connections so that the next time getConnection() is called, a new connection is created.booleanDeprecated.Check whether the tests should assume NEW_VERSION_BEHAVIOR when creating new column families.booleanDeprecated.Get the HBase setting for dfs.client.read.shortcircuit from the conf or a system property.private booleanisTargetTable(byte[] inRow, Cell c) Deprecated.voidDeprecated.Abruptly Shutdown HBase mini cluster.voidloadNumericRows(Table t, byte[] f, int startRow, int endRow) Deprecated.voidloadRandomRows(Table t, byte[] f, int rowSize, int totalRows) Deprecated.intloadRegion(HRegion r, byte[] f) Deprecated.intloadRegion(HRegion r, byte[] f, boolean flush) Deprecated.Load region with rows from 'aaa' to 'zzz'.intloadRegion(Region r, byte[] f) Deprecated.intDeprecated.Load table with rows from 'aaa' to 'zzz'.intDeprecated.Load table of multiple column families with rows from 'aaa' to 'zzz'.intDeprecated.Load table of multiple column families with rows from 'aaa' to 'zzz'.intDeprecated.Load table of multiple column families with rows from 'aaa' to 'zzz'.intDeprecated.Load table with rows from 'aaa' to 'zzz'.Deprecated.Create combination of memstoreTS and tagsDeprecated.static voidmodifyTableSync(Admin admin, TableDescriptor desc) Deprecated.since 3.0.0 and will be removed in 4.0.0.voidmoveRegionAndWait(RegionInfo destRegion, ServerName destServer) Deprecated.Move region to destination server and wait till region is completely moved and online<any>Deprecated.Returns aPredicatefor checking that there are no regions in transition in master<any>predicateTableAvailable(TableName tableName) Deprecated.Returns aPredicatefor checking that table is enabled<any>predicateTableDisabled(TableName tableName) Deprecated.Returns aPredicatefor checking that table is enabled<any>predicateTableEnabled(TableName tableName) Deprecated.Returns aPredicatefor checking that table is enabledstatic intDeprecated.static StringDeprecated.voidrestartHBaseCluster(int servers) Deprecated.Starts the hbase cluster up again after shutting it down previously in a test.voidrestartHBaseCluster(int servers, List<Integer> ports) Deprecated.voidDeprecated.static <T> StringsafeGetAsStr(List<T> lst, int i) Deprecated.voidsetDFSCluster(org.apache.hadoop.hdfs.MiniDFSCluster cluster) Deprecated.voidsetDFSCluster(org.apache.hadoop.hdfs.MiniDFSCluster cluster, boolean requireDown) Deprecated.Set the MiniDFSClusterstatic voidsetFileSystemURI(String fsURI) Deprecated.private voidsetFs()Deprecated.voidsetHBaseCluster(HBaseCluster hbaseCluster) Deprecated.private voidDeprecated.static voidsetMaxRecoveryErrorCount(OutputStream stream, int max) Deprecated.Set maxRecoveryErrorCount in DFSClient.static voidsetReplicas(Admin admin, TableName table, int replicaCount) Deprecated.Set the number of Region replicas.protected org.apache.hadoop.fs.PathDeprecated.Home our data in a dir underHBaseCommonTestingUtility.DEFAULT_BASE_TEST_DIRECTORY.private voidDeprecated.Sets up a path in test filesystem to be used by tests.org.apache.hadoop.minikdc.MiniKdcsetupMiniKdc(File keytabFile) Deprecated.Sets upMiniKdcfor testing security.voidDeprecated.Stops mini hbase, zk, and hdfs clusters.voidDeprecated.Shuts down instance created by call tostartMiniDFSCluster(int)or does nothing.voidDeprecated.Shutdown HBase mini cluster.Does not shutdown zk or dfs if running.voidDeprecated.Stops the previously startedMiniMRCluster.Deprecated.Start up a minicluster of hbase, dfs and zookeeper all using default options.startMiniCluster(boolean createWALDir) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numSlaves) Deprecated.Start up a minicluster of hbase, dfs and zookeeper clusters with given slave node number.startMiniCluster(int numSlaves, boolean createRootDir) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numSlaves, boolean createRootDir, boolean createWALDir) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numMasters, int numSlaves) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numMasters, int numSlaves, boolean createRootDir) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numMasters, int numRegionServers, int numDataNodes) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numMasters, int numRegionServers, int numDataNodes, String[] dataNodeHosts, Class<? extends HMaster> masterClass, Class<? extends MiniHBaseCluster.MiniHBaseClusterRegionServer> rsClass) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numMasters, int numRegionServers, int numDataNodes, String[] dataNodeHosts, Class<? extends HMaster> masterClass, Class<? extends MiniHBaseCluster.MiniHBaseClusterRegionServer> rsClass, boolean createRootDir, boolean createWALDir) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts, boolean createRootDir) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts, Class<? extends HMaster> masterClass, Class<? extends MiniHBaseCluster.MiniHBaseClusterRegionServer> rsClass) Deprecated.since 2.2.0 and will be removed in 4.0.0.Deprecated.Start up a mini cluster of hbase, optionally dfs and zookeeper if needed.org.apache.hadoop.hdfs.MiniDFSClusterstartMiniDFSCluster(int servers) Deprecated.Start a minidfscluster.org.apache.hadoop.hdfs.MiniDFSClusterstartMiniDFSCluster(int servers, String[] hosts) Deprecated.Start a minidfscluster.org.apache.hadoop.hdfs.MiniDFSClusterstartMiniDFSCluster(int servers, String[] racks, String[] hosts) Deprecated.org.apache.hadoop.hdfs.MiniDFSClusterstartMiniDFSCluster(String[] hosts) Deprecated.Start a minidfscluster.org.apache.hadoop.hdfs.MiniDFSClusterstartMiniDFSClusterForTestWAL(int namenodePort) Deprecated.Deprecated.Starts up mini hbase cluster using default options.startMiniHBaseCluster(int numMasters, int numRegionServers) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniHBaseCluster(int numMasters, int numRegionServers, List<Integer> rsPorts) Deprecated.since 2.2.0 and will be removed in 4.0.0.startMiniHBaseCluster(int numMasters, int numRegionServers, List<Integer> rsPorts, Class<? extends HMaster> masterClass, Class<? extends MiniHBaseCluster.MiniHBaseClusterRegionServer> rsClass, boolean createRootDir, boolean createWALDir) Deprecated.since 2.2.0 and will be removed in 4.0.0.Deprecated.Starts up mini hbase cluster.org.apache.hadoop.mapred.MiniMRClusterDeprecated.Starts aMiniMRClusterwith a default number ofTaskTracker's.private voidstartMiniMapReduceCluster(int servers) Deprecated.Starts aMiniMRCluster.truncateTable(TableName tableName) Deprecated.Truncate a table using the admin command.truncateTable(TableName tableName, boolean preserveRegions) Deprecated.Truncate a table using the admin command.voidunassignRegion(byte[] regionName) Deprecated.Unassign the named region.voidunassignRegion(String regionName) Deprecated.Unassign the named region.voidunassignRegionByRow(byte[] row, RegionLocator table) Deprecated.Closes the region containing the given row.voidunassignRegionByRow(String row, RegionLocator table) Deprecated.Closes the region containing the given row.voidverifyNumericRows(Table table, byte[] f, int startRow, int endRow, int replicaId) Deprecated.voidverifyNumericRows(HRegion region, byte[] f, int startRow, int endRow) Deprecated.voidverifyNumericRows(HRegion region, byte[] f, int startRow, int endRow, boolean present) Deprecated.voidverifyNumericRows(Region region, byte[] f, int startRow, int endRow) Deprecated.voidverifyNumericRows(Region region, byte[] f, int startRow, int endRow, boolean present) Deprecated.voidDeprecated.static voidwaitForHostPort(String host, int port) Deprecated.voidwaitLabelAvailable(long timeoutMillis, String... labels) Deprecated.Wait until labels is ready in VisibilityLabelsCache.voidwaitTableAvailable(byte[] table, long timeoutMillis) Deprecated.Wait until all regions in a table have been assignedvoidwaitTableAvailable(TableName table) Deprecated.Wait until all regions in a table have been assigned.voidwaitTableAvailable(TableName table, long timeoutMillis) Deprecated.voidwaitTableDisabled(byte[] table) Deprecated.Waits for a table to be 'disabled'.voidwaitTableDisabled(byte[] table, long timeoutMillis) Deprecated.Waits for a table to be 'disabled'.voidwaitTableDisabled(TableName table, long millisTimeout) Deprecated.voidwaitTableEnabled(byte[] table, long timeoutMillis) Deprecated.Waits for a table to be 'enabled'.voidwaitTableEnabled(TableName table) Deprecated.Waits for a table to be 'enabled'.voidwaitTableEnabled(TableName table, long timeoutMillis) Deprecated.voidwaitUntilAllRegionsAssigned(TableName tableName) Deprecated.Wait until all regions for a table in hbase:meta have a non-empty info:server, up to a configuable timeout value (default is 60 seconds) This means all regions have been deployed, master has been informed and updated hbase:meta with the regions deployed server.voidwaitUntilAllRegionsAssigned(TableName tableName, long timeout) Deprecated.Wait until all regions for a table in hbase:meta have a non-empty info:server, or until timeout.voidDeprecated.Waith until all system table's regions get assignedvoidDeprecated.Wait until no regions in transition.voidwaitUntilNoRegionsInTransition(long timeout) Deprecated.Wait until no regions in transition.Methods inherited from class org.apache.hadoop.hbase.HBaseZKTestingUtility
cleanupTestDir, getClusterTestDir, getZkCluster, getZooKeeperWatcher, getZooKeeperWatcher, setupClusterTestDir, setZkCluster, shutdownMiniZKCluster, startMiniZKCluster, startMiniZKClusterMethods inherited from class org.apache.hadoop.hbase.HBaseCommonTestingUtility
cleanupTestDir, createSubDir, deleteDir, deleteOnExit, getDataTestDir, getDataTestDir, getRandomDir, getRandomUUID, waitFor, waitFor, waitFor
-
Field Details
-
REGIONS_PER_SERVER_KEY
Deprecated.- See Also:
-
DEFAULT_REGIONS_PER_SERVER
Deprecated.The default number of regions per regionserver when creating a pre-split table.- See Also:
-
dfsCluster
Deprecated. -
dfsClusterFixer
Deprecated. -
hbaseCluster
Deprecated. -
mrCluster
Deprecated. -
miniClusterRunning
Deprecated.If there is a mini cluster running for this testing utility instance. -
hadoopLogDir
Deprecated. -
dataTestDirOnTestFS
Deprecated.Directory on test filesystem where we put the data for this instance of HBaseTestingUtility -
asyncConnection
Deprecated. -
FS_URI
Deprecated.Filesystem URI used for map-reduce mini-cluster setup -
MEMSTORETS_TAGS_PARAMETRIZED
Deprecated.This is for unit tests parameterized with a single boolean. -
BLOOM_AND_COMPRESSION_COMBINATIONS
Deprecated. -
fam1
Deprecated. -
fam2
Deprecated. -
fam3
Deprecated. -
COLUMNS
Deprecated. -
MAXVERSIONS
Deprecated.- See Also:
-
FIRST_CHAR
Deprecated.- See Also:
-
LAST_CHAR
Deprecated.- See Also:
-
START_KEY_BYTES
Deprecated. -
START_KEY
Deprecated. -
ROWS
Deprecated.All the row values for the data loaded byloadTable(Table, byte[]) -
KEYS
Deprecated. -
KEYS_FOR_HBA_CREATE_TABLE
Deprecated. -
hbaseAdmin
Deprecated.
-
-
Constructor Details
-
HBaseTestingUtility
public HBaseTestingUtility()Deprecated.Create an HBaseTestingUtility using a default configuration.
Initially, all tmp files are written to a local test data directory. Once
startMiniDFSCluster(int)is called, either directly or viastartMiniCluster(), tmp data will be written to the DFS directory instead. -
HBaseTestingUtility
Deprecated.Create an HBaseTestingUtility using a given configuration.
Initially, all tmp files are written to a local test data directory. Once
startMiniDFSCluster(int)is called, either directly or viastartMiniCluster(), tmp data will be written to the DFS directory instead.- Parameters:
conf- The configuration to use for further operations
-
-
Method Details
-
available
Deprecated.Checks to see if a specific port is available.- Parameters:
port- the port number to check for availability- Returns:
- true if the port is available, or false if not
-
bloomAndCompressionCombinations
Deprecated.Create all combinations of Bloom filters and compression algorithms for testing. -
memStoreTSAndTagsCombination
Deprecated.Create combination of memstoreTS and tags -
memStoreTSTagsAndOffheapCombination
Deprecated. -
closeRegionAndWAL
Deprecated.Close both the regionrand it's underlying WAL. For use in tests.- Throws:
IOException
-
closeRegionAndWAL
Deprecated.Close both the HRegionrand it's underlying WAL. For use in tests.- Throws:
IOException
-
getConfiguration
Deprecated.Returns this classes's instance ofConfiguration. Be careful how you use the returned Configuration sinceConnectioninstances can be shared. The Map of Connections is keyed by the Configuration. If say, a Connection was being used against a cluster that had been shutdown, seeshutdownMiniCluster(), then the Connection will no longer be wholesome. Rather than use the return direct, its usually best to make a copy and use that. DoConfiguration c = new Configuration(INSTANCE.getConfiguration());- Overrides:
getConfigurationin classHBaseCommonTestingUtility- Returns:
- Instance of Configuration.
-
setHBaseCluster
Deprecated. -
setupDataTestDir
Deprecated.Home our data in a dir underHBaseCommonTestingUtility.DEFAULT_BASE_TEST_DIRECTORY. Give it a random name so can have many concurrent tests running if we need to. Moding a System property is not the way to do concurrent instances -- another instance could grab the temporary value unintentionally -- but not anything can do about it at moment; single instance only is how the minidfscluster works. We also create the underlying directory names for hadoop.log.dir, mapreduce.cluster.local.dir and hadoop.tmp.dir, and set the values in the conf, and as a system property for hadoop.tmp.dir (We do not create them!).- Overrides:
setupDataTestDirin classHBaseCommonTestingUtility- Returns:
- The calculated data test build directory, if newly-created.
-
createSubDirAndSystemProperty
private void createSubDirAndSystemProperty(String propertyName, org.apache.hadoop.fs.Path parent, String subDirName) Deprecated. -
getBaseTestDirOnTestFS
Deprecated.- Returns:
- Where to write test data on the test filesystem; Returns working directory for the test filesystem by default
- Throws:
IOException- See Also:
-
getDataTestDirOnTestFS
Deprecated.Returns a Path in the test filesystem, obtained fromgetTestFileSystem()to write temporary test data. Call this method after setting up the mini dfs cluster if the test relies on it.- Returns:
- a unique path in the test filesystem
- Throws:
IOException
-
getDataTestDirOnTestFS
Deprecated.Returns a Path in the test filesystem, obtained fromgetTestFileSystem()to write temporary test data. Call this method after setting up the mini dfs cluster if the test relies on it.- Parameters:
subdirName- name of the subdir to create under the base test dir- Returns:
- a unique path in the test filesystem
- Throws:
IOException
-
setupDataTestDirOnTestFS
Deprecated.Sets up a path in test filesystem to be used by tests. Creates a new directory if not already setup.- Throws:
IOException
-
getNewDataTestDirOnTestFS
Deprecated.Sets up a new path in test filesystem to be used by tests.- Throws:
IOException
-
cleanupDataTestDirOnTestFS
Deprecated.Cleans the test data directory on the test filesystem.- Returns:
- True if we removed the test dirs
- Throws:
IOException
-
cleanupDataTestDirOnTestFS
Deprecated.Cleans a subdirectory under the test data directory on the test filesystem.- Returns:
- True if we removed child
- Throws:
IOException
-
startMiniDFSCluster
Deprecated.Start a minidfscluster.- Parameters:
servers- How many DNs to start.- Returns:
- The mini dfs cluster created.
- Throws:
Exception- See Also:
-
startMiniDFSCluster
Deprecated.Start a minidfscluster. This is useful if you want to run datanode on distinct hosts for things like HDFS block location verification. If you start MiniDFSCluster without host names, all instances of the datanodes will have the same host name.- Parameters:
hosts- hostnames DNs to run on.- Returns:
- The mini dfs cluster created.
- Throws:
Exception- See Also:
-
startMiniDFSCluster
public org.apache.hadoop.hdfs.MiniDFSCluster startMiniDFSCluster(int servers, String[] hosts) throws Exception Deprecated.Start a minidfscluster. Can only create one.- Parameters:
servers- How many DNs to start.hosts- hostnames DNs to run on.- Returns:
- The mini dfs cluster created.
- Throws:
Exception- See Also:
-
setFs
Deprecated.- Throws:
IOException
-
startMiniDFSCluster
public org.apache.hadoop.hdfs.MiniDFSCluster startMiniDFSCluster(int servers, String[] racks, String[] hosts) throws Exception Deprecated.- Throws:
Exception
-
startMiniDFSClusterForTestWAL
public org.apache.hadoop.hdfs.MiniDFSCluster startMiniDFSClusterForTestWAL(int namenodePort) throws IOException Deprecated.- Throws:
IOException
-
createDirsAndSetProperties
Deprecated.This is used before starting HDFS and map-reduce mini-clusters Run something like the below to check for the likes of '/tmp' references -- i.e. references outside of the test data dir -- in the conf.Configuration conf = TEST_UTIL.getConfiguration(); for (Iterator<Map.Entry<String, String>> i = conf.iterator(); i.hasNext();) { Map.Entry<String, String> e = i.next(); assertFalse(e.getKey() + " " + e.getValue(), e.getValue().contains("/tmp")); }- Throws:
IOException
-
isNewVersionBehaviorEnabled
Deprecated.Check whether the tests should assume NEW_VERSION_BEHAVIOR when creating new column families. Default to false. -
isReadShortCircuitOn
Deprecated.Get the HBase setting for dfs.client.read.shortcircuit from the conf or a system property. This allows to specify this parameter on the command line. If not set, default is true. -
enableShortCircuit
Deprecated.Enable the short circuit read, unless configured differently. Set both HBase and HDFS settings, including skipping the hdfs checksum checks. -
createDirAndSetProperty
Deprecated. -
createDirAndSetProperty
Deprecated. -
shutdownMiniDFSCluster
Deprecated.Shuts down instance created by call tostartMiniDFSCluster(int)or does nothing.- Throws:
IOException
-
startMiniCluster
Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper where WAL's walDir is created separately. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
createWALDir- Whether to create a new WAL directory.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numSlaves, boolean createRootDir) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numSlaves- Slave node number, for both HBase region server and HDFS data node.createRootDir- Whether to create a new root or data directory path.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numSlaves, boolean createRootDir, boolean createWALDir) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numSlaves- Slave node number, for both HBase region server and HDFS data node.createRootDir- Whether to create a new root or data directory path.createWALDir- Whether to create a new WAL directory.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numMasters, int numSlaves, boolean createRootDir) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numSlaves- Slave node number, for both HBase region server and HDFS data node.createRootDir- Whether to create a new root or data directory path.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numMasters, int numSlaves) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numSlaves- Slave node number, for both HBase region server and HDFS data node.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts, boolean createRootDir) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numSlaves- Slave node number, for both HBase region server and HDFS data node.dataNodeHosts- The hostnames of DataNodes to run on. If not null, its size will overwrite HDFS data node number.createRootDir- Whether to create a new root or data directory path.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numSlaves- Slave node number, for both HBase region server and HDFS data node.dataNodeHosts- The hostnames of DataNodes to run on. If not null, its size will overwrite HDFS data node number.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numMasters, int numRegionServers, int numDataNodes) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numRegionServers- Number of region servers.numDataNodes- Number of datanodes.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numMasters, int numSlaves, String[] dataNodeHosts, Class<? extends HMaster> masterClass, Class<? extends MiniHBaseCluster.MiniHBaseClusterRegionServer> rsClass) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numSlaves- Slave node number, for both HBase region server and HDFS data node.dataNodeHosts- The hostnames of DataNodes to run on. If not null, its size will overwrite HDFS data node number.masterClass- The class to use as HMaster, or null for default.rsClass- The class to use as HRegionServer, or null for default.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numMasters, int numRegionServers, int numDataNodes, String[] dataNodeHosts, Class<? extends HMaster> masterClass, Class<? extends MiniHBaseCluster.MiniHBaseClusterRegionServer> rsClass) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numRegionServers- Number of region servers.numDataNodes- Number of datanodes.dataNodeHosts- The hostnames of DataNodes to run on. If not null, its size will overwrite HDFS data node number.masterClass- The class to use as HMaster, or null for default.rsClass- The class to use as HRegionServer, or null for default.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
@Deprecated public MiniHBaseCluster startMiniCluster(int numMasters, int numRegionServers, int numDataNodes, String[] dataNodeHosts, Class<? extends HMaster> masterClass, Class<? extends MiniHBaseCluster.MiniHBaseClusterRegionServer> rsClass, boolean createRootDir, boolean createWALDir) throws Exception Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniCluster(StartMiniClusterOption)instead.Start up a minicluster of hbase, dfs, and zookeeper. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numRegionServers- Number of region servers.numDataNodes- Number of datanodes.dataNodeHosts- The hostnames of DataNodes to run on. If not null, its size will overwrite HDFS data node number.masterClass- The class to use as HMaster, or null for default.rsClass- The class to use as HRegionServer, or null for default.createRootDir- Whether to create a new root or data directory path.createWALDir- Whether to create a new WAL directory.- Returns:
- The mini HBase cluster created.
- Throws:
Exception- See Also:
-
startMiniCluster
Deprecated.Start up a minicluster of hbase, dfs and zookeeper clusters with given slave node number. All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numSlaves- slave node number, for both HBase region server and HDFS data node.- Throws:
Exception- See Also:
-
startMiniCluster
Deprecated.Start up a minicluster of hbase, dfs and zookeeper all using default options. Option default value can be found inStartMiniClusterOption.Builder.- Throws:
Exception- See Also:
-
startMiniCluster
Deprecated.Start up a mini cluster of hbase, optionally dfs and zookeeper if needed. It modifies Configuration. It homes the cluster data directory under a random subdirectory in a directory under System property test.build.data, to be cleaned up on exit.- Throws:
Exception- See Also:
-
startMiniHBaseCluster
public MiniHBaseCluster startMiniHBaseCluster(StartMiniClusterOption option) throws IOException, InterruptedException Deprecated.Starts up mini hbase cluster. Usually you won't want this. You'll usually wantstartMiniCluster(). This is useful when doing stepped startup of clusters.- Returns:
- Reference to the hbase mini hbase cluster.
- Throws:
IOExceptionInterruptedException- See Also:
-
startMiniHBaseCluster
Deprecated.Starts up mini hbase cluster using default options. Default options can be found inStartMiniClusterOption.Builder. -
startMiniHBaseCluster
@Deprecated public MiniHBaseCluster startMiniHBaseCluster(int numMasters, int numRegionServers) throws IOException, InterruptedException Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniHBaseCluster(StartMiniClusterOption)instead.Starts up mini hbase cluster. Usually you won't want this. You'll usually wantstartMiniCluster(). All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numRegionServers- Number of region servers.- Returns:
- The mini HBase cluster created.
- Throws:
IOExceptionInterruptedException- See Also:
-
startMiniHBaseCluster
@Deprecated public MiniHBaseCluster startMiniHBaseCluster(int numMasters, int numRegionServers, List<Integer> rsPorts) throws IOException, InterruptedException Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniHBaseCluster(StartMiniClusterOption)instead.Starts up mini hbase cluster. Usually you won't want this. You'll usually wantstartMiniCluster(). All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numRegionServers- Number of region servers.rsPorts- Ports that RegionServer should use.- Returns:
- The mini HBase cluster created.
- Throws:
IOExceptionInterruptedException- See Also:
-
startMiniHBaseCluster
@Deprecated public MiniHBaseCluster startMiniHBaseCluster(int numMasters, int numRegionServers, List<Integer> rsPorts, Class<? extends HMaster> masterClass, Class<? extends MiniHBaseCluster.MiniHBaseClusterRegionServer> rsClass, boolean createRootDir, boolean createWALDir) throws IOException, InterruptedException Deprecated.since 2.2.0 and will be removed in 4.0.0. UsestartMiniHBaseCluster(StartMiniClusterOption)instead.Starts up mini hbase cluster. Usually you won't want this. You'll usually wantstartMiniCluster(). All other options will use default values, defined inStartMiniClusterOption.Builder.- Parameters:
numMasters- Master node number.numRegionServers- Number of region servers.rsPorts- Ports that RegionServer should use.masterClass- The class to use as HMaster, or null for default.rsClass- The class to use as HRegionServer, or null for default.createRootDir- Whether to create a new root or data directory path.createWALDir- Whether to create a new WAL directory.- Returns:
- The mini HBase cluster created.
- Throws:
IOExceptionInterruptedException- See Also:
-
restartHBaseCluster
Deprecated.Starts the hbase cluster up again after shutting it down previously in a test. Use this if you want to keep dfs/zk up and just stop/start hbase.- Parameters:
servers- number of region servers- Throws:
IOExceptionInterruptedException
-
restartHBaseCluster
public void restartHBaseCluster(int servers, List<Integer> ports) throws IOException, InterruptedException Deprecated.- Throws:
IOExceptionInterruptedException
-
restartHBaseCluster
public void restartHBaseCluster(StartMiniClusterOption option) throws IOException, InterruptedException Deprecated.- Throws:
IOExceptionInterruptedException
-
getMiniHBaseCluster
Deprecated.- Returns:
- Current mini hbase cluster. Only has something in it after a call to
startMiniCluster(). - See Also:
-
shutdownMiniCluster
Deprecated.Stops mini hbase, zk, and hdfs clusters.- Throws:
IOException- See Also:
-
shutdownMiniHBaseCluster
Deprecated.Shutdown HBase mini cluster.Does not shutdown zk or dfs if running.- Throws:
IOException- in case command is unsuccessful
-
killMiniHBaseCluster
Deprecated.Abruptly Shutdown HBase mini cluster. Does not shutdown zk or dfs if running.- Throws:
IOException- throws in case command is unsuccessful
-
cleanup
Deprecated.- Throws:
IOException
-
getDefaultRootDirPath
Deprecated.Returns the path to the default root dir the minicluster uses. Ifcreateis true, a new root directory path is fetched irrespective of whether it has been fetched before or not. If false, previous path is used. Note: this does not cause the root dir to be created.- Returns:
- Fully qualified path for the default hbase root dir
- Throws:
IOException
-
getDefaultRootDirPath
Deprecated.Same as {getDefaultRootDirPath(boolean create)except thatcreateflag is false. Note: this does not cause the root dir to be created.- Returns:
- Fully qualified path for the default hbase root dir
- Throws:
IOException
-
createRootDir
Deprecated.Creates an hbase rootdir in user home directory. Also creates hbase version file. Normally you won't make use of this method. Root hbasedir is created for you as part of mini cluster startup. You'd only use this method if you were doing manual operation.- Parameters:
create- This flag decides whether to get a new root or data directory path or not, if it has been fetched already. Note : Directory will be made irrespective of whether path has been fetched or not. If directory already exists, it will be overwritten- Returns:
- Fully qualified path to hbase root dir
- Throws:
IOException
-
createRootDir
Deprecated.Same ascreateRootDir(boolean create)except thatcreateflag is false.- Returns:
- Fully qualified path to hbase root dir
- Throws:
IOException
-
createWALRootDir
Deprecated.Creates a hbase walDir in the user's home directory. Normally you won't make use of this method. Root hbaseWALDir is created for you as part of mini cluster startup. You'd only use this method if you were doing manual operation.- Returns:
- Fully qualified path to hbase root dir
- Throws:
IOException
-
setHBaseFsTmpDir
Deprecated.- Throws:
IOException
-
flush
Deprecated.Flushes all caches in the mini hbase cluster- Throws:
IOException
-
flush
Deprecated.Flushes all caches in the mini hbase cluster- Throws:
IOException
-
compact
Deprecated.Compact all regions in the mini hbase cluster- Throws:
IOException
-
compact
Deprecated.Compact all of a table's reagion in the mini hbase cluster- Throws:
IOException
-
createTable
Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createMultiRegionTable
public Table createMultiRegionTable(TableName tableName, byte[] family, int numRegions) throws IOException Deprecated.Create a table with multiple regions.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createMultiRegionTable
Deprecated.Create a table with multiple regions.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createMultiRegionTable
public Table createMultiRegionTable(TableName tableName, int replicaCount, byte[][] families) throws IOException Deprecated.Create a table with multiple regions.- Parameters:
replicaCount- replica count.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, byte[][] splitKeys) throws IOException Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, byte[][] splitKeys, int replicaCount) throws IOException Deprecated.Create a table.- Parameters:
tableName- the table namefamilies- the familiessplitKeys- the splitkeysreplicaCount- the region replica count- Returns:
- A Table instance for the created table.
- Throws:
IOException- throws IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, int numVersions, byte[] startKey, byte[] endKey, int numRegions) throws IOException Deprecated.- Throws:
IOException
-
createTable
public Table createTable(TableDescriptor htd, byte[][] families, org.apache.hadoop.conf.Configuration c) throws IOException Deprecated.Create a table.- Parameters:
c- Configuration to use- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public Table createTable(TableDescriptor htd, byte[][] families, byte[][] splitKeys, org.apache.hadoop.conf.Configuration c) throws IOException Deprecated.Create a table.- Parameters:
htd- table descriptorfamilies- array of column familiessplitKeys- array of split keysc- Configuration to use- Returns:
- A Table instance for the created table.
- Throws:
IOException- if getAdmin or createTable fails
-
createTable
public Table createTable(TableDescriptor htd, byte[][] families, byte[][] splitKeys, BloomType type, int blockSize, org.apache.hadoop.conf.Configuration c) throws IOException Deprecated.Create a table.- Parameters:
htd- table descriptorfamilies- array of column familiessplitKeys- array of split keystype- Bloom typeblockSize- block sizec- Configuration to use- Returns:
- A Table instance for the created table.
- Throws:
IOException- if getAdmin or createTable fails
-
createTable
Deprecated.Create a table.- Parameters:
htd- table descriptorsplitRows- array of split keys- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, byte[][] splitKeys, int replicaCount, org.apache.hadoop.conf.Configuration c) throws IOException Deprecated.Create a table.- Parameters:
tableName- the table namefamilies- the familiessplitKeys- the split keysreplicaCount- the replica countc- Configuration to use- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, int numVersions) throws IOException Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, int numVersions, byte[][] splitKeys) throws IOException Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createMultiRegionTable
public Table createMultiRegionTable(TableName tableName, byte[][] families, int numVersions) throws IOException Deprecated.Create a table with multiple regions.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, int numVersions, int blockSize) throws IOException Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, int numVersions, int blockSize, String cpName) throws IOException Deprecated.- Throws:
IOException
-
createTable
public Table createTable(TableName tableName, byte[][] families, int[] numVersions) throws IOException Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
Deprecated.Create a table.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createMultiRegionTable
Deprecated.Create a table with multiple regions.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
modifyTableSync
@Deprecated public static void modifyTableSync(Admin admin, TableDescriptor desc) throws IOException, InterruptedException Deprecated.since 3.0.0 and will be removed in 4.0.0. Just useAdmin.modifyTable(TableDescriptor)directly as it is synchronous now.Modify a table, synchronous.- Throws:
IOExceptionInterruptedException- See Also:
-
setReplicas
public static void setReplicas(Admin admin, TableName table, int replicaCount) throws IOException, InterruptedException Deprecated.Set the number of Region replicas.- Throws:
IOExceptionInterruptedException
-
deleteTable
Deprecated.Drop an existing table- Parameters:
tableName- existing table- Throws:
IOException
-
deleteTableIfAny
Deprecated.Drop an existing table- Parameters:
tableName- existing table- Throws:
IOException
-
createModifyableTableDescriptor
Deprecated. -
createTableDescriptor
public TableDescriptor createTableDescriptor(TableName name, int minVersions, int versions, int ttl, KeepDeletedCells keepDeleted) Deprecated. -
createModifyableTableDescriptor
public TableDescriptorBuilder createModifyableTableDescriptor(TableName name, int minVersions, int versions, int ttl, KeepDeletedCells keepDeleted) Deprecated. -
createTableDescriptor
Deprecated.Create a table of namename.- Parameters:
name- Name to give table.- Returns:
- Column descriptor.
-
createTableDescriptor
Deprecated. -
createTableDescriptor
public TableDescriptor createTableDescriptor(TableName tableName, byte[][] families, int maxVersions) Deprecated. -
createLocalHRegion
public HRegion createLocalHRegion(TableDescriptor desc, byte[] startKey, byte[] endKey) throws IOException Deprecated.Create an HRegion that writes to the local tmp dirs- Parameters:
desc- a table descriptor indicating which table the region belongs tostartKey- the start boundary of the regionendKey- the end boundary of the region- Returns:
- a region that writes to local dir for testing
- Throws:
IOException
-
createLocalHRegion
Deprecated.Create an HRegion that writes to the local tmp dirs. Creates the WAL for you. Be sure to callcloseRegionAndWAL(HRegion)when you're finished with it.- Throws:
IOException
-
createLocalHRegion
public HRegion createLocalHRegion(RegionInfo info, org.apache.hadoop.conf.Configuration conf, TableDescriptor desc, WAL wal) throws IOException Deprecated.Create an HRegion that writes to the local tmp dirs with specified wal- Parameters:
info- regioninfoconf- configurationdesc- table descriptorwal- wal for this region.- Returns:
- created hregion
- Throws:
IOException
-
createLocalHRegion
public HRegion createLocalHRegion(TableName tableName, byte[] startKey, byte[] stopKey, org.apache.hadoop.conf.Configuration conf, boolean isReadOnly, Durability durability, WAL wal, byte[]... families) throws IOException Deprecated.Return a region on which you must callcloseRegionAndWAL(HRegion)when done.- Throws:
IOException
-
createLocalHRegionWithInMemoryFlags
public HRegion createLocalHRegionWithInMemoryFlags(TableName tableName, byte[] startKey, byte[] stopKey, org.apache.hadoop.conf.Configuration conf, boolean isReadOnly, Durability durability, WAL wal, boolean[] compactedMemStore, byte[]... families) throws IOException Deprecated.- Throws:
IOException
-
deleteTableData
Deprecated.Provide an existing table name to truncate. Scans the table and issues a delete for each row read.- Parameters:
tableName- existing table- Returns:
- HTable to that new table
- Throws:
IOException
-
truncateTable
Deprecated.Truncate a table using the admin command. Effectively disables, deletes, and recreates the table.- Parameters:
tableName- table which must exist.preserveRegions- keep the existing split points- Returns:
- HTable for the new table
- Throws:
IOException
-
truncateTable
Deprecated.Truncate a table using the admin command. Effectively disables, deletes, and recreates the table. For previous behavior of issuing row deletes, see deleteTableData. Expressly does not preserve regions of existing table.- Parameters:
tableName- table which must exist.- Returns:
- HTable for the new table
- Throws:
IOException
-
loadTable
Deprecated.Load table with rows from 'aaa' to 'zzz'.- Parameters:
t- Tablef- Family- Returns:
- Count of rows loaded.
- Throws:
IOException
-
loadTable
Deprecated.Load table with rows from 'aaa' to 'zzz'.- Parameters:
t- Tablef- Family- Returns:
- Count of rows loaded.
- Throws:
IOException
-
loadTable
Deprecated.Load table of multiple column families with rows from 'aaa' to 'zzz'.- Parameters:
t- Tablef- Array of Families to load- Returns:
- Count of rows loaded.
- Throws:
IOException
-
loadTable
Deprecated.Load table of multiple column families with rows from 'aaa' to 'zzz'.- Parameters:
t- Tablef- Array of Families to loadvalue- the values of the cells. If null is passed, the row key is used as value- Returns:
- Count of rows loaded.
- Throws:
IOException
-
loadTable
Deprecated.Load table of multiple column families with rows from 'aaa' to 'zzz'.- Parameters:
t- Tablef- Array of Families to loadvalue- the values of the cells. If null is passed, the row key is used as value- Returns:
- Count of rows loaded.
- Throws:
IOException
-
loadRegion
Deprecated.- Throws:
IOException
-
loadRegion
Deprecated.- Throws:
IOException
-
loadRegion
Deprecated.Load region with rows from 'aaa' to 'zzz'.- Parameters:
r- Regionf- Familyflush- flush the cache if true- Returns:
- Count of rows loaded.
- Throws:
IOException
-
loadNumericRows
Deprecated.- Throws:
IOException
-
loadRandomRows
Deprecated.- Throws:
IOException
-
verifyNumericRows
public void verifyNumericRows(Table table, byte[] f, int startRow, int endRow, int replicaId) throws IOException Deprecated.- Throws:
IOException
-
verifyNumericRows
Deprecated.- Throws:
IOException
-
verifyNumericRows
public void verifyNumericRows(HRegion region, byte[] f, int startRow, int endRow) throws IOException Deprecated.- Throws:
IOException
-
verifyNumericRows
public void verifyNumericRows(Region region, byte[] f, int startRow, int endRow, boolean present) throws IOException Deprecated.- Throws:
IOException
-
verifyNumericRows
public void verifyNumericRows(HRegion region, byte[] f, int startRow, int endRow, boolean present) throws IOException Deprecated.- Throws:
IOException
-
deleteNumericRows
Deprecated.- Throws:
IOException
-
countRows
Deprecated.Return the number of rows in the given table.- Parameters:
table- to count rows- Returns:
- count of rows
- Throws:
IOException
-
countRows
Deprecated.- Throws:
IOException
-
countRows
Deprecated.- Throws:
IOException
-
countRows
Deprecated.Return the number of rows in the given table.- Throws:
IOException
-
countRows
Deprecated.- Throws:
IOException
-
countRows
Deprecated.- Throws:
IOException
-
countRows
Deprecated.- Throws:
IOException
-
checksumRows
Deprecated.Return an md5 digest of the entire contents of a table.- Throws:
Exception
-
createMultiRegionsInMeta
public List<RegionInfo> createMultiRegionsInMeta(org.apache.hadoop.conf.Configuration conf, TableDescriptor htd, byte[][] startKeys) throws IOException Deprecated.Create rows in hbase:meta for regions of the specified table with the specified start keys. The first startKey should be a 0 length byte array if you want to form a proper range of regions.- Returns:
- list of region info for regions added to meta
- Throws:
IOException
-
createWal
public static WAL createWal(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, RegionInfo hri) throws IOException Deprecated.Create an unmanaged WAL. Be sure to close it when you're through.- Throws:
IOException
-
createRegionAndWAL
public static HRegion createRegionAndWAL(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor htd) throws IOException Deprecated.Create a region with it's own WAL. Be sure to callcloseRegionAndWAL(HRegion)to clean up all resources.- Throws:
IOException
-
createRegionAndWAL
public static HRegion createRegionAndWAL(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor htd, BlockCache blockCache) throws IOException Deprecated.Create a region with it's own WAL. Be sure to callcloseRegionAndWAL(HRegion)to clean up all resources.- Throws:
IOException
-
createRegionAndWAL
public static HRegion createRegionAndWAL(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor htd, MobFileCache mobFileCache) throws IOException Deprecated.Create a region with it's own WAL. Be sure to callcloseRegionAndWAL(HRegion)to clean up all resources.- Throws:
IOException
-
createRegionAndWAL
public static HRegion createRegionAndWAL(RegionInfo info, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.conf.Configuration conf, TableDescriptor htd, boolean initialize) throws IOException Deprecated.Create a region with it's own WAL. Be sure to callcloseRegionAndWAL(HRegion)to clean up all resources.- Throws:
IOException
-
getMetaTableRows
Deprecated.Returns all rows from the hbase:meta table.- Throws:
IOException- When reading the rows fails.
-
getMetaTableRows
Deprecated.Returns all rows from the hbase:meta table for a given user table- Throws:
IOException- When reading the rows fails.
-
getRegions
Deprecated.Returns all regions of the specified table- Parameters:
tableName- the table name- Returns:
- all regions of the specified table
- Throws:
IOException- when getting the regions fails.
-
getOtherRegionServer
Deprecated.Find any other region server which is different from the one identified by parameter- Returns:
- another region server
-
getRSForFirstRegionInTable
public HRegionServer getRSForFirstRegionInTable(TableName tableName) throws IOException, InterruptedException Deprecated.Tool to get the reference to the region server object that holds the region of the specified user table.- Parameters:
tableName- user table to lookup in hbase:meta- Returns:
- region server that holds it, null if the row doesn't exist
- Throws:
IOExceptionInterruptedException
-
startMiniMapReduceCluster
Deprecated.Starts aMiniMRClusterwith a default number ofTaskTracker's.- Throws:
IOException- When starting the cluster fails.
-
forceChangeTaskLogDir
Deprecated.Tasktracker has a bug where changing the hadoop.log.dir system property will not change its internal static LOG_DIR variable. -
startMiniMapReduceCluster
Deprecated.Starts aMiniMRCluster. CallsetFileSystemURI(String)to use a different filesystem.- Parameters:
servers- The number ofTaskTracker's to start.- Throws:
IOException- When starting the cluster fails.
-
shutdownMiniMapReduceCluster
Deprecated.Stops the previously startedMiniMRCluster. -
createMockRegionServerService
Deprecated.Create a stubbed out RegionServerService, mainly for getting FS.- Throws:
IOException
-
createMockRegionServerService
public RegionServerServices createMockRegionServerService(RpcServerInterface rpc) throws IOException Deprecated.Create a stubbed out RegionServerService, mainly for getting FS. This version is used by TestTokenAuthentication- Throws:
IOException
-
createMockRegionServerService
Deprecated.Create a stubbed out RegionServerService, mainly for getting FS. This version is used by TestOpenRegionHandler- Throws:
IOException
-
enableDebug
Deprecated.In 2.3.0, will be removed in 4.0.0. Only support changing log level on log4j now as HBase only uses log4j. You should do this by your own as it you know which log framework you are using then set the log level to debug is very easy.Switches the logger for the given class to DEBUG level.- Parameters:
clazz- The class for which to switch to debug logging.
-
expireMasterSession
Deprecated.Expire the Master's session- Throws:
Exception
-
expireRegionServerSession
Deprecated.Expire a region server's session- Parameters:
index- which RS- Throws:
Exception
-
decrementMinRegionServerCount
Deprecated. -
decrementMinRegionServerCount
Deprecated. -
expireSession
Deprecated.- Throws:
Exception
-
expireSession
Deprecated.Expire a ZooKeeper session as recommended in ZooKeeper documentation http://hbase.apache.org/book.html#trouble.zookeeper There are issues when doing this: [1] http://www.mail-archive.com/dev@zookeeper.apache.org/msg01942.html [2] https://issues.apache.org/jira/browse/ZOOKEEPER-1105- Parameters:
nodeZK- - the ZK watcher to expirecheckStatus- - true to check if we can create a Table with the current configuration.- Throws:
Exception
-
getHBaseCluster
Deprecated.Get the Mini HBase cluster.- Returns:
- hbase cluster
- See Also:
-
getHBaseClusterInterface
Deprecated.Returns the HBaseCluster instance.Returned object can be any of the subclasses of HBaseCluster, and the tests referring this should not assume that the cluster is a mini cluster or a distributed one. If the test only works on a mini cluster, then specific method
getMiniHBaseCluster()can be used instead w/o the need to type-cast. -
invalidateConnection
Deprecated.Resets the connections so that the next time getConnection() is called, a new connection is created. This is needed in cases where the entire cluster / all the masters are shutdown and the connection is not valid anymore. TODO: There should be a more coherent way of doing this. Unfortunately the way tests are written, not all start() stop() calls go through this class. Most tests directly operate on the underlying mini/local hbase cluster. That makes it difficult for this wrapper class to maintain the connection state automatically. Cleaning this is a much bigger refactor.- Throws:
IOException
-
getConnection
Deprecated.Get a shared Connection to the cluster. this method is thread safe.- Returns:
- A Connection that can be shared. Don't close. Will be closed on shutdown of cluster.
- Throws:
IOException
-
getConnection
Deprecated.Get a assigned Connection to the cluster. this method is thread safe.- Parameters:
user- assigned user- Returns:
- A Connection with assigned user.
- Throws:
IOException
-
getAsyncConnection
Deprecated.Get a shared AsyncClusterConnection to the cluster. this method is thread safe.- Returns:
- An AsyncClusterConnection that can be shared. Don't close. Will be closed on shutdown of cluster.
- Throws:
IOException
-
getAsyncConnection
Deprecated.Get a assigned AsyncClusterConnection to the cluster. this method is thread safe.- Parameters:
user- assigned user- Returns:
- An AsyncClusterConnection with assigned user.
- Throws:
IOException
-
closeConnection
Deprecated.- Throws:
IOException
-
getAdmin
Deprecated.Returns an Admin instance which is shared between HBaseTestingUtility instance users. Closing it has no effect, it will be closed automatically when the cluster shutdowns- Throws:
IOException
-
getHbck
Deprecated.Returns anHbckinstance. Needs be closed when done.- Throws:
IOException
-
unassignRegion
Deprecated.Unassign the named region.- Parameters:
regionName- The region to unassign.- Throws:
IOException
-
unassignRegion
Deprecated.Unassign the named region.- Parameters:
regionName- The region to unassign.- Throws:
IOException
-
unassignRegionByRow
Deprecated.Closes the region containing the given row.- Parameters:
row- The row to find the containing region.table- The table to find the region.- Throws:
IOException
-
unassignRegionByRow
Deprecated.Closes the region containing the given row.- Parameters:
row- The row to find the containing region.table- The table to find the region.- Throws:
IOException
-
getSplittableRegion
Deprecated.Retrieves a splittable region randomly from tableName- Parameters:
tableName- name of tablemaxAttempts- maximum number of attempts, unlimited for value of -1- Returns:
- the HRegion chosen, null if none was found within limit of maxAttempts
-
getDFSCluster
Deprecated. -
setDFSCluster
public void setDFSCluster(org.apache.hadoop.hdfs.MiniDFSCluster cluster) throws IllegalStateException, IOException Deprecated.- Throws:
IllegalStateExceptionIOException
-
setDFSCluster
public void setDFSCluster(org.apache.hadoop.hdfs.MiniDFSCluster cluster, boolean requireDown) throws IllegalStateException, IOException Deprecated.Set the MiniDFSCluster- Parameters:
cluster- cluster to userequireDown- require the that cluster not be "up" (MiniDFSCluster#isClusterUp) before it is set.- Throws:
IllegalStateException- if the passed cluster is up when it is required to be downIOException- if the FileSystem could not be set from the passed dfs cluster
-
getTestFileSystem
Deprecated.- Throws:
IOException
-
waitTableAvailable
Deprecated.Wait until all regions in a table have been assigned. Waits default timeout before giving up (30 seconds).- Parameters:
table- Table to wait on.- Throws:
InterruptedExceptionIOException
-
waitTableAvailable
public void waitTableAvailable(TableName table, long timeoutMillis) throws InterruptedException, IOException Deprecated.- Throws:
InterruptedExceptionIOException
-
waitTableAvailable
public void waitTableAvailable(byte[] table, long timeoutMillis) throws InterruptedException, IOException Deprecated.Wait until all regions in a table have been assigned- Parameters:
table- Table to wait on.timeoutMillis- Timeout.- Throws:
InterruptedExceptionIOException
-
explainTableAvailability
Deprecated.- Throws:
IOException
-
explainTableState
Deprecated.- Throws:
IOException
-
findLastTableState
Deprecated.- Throws:
IOException
-
waitTableEnabled
Deprecated.Waits for a table to be 'enabled'. Enabled means that table is set as 'enabled' and the regions have been all assigned. Will timeout after default period (30 seconds) Tolerates nonexistent table.- Parameters:
table- the table to wait on.- Throws:
InterruptedException- if interrupted while waitingIOException- if an IO problem is encountered
-
waitTableEnabled
public void waitTableEnabled(byte[] table, long timeoutMillis) throws InterruptedException, IOException Deprecated.Waits for a table to be 'enabled'. Enabled means that table is set as 'enabled' and the regions have been all assigned.- Parameters:
table- Table to wait on.timeoutMillis- Time to wait on it being marked enabled.- Throws:
InterruptedExceptionIOException- See Also:
-
waitTableEnabled
Deprecated.- Throws:
IOException
-
waitTableDisabled
Deprecated.Waits for a table to be 'disabled'. Disabled means that table is set as 'disabled' Will timeout after default period (30 seconds)- Parameters:
table- Table to wait on.- Throws:
InterruptedExceptionIOException
-
waitTableDisabled
public void waitTableDisabled(TableName table, long millisTimeout) throws InterruptedException, IOException Deprecated.- Throws:
InterruptedExceptionIOException
-
waitTableDisabled
public void waitTableDisabled(byte[] table, long timeoutMillis) throws InterruptedException, IOException Deprecated.Waits for a table to be 'disabled'. Disabled means that table is set as 'disabled'- Parameters:
table- Table to wait on.timeoutMillis- Time to wait on it being marked disabled.- Throws:
InterruptedExceptionIOException
-
ensureSomeRegionServersAvailable
Deprecated.Make sure that at least the specified number of region servers are running- Parameters:
num- minimum number of region servers that should be running- Returns:
- true if we started some servers
- Throws:
IOException
-
ensureSomeNonStoppedRegionServersAvailable
Deprecated.Make sure that at least the specified number of region servers are running. We don't count the ones that are currently stopping or are stopped.- Parameters:
num- minimum number of region servers that should be running- Returns:
- true if we started some servers
- Throws:
IOException
-
getDifferentUser
public static User getDifferentUser(org.apache.hadoop.conf.Configuration c, String differentiatingSuffix) throws IOException Deprecated.This method clones the passedcconfiguration setting a new user into the clone. Use it getting new instances of FileSystem. Only works for DistributedFileSystem w/o Kerberos.- Parameters:
c- Initial configurationdifferentiatingSuffix- Suffix to differentiate this user from others.- Returns:
- A new configuration instance with a different user set into it.
- Throws:
IOException
-
getAllOnlineRegions
Deprecated.- Throws:
IOException
-
setMaxRecoveryErrorCount
Deprecated.Set maxRecoveryErrorCount in DFSClient. In 0.20 pre-append its hard-coded to 5 and makes tests linger. Here is the exception you'll see:2010-06-15 11:52:28,511 WARN [DataStreamer for file /hbase/.logs/wal.1276627923013 block blk_928005470262850423_1021] hdfs.DFSClient$DFSOutputStream(2657): Error Recovery for block blk_928005470262850423_1021 failed because recovery from primary datanode 127.0.0.1:53683 failed 4 times. Pipeline was 127.0.0.1:53687, 127.0.0.1:53683. Will retry...
- Parameters:
stream- A DFSClient.DFSOutputStream.
-
assignRegion
Deprecated.Uses directly the assignment manager to assign the region. and waits until the specified region has completed assignment.- Returns:
- true if the region is assigned false otherwise.
- Throws:
IOExceptionInterruptedException
-
moveRegionAndWait
public void moveRegionAndWait(RegionInfo destRegion, ServerName destServer) throws InterruptedException, IOException Deprecated.Move region to destination server and wait till region is completely moved and online- Parameters:
destRegion- region to movedestServer- destination server of the region- Throws:
InterruptedExceptionIOException
-
waitUntilAllRegionsAssigned
Deprecated.Wait until all regions for a table in hbase:meta have a non-empty info:server, up to a configuable timeout value (default is 60 seconds) This means all regions have been deployed, master has been informed and updated hbase:meta with the regions deployed server.- Parameters:
tableName- the table name- Throws:
IOException
-
waitUntilAllSystemRegionsAssigned
Deprecated.Waith until all system table's regions get assigned- Throws:
IOException
-
waitUntilAllRegionsAssigned
Deprecated.Wait until all regions for a table in hbase:meta have a non-empty info:server, or until timeout. This means all regions have been deployed, master has been informed and updated hbase:meta with the regions deployed server.- Parameters:
tableName- the table nametimeout- timeout, in milliseconds- Throws:
IOException
-
getFromStoreFile
Deprecated.Do a small get/scan against one store. This is required because store has no actual methods of querying itself, and relies on StoreScanner.- Throws:
IOException
-
getRegionSplitStartKeys
Deprecated.Create region split keys between startkey and endKey- Parameters:
numRegions- the number of regions to be created. it has to be greater than 3.- Returns:
- resulting split keys
-
assertKVListsEqual
public static void assertKVListsEqual(String additionalMsg, List<? extends Cell> expected, List<? extends Cell> actual) Deprecated. -
safeGetAsStr
Deprecated. -
getRpcConnnectionURI
Deprecated.- Throws:
UnknownHostException
-
getZkConnectionURI
Deprecated. -
getClusterKey
Deprecated.since 2.7.0, will be removed in 4.0.0. Now we use connection uri to specify the connection info of a cluster. Keep here only for compatibility.Get the zk based cluster key for this cluster.- See Also:
-
createRandomTable
public Table createRandomTable(TableName tableName, Collection<String> families, int maxVersions, int numColsPerRow, int numFlushes, int numRegions, int numRowsPerFlush) throws IOException, InterruptedException Deprecated.Creates a random table with the given parameters- Throws:
IOExceptionInterruptedException
-
randomFreePort
Deprecated. -
randomMultiCastAddress
Deprecated. -
waitForHostPort
Deprecated.- Throws:
IOException
-
createPreSplitLoadTestTable
public static int createPreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableName tableName, byte[] columnFamily, Compression.Algorithm compression, DataBlockEncoding dataBlockEncoding) throws IOException Deprecated.Creates a pre-split table for load testing. If the table already exists, logs a warning and continues.- Returns:
- the number of regions the table was split into
- Throws:
IOException
-
createPreSplitLoadTestTable
public static int createPreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableName tableName, byte[] columnFamily, Compression.Algorithm compression, DataBlockEncoding dataBlockEncoding, int numRegionsPerServer, int regionReplication, Durability durability) throws IOException Deprecated.Creates a pre-split table for load testing. If the table already exists, logs a warning and continues.- Returns:
- the number of regions the table was split into
- Throws:
IOException
-
createPreSplitLoadTestTable
public static int createPreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableName tableName, byte[][] columnFamilies, Compression.Algorithm compression, DataBlockEncoding dataBlockEncoding, int numRegionsPerServer, int regionReplication, Durability durability) throws IOException Deprecated.Creates a pre-split table for load testing. If the table already exists, logs a warning and continues.- Returns:
- the number of regions the table was split into
- Throws:
IOException
-
createPreSplitLoadTestTable
public static int createPreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor desc, ColumnFamilyDescriptor hcd) throws IOException Deprecated.Creates a pre-split table for load testing. If the table already exists, logs a warning and continues.- Returns:
- the number of regions the table was split into
- Throws:
IOException
-
createPreSplitLoadTestTable
public static int createPreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor desc, ColumnFamilyDescriptor hcd, int numRegionsPerServer) throws IOException Deprecated.Creates a pre-split table for load testing. If the table already exists, logs a warning and continues.- Returns:
- the number of regions the table was split into
- Throws:
IOException
-
createPreSplitLoadTestTable
public static int createPreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor desc, ColumnFamilyDescriptor[] hcds, int numRegionsPerServer) throws IOException Deprecated.Creates a pre-split table for load testing. If the table already exists, logs a warning and continues.- Returns:
- the number of regions the table was split into
- Throws:
IOException
-
createPreSplitLoadTestTable
public static int createPreSplitLoadTestTable(org.apache.hadoop.conf.Configuration conf, TableDescriptor td, ColumnFamilyDescriptor[] cds, RegionSplitter.SplitAlgorithm splitter, int numRegionsPerServer) throws IOException Deprecated.Creates a pre-split table for load testing. If the table already exists, logs a warning and continues.- Returns:
- the number of regions the table was split into
- Throws:
IOException
-
getMetaRSPort
Deprecated.- Throws:
IOException
-
assertRegionOnServer
public void assertRegionOnServer(RegionInfo hri, ServerName server, long timeout) throws IOException, InterruptedException Deprecated.Due to async racing issue, a region may not be in the online region list of a region server yet, after the assignment znode is deleted and the new assignment is recorded in master.- Throws:
IOExceptionInterruptedException
-
assertRegionOnlyOnServer
public void assertRegionOnlyOnServer(RegionInfo hri, ServerName server, long timeout) throws IOException, InterruptedException Deprecated.Check to make sure the region is open on the specified region server, but not on any other one.- Throws:
IOExceptionInterruptedException
-
createTestRegion
Deprecated.- Throws:
IOException
-
createTestRegion
public HRegion createTestRegion(String tableName, ColumnFamilyDescriptor cd, BlockCache blockCache) throws IOException Deprecated.- Throws:
IOException
-
setFileSystemURI
Deprecated. -
predicateNoRegionsInTransition
Deprecated.Returns aPredicatefor checking that there are no regions in transition in master -
predicateTableEnabled
Deprecated.Returns aPredicatefor checking that table is enabled -
predicateTableDisabled
Deprecated.Returns aPredicatefor checking that table is enabled -
predicateTableAvailable
Deprecated.Returns aPredicatefor checking that table is enabled -
waitUntilNoRegionsInTransition
Deprecated.Wait until no regions in transition.- Parameters:
timeout- How long to wait.- Throws:
IOException
-
waitUntilNoRegionsInTransition
Deprecated.Wait until no regions in transition. (time limit 15min)- Throws:
IOException
-
waitLabelAvailable
Deprecated.Wait until labels is ready in VisibilityLabelsCache. -
generateColumnDescriptors
Deprecated.Create a set of column descriptors with the combination of compression, encoding, bloom codecs available.- Returns:
- the list of column descriptors
-
generateColumnDescriptors
Deprecated.Create a set of column descriptors with the combination of compression, encoding, bloom codecs available.- Parameters:
prefix- family names prefix- Returns:
- the list of column descriptors
-
getSupportedCompressionAlgorithms
Deprecated.Get supported compression algorithms.- Returns:
- supported compression algorithms.
-
getClosestRowBefore
Deprecated.- Throws:
IOException
-
isTargetTable
Deprecated. -
setupMiniKdc
Deprecated.Sets upMiniKdcfor testing security. UsesHBaseKerberosUtilsto set the given keytab file asHBaseKerberosUtils#KRB_KEYTAB_FILE. FYI, there is also the easier-to-use kerby KDC server and utility for using it,org.apache.hadoop.hbase.util.SimpleKdcServerUtil. The kerby KDC server is preferred; less baggage. It came in in HBASE-5291.- Throws:
Exception
-
getNumHFiles
Deprecated. -
getNumHFilesForRS
Deprecated. -
assertEquals
Deprecated. -
verifyTableDescriptorIgnoreTableName
Deprecated. -
await
Deprecated.Await the successful return ofcondition, sleepingsleepMillisbetween invocations.- Throws:
InterruptedException
-
TestingHBaseClusterinstead.