public class ZookeeperHelper extends Object
Tests that need a Zookeeper instance can initialize a static instance of this class in
their BeforeClass section to set up Zookeeper.
Modified to also work in the ClusterFixture class. The "bare" use sets up a
Drill config. The use in the cluster fixture delegates to the cluster fixture the task
of setting up the Drill config. In the "bare" case, the port number comes from the
Drill config. In the cluster fixture case, we let ZK choose the port and we learn
what it is. As a result, the code is a bit more cluttered than if we could just use
the class for one purpose.
| Constructor and Description |
|---|
ZookeeperHelper()
Constructor.
|
ZookeeperHelper(boolean failureInCancelled,
boolean autoPort)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DrillConfig |
getConfig()
Get the DrillConfig used for the Zookeeper instance.
|
String |
getConnectionString() |
void |
startZookeeper(int numServers)
Start the Zookeeper instance.
|
void |
stopZookeeper()
Shut down the Zookeeper instance.
|
public ZookeeperHelper()
Will create a "test-data" directory for Zookeeper's use if one doesn't already exist.
public ZookeeperHelper(boolean failureInCancelled,
boolean autoPort)
Will create a "test-data" directory for Zookeeper's use if one doesn't already exist.
failureInCancelled - pass true if you want failures in cancelled fragments to be reported as failurespublic void startZookeeper(int numServers)
This must be used before any operations that depend on the Zookeeper instance being up.
numServers - how many servers the Zookeeper instance should havepublic void stopZookeeper()
This must be used before the program exits.
public DrillConfig getConfig()
public String getConnectionString()
Copyright © 2021 The Apache Software Foundation. All rights reserved.