@InterfaceAudience.Public public class HBaseZKTestingUtility extends HBaseCommonTestingUtility
HBaseCommonTestingUtility
is that we can start a zookeeper cluster.Modifier and Type | Field and Description |
---|---|
protected File |
clusterTestDir
Directory (a subdirectory of dataTestDir) used by the dfs cluster if any
|
protected ZKWatcher |
zooKeeperWatcher |
BASE_TEST_DIRECTORY_KEY, BOOLEAN_PARAMETERIZED, COMPRESSION_ALGORITHMS, COMPRESSION_ALGORITHMS_PARAMETERIZED, conf, DEFAULT_BASE_TEST_DIRECTORY, LOG
Constructor and Description |
---|
HBaseZKTestingUtility() |
HBaseZKTestingUtility(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
boolean |
cleanupTestDir() |
MiniZooKeeperCluster |
getZkCluster() |
ZKWatcher |
getZooKeeperWatcher()
Returns a ZKWatcher instance.
|
static ZKWatcher |
getZooKeeperWatcher(HBaseZKTestingUtility testUtil)
Gets a ZKWatcher.
|
protected void |
setupClusterTestDir()
Creates a directory for the cluster, under the test data
|
void |
setZkCluster(MiniZooKeeperCluster zkCluster) |
void |
shutdownMiniZKCluster()
Shuts down zk cluster created by call to
#startMiniZKCluster(File) or does nothing. |
MiniZooKeeperCluster |
startMiniZKCluster()
Call this if you only want a zk cluster.
|
MiniZooKeeperCluster |
startMiniZKCluster(int zooKeeperServerNum,
int... clientPortList)
Call this if you only want a zk cluster.
|
createSubDir, getConfiguration, getDataTestDir, getDataTestDir, getRandomDir, getRandomUUID, setupDataTestDir, waitFor, waitFor, waitFor
protected ZKWatcher zooKeeperWatcher
protected File clusterTestDir
public HBaseZKTestingUtility()
public HBaseZKTestingUtility(org.apache.hadoop.conf.Configuration conf)
protected void setupClusterTestDir()
public MiniZooKeeperCluster startMiniZKCluster() throws Exception
Exception
shutdownMiniZKCluster()
public MiniZooKeeperCluster startMiniZKCluster(int zooKeeperServerNum, int... clientPortList) throws Exception
Exception
shutdownMiniZKCluster()
public MiniZooKeeperCluster getZkCluster()
public void setZkCluster(MiniZooKeeperCluster zkCluster)
public void shutdownMiniZKCluster() throws IOException
#startMiniZKCluster(File)
or does nothing.IOException
startMiniZKCluster()
public ZKWatcher getZooKeeperWatcher() throws IOException
IOException
public static ZKWatcher getZooKeeperWatcher(HBaseZKTestingUtility testUtil) throws IOException
IOException
public boolean cleanupTestDir() throws IOException
cleanupTestDir
in class HBaseCommonTestingUtility
IOException
Copyright © 2007–2019 Cloudera. All rights reserved.