@RequestMapping(value="/ring/{address}/", method=RequestMethod.GET)
public String describeNode(
@PathVariable("address") String address,
ModelMap model) {
NodeProbe probe = clientProvider.getProbe(address);
model.addAttribute("address", address);
model.addAttribute("token", probe.getToken());
model.addAttribute("mode", probe.getOperationMode());
model.addAttribute("uptime", getUptimeString(probe.getUptime()));
// Column family store
probe.getColumnFamilyStoreMBeanProxies();
Iterator<Entry<String, ColumnFamilyStoreMBean>> iterator = probe.getColumnFamilyStoreMBeanProxies();
Map<String, Map<String, ColumnFamilyStoreMBean>> cfparent = new TreeMap<String, Map<String,ColumnFamilyStoreMBean>>();
while (iterator.hasNext()) {
Entry<String, ColumnFamilyStoreMBean> entry = iterator.next();
String keyspace = entry.getKey();
String columnFamily = entry.getValue().getColumnFamilyName();
Map<String, ColumnFamilyStoreMBean> cfmap = cfparent.get(keyspace);
if (cfmap == null) {
cfmap = new TreeMap<String, ColumnFamilyStoreMBean>();
cfparent.put(keyspace, cfmap);
}
cfmap.put(columnFamily, entry.getValue());
}
// Thread pool stats
Iterator<Entry<String, JMXEnabledThreadPoolExecutorMBean>> tpIterator = probe.getThreadPoolMBeanProxies();
Map<String, IExecutorMBean> tpMap = new TreeMap<String, IExecutorMBean>();
while (tpIterator.hasNext()) {
Entry<String, JMXEnabledThreadPoolExecutorMBean> entry = tpIterator.next();
tpMap.put(entry.getKey(), entry.getValue());
}
model.addAttribute("cfparent", cfparent);
model.addAttribute("tpmap", tpMap);
model.addAttribute("address", address);
model.addAttribute("menu_ring", true);
// TODO not implemented yet
// model.addAttribute("streamDestinations", probe.getStreamDestinations());
// model.addAttribute("streamSources", probe.getStreamSources());
model.addAttribute("currentGenerationNumber", probe.getCurrentGenerationNumber());
/*
ByteArrayOutputStream bout = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(bout);
probe.getCompactionThreshold(ps, null, null);