InteractionProtocol { public void explainStructure() { for (PathDef pathDef : PathDef.values()) { String zkPath = _zkConf.getZkPath(pathDef); System.out.println(StringUtil.fillWithWhiteSpace(zkPath, 40) + "\t" + pathDef.getDescription()); } } InteractionProtocol(ZkClient zkClient, ZkConfiguration zkConfiguration); void registerComponent(ConnectedComponent connectedComponent); void unregisterComponent(ConnectedComponent component); void disconnect(); int getRegisteredComponentCount(); int getRegisteredListenerCount(); List<String> registerChildListener(ConnectedComponent component, PathDef pathDef, IAddRemoveListener listener); List<String> registerChildListener(ConnectedComponent component, PathDef pathDef, String childName,
          IAddRemoveListener listener); void unregisterChildListener(ConnectedComponent component, PathDef pathDef); void unregisterChildListener(ConnectedComponent component, PathDef pathDef, String childName); void registerDataListener(ConnectedComponent component, PathDef pathDef, String childName,
          IZkDataListener listener); void unregisterDataChanges(ConnectedComponent component, PathDef pathDef, String childName); void unregisterDataChanges(ConnectedComponent component, String dataPath); List<String> getKnownNodes(); List<String> getLiveNodes(); List<String> getIndices(); MasterMetaData getMasterMD(); NodeMetaData getNodeMD(String node); Collection<String> getNodeShards(String nodeName); int getShardReplication(String shard); long getShardAnnounceTime(String node, String shard); Map<String, List<String>> getShard2NodesMap(Collection<String> shardNames); List<String> getShardNodes(String shard); List<String> getShard2NodeShards(); ReplicationReport getReplicationReport(IndexMetaData indexMD); MasterQueue publishMaster(final Master master); NodeQueue publishNode(Node node, NodeMetaData nodeMetaData); void publishIndex(IndexMetaData indexMD); void unpublishIndex(String indexName); IndexMetaData getIndexMD(String index); void updateIndexMD(IndexMetaData indexMD); void publishShard(Node node, String shardName); void unpublishShard(Node node, String shard); void setMetric(String nodeName, MetricsRecord metricsRecord); MetricsRecord getMetric(String nodeName); void addMasterOperation(MasterOperation operation); OperationId addNodeOperation(String nodeName, NodeOperation nodeOperation); OperationResult getNodeOperationResult(OperationId operationId, boolean remove); boolean isNodeOperationQueued(OperationId operationId); void registerNodeOperationListener(ConnectedComponent component, OperationId operationId,
          IZkDataListener dataListener); boolean indexExists(String indexName); void showStructure(final boolean all); void explainStructure(); void setVersion(Version version); Version getVersion(); void setFlag(String name); boolean flagExists(String name); void removeFlag(String name); ZkConfiguration getZkConfiguration(); ZkClient getZkClient();  }
@Test(timeout = 7000) public void testExplainStructure() throws Exception { _protocol.explainStructure(); System.out.println("----------------"); _protocol.showStructure(false); System.out.println("----------------"); _protocol.showStructure(true); }