use of org.apache.hyracks.control.cc.work.GetNodeSummariesJSONWork in project asterixdb by apache.
the class NodesRESTAPIFunction method invoke.
@Override
public ObjectNode invoke(String host, String servletPath, String[] arguments) throws Exception {
ObjectMapper om = new ObjectMapper();
ObjectNode result = om.createObjectNode();
switch(arguments.length) {
case 1:
{
if ("".equals(arguments[0])) {
GetNodeSummariesJSONWork gnse = new GetNodeSummariesJSONWork(ccs.getNodeManager());
ccs.getWorkQueue().scheduleAndSync(gnse);
result.set("result", enhanceSummaries(gnse.getSummaries(), host, servletPath));
} else {
String nodeId = arguments[0];
GetNodeDetailsJSONWork gnde = new GetNodeDetailsJSONWork(ccs.getNodeManager(), ccs.getCCConfig(), nodeId, true, true);
ccs.getWorkQueue().scheduleAndSync(gnde);
result.set("result", gnde.getDetail());
}
}
}
return result;
}
Aggregations