ClusterFacade { public static List<StreamSession> parseStreamSessionJson(String json) throws IOException { return parseJson(json, new TypeReference<List<StreamSession>>(){}); } private  ClusterFacade(AppContext context); static ClusterFacade create(AppContext context); JmxProxy preHeatJmxConnections(Cluster cluster, Collection<String> endpoints); String getClusterName(Cluster cluster, Collection<String> endpoints); String getClusterName(Node node); String getPartitioner(Cluster cluster, Collection<String> endpoints); List<String> getLiveNodes(Cluster cluster); List<String> getLiveNodes(Cluster cluster, Collection<String> endpoints); NodesStatus getNodesStatus(Cluster cluster, Collection<String> endpoints); String getCassandraVersion(Cluster cluster); String getCassandraVersion(Cluster cluster, Collection<String> endpoints); List<BigInteger> getTokens(Cluster cluster); Map<List<String>, List<String>> getRangeToEndpointMap(
      Cluster cluster,
      String keyspace); Set<Table> getTablesForKeyspace(Cluster cluster, String keyspaceName); Map<String, List<String>> listTablesByKeyspace(Cluster cluster); List<String> getKeyspaces(Cluster cluster); Map<String, String> getEndpointToHostId(Cluster cluster); List<String> tokenRangeToEndpoint(Cluster cluster, String keyspace, Segment segment); List<RingRange> getRangesForLocalEndpoint(Cluster cluster, String keyspace); String getDatacenter(Cluster cluster, String endpoint); String getDatacenter(Node node); String getLocalEndpoint(Node node); Map<String, List<String>> getTokensByNode(Cluster cluster); CompactionStats listActiveCompactions(Node node); CompactionStats listCompactionStatsDirect(Node node); boolean nodeIsAccessibleThroughJmx(String nodeDc, String node); Map<String, List<JmxStat>> collectMetrics(Node node, String[] collectedMetrics); List<MetricsHistogram> getClientRequestLatencies(Node node); List<DroppedMessages> getDroppedMessages(Node node); @VisibleForTesting List<DroppedMessages> convertToDroppedMessages(List<GenericMetric> metrics); List<ThreadPoolStat> getTpStats(Node node); @VisibleForTesting List<ThreadPoolStat> convertToThreadPoolStats(List<GenericMetric> metrics); @VisibleForTesting List<MetricsHistogram> convertToMetricsHistogram(List<GenericMetric> metrics); Pair<Node, String> takeSnapshot(String snapshotName, Node host, String... keyspaces); List<Snapshot> listSnapshots(Node host); void clearSnapshot(String snapshotName, Node host); List<StreamSession> listActiveStreams(Node node); List<StreamSession> listStreamsDirect(Node node); static List<StreamSession> parseStreamSessionJson(String json); static CompactionStats parseCompactionStats(String json); JmxProxy connect(Cluster cluster); JmxProxy connect(Cluster cluster, Collection<String> endpoints); JmxProxy connect(Node node); JmxProxy connect(Node node, Collection<String> endpoints);  }
@Test public void parseStreamSessionJsonTest() throws IOException { URL url = Resources.getResource("metric-samples/stream-session.json"); String data = Resources.toString(url, Charsets.UTF_8); List<StreamSession> list = ClusterFacade.parseStreamSessionJson(data); assertEquals("6b9d35b0-bab6-11e9-8e34-4d2f1172e8bc", list.get(0).getPlanId()); }