Package org.apache.hadoop.hbase.testing
Class TestingHBaseClusterOption
java.lang.Object
org.apache.hadoop.hbase.testing.TestingHBaseClusterOption
Options for starting up a mini testing cluster
TestingHBaseCluster
(including an hbase,
dfs and zookeeper clusters) in test. The options include HDFS options to build mini dfs cluster,
Zookeeper options to build mini zk cluster, and mostly HBase options to build mini hbase cluster.
To create an object, use a TestingHBaseClusterOption.Builder
. Example usage:
TestingHBaseClusterOption option = TestingHBaseClusterOption.builder(). .numMasters(3).createWALDir(true).build();Default values can be found in
TestingHBaseClusterOption.Builder
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder pattern for creating anTestingHBaseClusterOption
. -
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.hadoop.conf.Configuration
Configuration for this testing cluster.private final boolean
Whether to create a new root or data directory path.private final boolean
Whether to create a new WAL directory.private final String[]
The hostnames of DataNodes to run on.private final String
private final String
private final int
Number of masters that always remain standby.private final int
Number of datanodes.private final int
Number of masters to start up.private final int
Number of region servers to start up.private final int
Number of Zookeeper servers.Ports that RegionServer should use. -
Constructor Summary
ModifierConstructorDescriptionprivate
TestingHBaseClusterOption
(org.apache.hadoop.conf.Configuration conf, int numMasters, int numAlwaysStandByMasters, int numRegionServers, List<Integer> rsPorts, int numDataNodes, String[] dataNodeHosts, int numZkServers, boolean createRootDir, boolean createWALDir, String externalDfsUri, String externalZkConnectString) Private constructor. -
Method Summary
-
Field Details
-
conf
Configuration for this testing cluster. Can benull
. -
numMasters
Number of masters to start up. We'll start this many hbase masters. -
numAlwaysStandByMasters
Number of masters that always remain standby. These set of masters never transition to active even if an active master does not exist. -
numRegionServers
Number of region servers to start up. If this value is > 1, then make sure config "hbase.regionserver.info.port" is -1 (i.e. no ui per regionserver) otherwise bind errors. -
rsPorts
Ports that RegionServer should use. Pass ports if you want to test cluster restart where for sure the regionservers come up on same address+port (but just with different startcode); by default mini hbase clusters choose new arbitrary ports on each cluster start. -
numDataNodes
Number of datanodes. Used to create mini DSF cluster. Surpassed bydataNodeHosts
size. -
dataNodeHosts
The hostnames of DataNodes to run on. 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. -
numZkServers
Number of Zookeeper servers. -
createRootDir
Whether to create a new root or data directory path. If true, the newly created data directory will be configured as HBase rootdir. This will overwrite existing root directory config. -
createWALDir
Whether to create a new WAL directory. If true, the newly created directory will be configured as HBase wal.dir which is separate from HBase rootdir. -
externalDfsUri
-
externalZkConnectString
-
-
Constructor Details
-
TestingHBaseClusterOption
private TestingHBaseClusterOption(org.apache.hadoop.conf.Configuration conf, int numMasters, int numAlwaysStandByMasters, int numRegionServers, List<Integer> rsPorts, int numDataNodes, String[] dataNodeHosts, int numZkServers, boolean createRootDir, boolean createWALDir, String externalDfsUri, String externalZkConnectString) Private constructor. UseTestingHBaseClusterOption.Builder.build()
.
-
-
Method Details
-
conf
-
getNumMasters
-
getNumAlwaysStandByMasters
-
getNumRegionServers
-
getRsPorts
-
getNumDataNodes
-
getDataNodeHosts
-
getNumZkServers
-
isCreateRootDir
-
isCreateWALDir
-
getExternalDfsUri
-
getExternalZkConnectString
-
toString
-
convert
StartMiniClusterOption convert()Convert to the internal option. Not for public use so package private. -
builder
Returns a new builder.
-