@InterfaceAudience.Public public class HBaseZKTestingUtility extends HBaseCommonTestingUtility
HBaseCommonTestingUtility
is that we can start a zookeeper cluster.HBaseCommonTestingUtility.PortAllocator
Modifier and Type | Field and Description |
---|---|
protected File |
clusterTestDir
Directory (a subdirectory of dataTestDir) used by the dfs cluster if any
|
private boolean |
passedZkCluster
Set if we were passed a zkCluster.
|
private org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster |
zkCluster |
protected org.apache.hadoop.hbase.zookeeper.ZKWatcher |
zooKeeperWatcher |
BASE_TEST_DIRECTORY_KEY, BOOLEAN_PARAMETERIZED, COMPRESSION_ALGORITHMS, COMPRESSION_ALGORITHMS_PARAMETERIZED, conf, DEFAULT_BASE_TEST_DIRECTORY, LOG, random
Constructor and Description |
---|
HBaseZKTestingUtility() |
HBaseZKTestingUtility(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
boolean |
cleanupTestDir() |
(package private) org.apache.hadoop.fs.Path |
getClusterTestDir() |
org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster |
getZkCluster() |
org.apache.hadoop.hbase.zookeeper.ZKWatcher |
getZooKeeperWatcher()
Returns a ZKWatcher instance.
|
static org.apache.hadoop.hbase.zookeeper.ZKWatcher |
getZooKeeperWatcher(HBaseZKTestingUtility testUtil)
Gets a ZKWatcher.
|
protected void |
setupClusterTestDir()
Creates a directory for the cluster, under the test data
|
void |
setZkCluster(org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster zkCluster) |
void |
shutdownMiniZKCluster()
Shuts down zk cluster created by call to
startMiniZKCluster() or does nothing. |
org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster |
startMiniZKCluster()
Call this if you only want a zk cluster.
|
private org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster |
startMiniZKCluster(File dir,
int zooKeeperServerNum,
int[] clientPortList)
Start a mini ZK cluster.
|
org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster |
startMiniZKCluster(int zooKeeperServerNum,
int... clientPortList)
Call this if you only want a zk cluster.
|
cleanupTestDir, createSubDir, deleteDir, deleteOnExit, getConfiguration, getDataTestDir, getDataTestDir, getRandomDir, getRandomUUID, randomFreePort, setupDataTestDir, waitFor, waitFor, waitFor
private org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster zkCluster
private boolean passedZkCluster
protected org.apache.hadoop.hbase.zookeeper.ZKWatcher zooKeeperWatcher
protected File clusterTestDir
public HBaseZKTestingUtility()
public HBaseZKTestingUtility(org.apache.hadoop.conf.Configuration conf)
org.apache.hadoop.fs.Path getClusterTestDir()
HBaseCommonTestingUtility#getBaseTestDir()
protected void setupClusterTestDir()
public org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster startMiniZKCluster() throws Exception
Exception
shutdownMiniZKCluster()
public org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster startMiniZKCluster(int zooKeeperServerNum, int... clientPortList) throws Exception
Exception
shutdownMiniZKCluster()
private org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster startMiniZKCluster(File dir, int zooKeeperServerNum, int[] clientPortList) throws Exception
Exception
public org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster getZkCluster()
public void setZkCluster(org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster zkCluster)
public void shutdownMiniZKCluster() throws IOException
startMiniZKCluster()
or does nothing.IOException
startMiniZKCluster()
public org.apache.hadoop.hbase.zookeeper.ZKWatcher getZooKeeperWatcher() throws IOException
IOException
public static org.apache.hadoop.hbase.zookeeper.ZKWatcher getZooKeeperWatcher(HBaseZKTestingUtility testUtil) throws IOException
IOException
public boolean cleanupTestDir()
cleanupTestDir
in class HBaseCommonTestingUtility
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.