/** * Start Zookeeper service. */ public void start() { if (getNodeConfig().isZkEnabled()) { LOG.info("Control service starting ZooKepper connection to {}", getNodeConfig().getZkHostPortList()); ControlNodeInfo nodeInfo = new ControlNodeInfo(); ConnectionInfo connectionInfo = new ConnectionInfo( getNodeConfig().getThriftHost(), getNodeConfig().getThriftPort(), null); nodeInfo.setConnectionInfo(connectionInfo); controlZkNode = new ControlNode(nodeInfo, zkClient); try { controlZkNode.start(); } catch (Exception ex) { if (getNodeConfig().isZkIgnoreErrors()) { LOG.info("Failed to register control in ZooKeeper", ex); } else { LOG.error("Failed to register control in ZooKeeper", ex); throw new RuntimeException(ex); // NOSONAR } } } }