if (rows != null) {
for (CmbRow<String, String, String> row : rows) {
CNSWorkerStats stats = new CNSWorkerStats();
stats.setIpAddress(row.getKey());
if (row.getColumnSlice().getColumnByName("producerTimestamp") != null) {
stats.setProducerTimestamp(Long.parseLong(row.getColumnSlice().getColumnByName("producerTimestamp").getValue()));
}
if (row.getColumnSlice().getColumnByName("consumerTimestamp") != null) {
stats.setConsumerTimestamp(Long.parseLong(row.getColumnSlice().getColumnByName("consumerTimestamp").getValue()));
}
if (row.getColumnSlice().getColumnByName("jmxport") != null) {
stats.setJmxPort(Long.parseLong(row.getColumnSlice().getColumnByName("jmxport").getValue()));
}
if (row.getColumnSlice().getColumnByName("mode") != null) {
stats.setMode(row.getColumnSlice().getColumnByName("mode").getValue());
}
statsList.add(stats);
}
}
for (CNSWorkerStats stats : statsList) {
if (stats.getIpAddress().equals(host) && stats.getJmxPort() > 0) {
JMXConnector jmxConnector = null;
String url = null;
try {
long port = stats.getJmxPort();
url = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi";
JMXServiceURL serviceUrl = new JMXServiceURL(url);
jmxConnector = JMXConnectorFactory.connect(serviceUrl, null);