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 |
---|---|
protected org.apache.solr.common.cloud.SolrZkClient |
chRootClient |
protected org.apache.solr.common.cloud.SolrZkClient |
rootClient |
static File |
SOLRHOME |
static int |
TICK_TIME |
static int |
TIMEOUT |
protected org.apache.solr.cloud.ZkTestServer.ZKServerMain |
zkServer |
Constructor and Description |
---|
ZkTestServer(Path zkDir) |
ZkTestServer(Path zkDir,
int port) |
Modifier and Type | Method and Description |
---|---|
void |
buildZooKeeper(File solrhome,
String config,
String schema) |
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 |
getMaxSessionTimeout() |
int |
getMinSessionTimeout() |
int |
getPort() |
int |
getTheTickTime() |
String |
getZkAddress() |
String |
getZkAddress(String chroot)
Get a connection string for this server with a given chroot
|
org.apache.solr.common.cloud.SolrZkClient |
getZkClient() |
org.apache.zookeeper.server.ZKDatabase |
getZKDatabase() |
Path |
getZkDir() |
String |
getZkHost() |
void |
makeSolrZkNode() |
static List<ZkTestServer.HostPort> |
parseHostPortList(String hplist) |
protected void |
printLayout() |
static void |
putConfig(String confName,
org.apache.solr.common.cloud.SolrZkClient zkClient,
File solrhome,
String name) |
static void |
putConfig(String confName,
org.apache.solr.common.cloud.SolrZkClient zkClient,
File solrhome,
String srcName,
String destName) |
static void |
putConfig(String confName,
org.apache.solr.common.cloud.SolrZkClient zkClient,
String zkChroot,
File solrhome,
String srcName,
String destName) |
void |
run() |
void |
run(boolean solrFormat) |
static String |
send4LetterWord(String host,
int port,
String cmd)
Send the 4letterword
|
void |
setMaxSessionTimeout(int maxSessionTimeout) |
void |
setMinSessionTimeout(int minSessionTimeout) |
void |
setTheTickTime(int theTickTime) |
void |
setViolationReportAction(ZkTestServer.LimitViolationAction violationReportAction) |
void |
setZKDatabase(org.apache.zookeeper.server.ZKDatabase zkDb) |
void |
shutdown() |
void |
tryCleanSolrZkNode() |
static boolean |
waitForServerDown(String hp,
long timeoutMs) |
static boolean |
waitForServerUp(String hp,
long timeoutMs) |
public static File SOLRHOME
public static final int TIMEOUT
public static final int TICK_TIME
protected final org.apache.solr.cloud.ZkTestServer.ZKServerMain zkServer
protected volatile org.apache.solr.common.cloud.SolrZkClient rootClient
protected volatile org.apache.solr.common.cloud.SolrZkClient chRootClient
public ZkTestServer(Path zkDir, int port) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
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, IOException
InterruptedException
IOException
public void run(boolean solrFormat) throws InterruptedException, IOException
InterruptedException
IOException
public void shutdown() throws IOException, InterruptedException
IOException
InterruptedException
public static boolean waitForServerDown(String hp, long timeoutMs)
public static boolean waitForServerUp(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 Path getZkDir()
public void setViolationReportAction(ZkTestServer.LimitViolationAction violationReportAction)
public org.apache.solr.cloud.ZkTestServer.ZKServerMain.WatchLimiter getLimiter()
public int getMaxSessionTimeout()
public int getMinSessionTimeout()
public void setMaxSessionTimeout(int maxSessionTimeout)
public void setMinSessionTimeout(int minSessionTimeout)
public static void putConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, File solrhome, String name) throws Exception
Exception
public static void putConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, File solrhome, String srcName, String destName) throws Exception
Exception
public static void putConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, String zkChroot, File solrhome, String srcName, String destName) throws Exception
Exception
public void buildZooKeeper(File solrhome, String config, String schema) throws Exception
Exception
public org.apache.solr.common.cloud.SolrZkClient getZkClient()
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.