Package org.apache.solr.cloud
Class ZkTestServer
java.lang.Object
org.apache.solr.cloud.ZkTestServer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.solr.common.cloud.SolrZkClientprotected org.apache.solr.common.cloud.SolrZkClientstatic Pathstatic final intstatic final intprotected final org.apache.solr.cloud.ZkTestServer.ZKServerMain -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildZooKeeper(Path solrhome, String config, String schema) voidensurePathExists(String path) Check that a path exists in this servervoidexpire(long sessionId) org.apache.solr.cloud.ZkTestServer.ZKServerMain.WatchLimiterintgetPort()getZkAddress(String chroot) Get a connection string for this server with a given chrootorg.apache.solr.common.cloud.SolrZkClientorg.apache.zookeeper.server.ZKDatabasegetZkDir()voidprotected voidUsed for debuggingstatic voidputConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, String zkChroot, Path solrhome, String srcName, String destName) static voidputConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, Path solrhome, String name) static voidputConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, Path solrhome, String srcName, String destName) voidrun()voidrun(boolean solrFormat) voidsetTheTickTime(int theTickTime) voidsetViolationReportAction(ZkTestServer.LimitViolationAction violationReportAction) voidsetZKDatabase(org.apache.zookeeper.server.ZKDatabase zkDb) voidshutdown()void
-
Field Details
-
SOLRHOME
-
TIMEOUT
public static final int TIMEOUT- See Also:
-
TICK_TIME
public static final int TICK_TIME- See Also:
-
zkServer
protected final org.apache.solr.cloud.ZkTestServer.ZKServerMain zkServer -
rootClient
protected volatile org.apache.solr.common.cloud.SolrZkClient rootClient -
chRootClient
protected volatile org.apache.solr.common.cloud.SolrZkClient chRootClient
-
-
Constructor Details
-
ZkTestServer
- Throws:
Exception
-
ZkTestServer
public ZkTestServer(Path zkDir, int port) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
-
Method Details
-
getZkHost
-
getZkAddress
-
getZkAddress
Get a connection string for this server with a given chroot- Parameters:
chroot- the chroot- Returns:
- the connection string
-
ensurePathExists
Check that a path exists in this server- Parameters:
path- the path to check- Throws:
IOException- if an IO exception occurs
-
getPort
public int getPort() -
expire
public void expire(long sessionId) -
getZKDatabase
public org.apache.zookeeper.server.ZKDatabase getZKDatabase() -
setZKDatabase
public void setZKDatabase(org.apache.zookeeper.server.ZKDatabase zkDb) -
run
- Throws:
InterruptedExceptionIOException
-
run
- Throws:
InterruptedExceptionIOException
-
shutdown
- Throws:
IOExceptionInterruptedException
-
setTheTickTime
public void setTheTickTime(int theTickTime) -
getZkDir
-
setViolationReportAction
-
getLimiter
public org.apache.solr.cloud.ZkTestServer.ZKServerMain.WatchLimiter getLimiter() -
putConfig
public static void putConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, Path solrhome, String name) throws Exception - Throws:
Exception
-
putConfig
public static void putConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, Path solrhome, String srcName, String destName) throws Exception - Throws:
Exception
-
putConfig
public static void putConfig(String confName, org.apache.solr.common.cloud.SolrZkClient zkClient, String zkChroot, Path solrhome, String srcName, String destName) throws Exception - Throws:
Exception
-
buildZooKeeper
- Throws:
Exception
-
makeSolrZkNode
- Throws:
Exception
-
tryCleanSolrZkNode
- Throws:
Exception
-
printLayout
Used for debugging- Throws:
Exception
-
getZkClient
public org.apache.solr.common.cloud.SolrZkClient getZkClient()
-