public class ZkTestServer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ZkTestServer.HostPort |
static class |
ZkTestServer.LimitViolationAction |
Modifier and Type | Field and Description |
---|---|
static int |
TICK_TIME |
protected org.apache.solr.cloud.ZkTestServer.ZKServerMain |
zkServer |
Constructor and Description |
---|
ZkTestServer(String zkDir) |
ZkTestServer(String zkDir,
int port) |
Modifier and Type | Method and Description |
---|---|
void |
ensurePathExists(String path)
Check that a path exists in this server
|
void |
expire(long sessionId) |
org.apache.solr.cloud.ZkTestServer.ZKServerMain.WatchLimiter |
getLimiter() |
int |
getPort() |
int |
getTheTickTime() |
String |
getZkAddress() |
String |
getZkAddress(String chroot)
Get a connection string for this server with a given chroot
|
org.apache.zookeeper.server.ZKDatabase |
getZKDatabase() |
String |
getZkDir() |
String |
getZkHost() |
static List<ZkTestServer.HostPort> |
parseHostPortList(String hplist) |
void |
run() |
static String |
send4LetterWord(String host,
int port,
String cmd)
Send the 4letterword
|
void |
setTheTickTime(int theTickTime) |
void |
setViolationReportAction(ZkTestServer.LimitViolationAction violationReportAction) |
void |
setZKDatabase(org.apache.zookeeper.server.ZKDatabase zkDb) |
void |
shutdown() |
static boolean |
waitForServerDown(String hp,
long timeoutMs) |
public static final int TICK_TIME
protected final org.apache.solr.cloud.ZkTestServer.ZKServerMain zkServer
public ZkTestServer(String zkDir)
public ZkTestServer(String zkDir, int port)
public String getZkHost()
public String getZkAddress()
public String getZkAddress(String chroot)
chroot
- the chrootpublic void ensurePathExists(String path) throws IOException
path
- the path to checkIOException
- if an IO exception occurspublic int getPort()
public void expire(long sessionId)
public org.apache.zookeeper.server.ZKDatabase getZKDatabase()
public void setZKDatabase(org.apache.zookeeper.server.ZKDatabase zkDb)
public void run() throws InterruptedException
InterruptedException
public void shutdown() throws IOException, InterruptedException
IOException
InterruptedException
public static boolean waitForServerDown(String hp, long timeoutMs)
public static String send4LetterWord(String host, int port, String cmd) throws IOException
host
- the destination hostport
- the destination portcmd
- the 4letterwordIOException
public static List<ZkTestServer.HostPort> parseHostPortList(String hplist)
public int getTheTickTime()
public void setTheTickTime(int theTickTime)
public String getZkDir()
public void setViolationReportAction(ZkTestServer.LimitViolationAction violationReportAction)
public org.apache.solr.cloud.ZkTestServer.ZKServerMain.WatchLimiter getLimiter()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.