org.apache.solr.cloud

## Class ZkTestServer

- java.lang.Object
- - org.apache.solr.cloud.ZkTestServer

-     public class ZkTestServer
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ZkTestServer.HostPort`
    `static class` | `ZkTestServer.LimitViolationAction`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `TICK_TIME`
    `protected org.apache.solr.cloud.ZkTestServer.ZKServerMain` | `zkServer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZkTestServer(String zkDir)`
    `ZkTestServer(String zkDir, int port)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TICK_TIME

          public static final int TICK_TIME

      See Also:
        Constant Field Values

    - #### zkServer

          protected final org.apache.solr.cloud.ZkTestServer.ZKServerMain zkServer

  - ### Constructor Detail

    - #### ZkTestServer

          public ZkTestServer(String zkDir)

    - #### ZkTestServer

          public ZkTestServer(String zkDir,
                              int port)

  - ### Method Detail

    - #### getZkHost

          public String getZkHost()

    - #### getZkAddress

          public String getZkAddress()

    - #### getZkAddress

          public String getZkAddress(String chroot)

      Get a connection string for this server with a given chroot
      Parameters:
        `chroot` - the chroot
      Returns:
        the connection string

    - #### ensurePathExists

          public void ensurePathExists(String path)
                                throws IOException

      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

          public void run()
                   throws InterruptedException

      Throws:
        `InterruptedException`

    - #### shutdown

          public void shutdown()
                        throws IOException,
                               InterruptedException

      Throws:
        `IOException`
        `InterruptedException`

    - #### waitForServerDown

          public static boolean waitForServerDown(String hp,
                                                  long timeoutMs)

    - #### send4LetterWord

          public static String send4LetterWord(String host,
                                               int port,
                                               String cmd)
                                        throws IOException

      Send the 4letterword
      Parameters:
        `host` - the destination host
        `port` - the destination port
        `cmd` - the 4letterword
      Returns:
        server response
      Throws:
        `IOException`

    - #### parseHostPortList

          public static List<ZkTestServer.HostPort> parseHostPortList(String hplist)

    - #### getTheTickTime

          public int getTheTickTime()

    - #### setTheTickTime

          public void setTheTickTime(int theTickTime)

    - #### getZkDir

          public String getZkDir()

    - #### setViolationReportAction

          public void setViolationReportAction(ZkTestServer.LimitViolationAction violationReportAction)

    - #### getLimiter

          public org.apache.solr.cloud.ZkTestServer.ZKServerMain.WatchLimiter getLimiter()

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.