Examples of ZookeeperResponse


Examples of org.platformlayer.service.zookeeper.ops.ZookeeperUtils.ZookeeperResponse

      }

      InetSocketAddress socketAddress = endpoint.asSocketAddress();

      {
        ZookeeperResponse response;
        try {
          // IPV6 requires ipsec; use the IPV4 loopback instead
          socketAddress = new InetSocketAddress(InetAddresses.forString("127.0.0.1"), socketAddress.getPort());
          response = ZookeeperUtils.sendCommand(target, socketAddress, "ruok");

          Deviations.assertEquals("imok", response.getRaw(), "Zookeeper ruok status");
        } catch (OpsException e) {
          Deviations.fail("Unable to connect to zookeeper", e);
        }
      }

      {
        ZookeeperResponse response;
        try {
          response = ZookeeperUtils.sendCommand(target, socketAddress, "srvr");

          Map<String, String> responseMap = response.asMap();
          String mode = responseMap.get("Mode");

          Deviations.assertIn(Arrays.asList("follower", "leader"), mode, "Zookeeper mode");
        } catch (OpsException e) {
          Deviations.fail("Unable to connect to zookeeper", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.