@RequestMapping("/monitor/monitor-data-add") public RestfulResponse taskTrackerMonitorInfoAdd(MonitorDataAddRequest request) { RestfulResponse response = new RestfulResponse(); try { Assert.notNull(request.getNodeType(), "nodeType can not be null"); Assert.hasText(request.getIdentity(), "identity can not be null"); Assert.hasText(request.getNodeGroup(), "nodeGroup can not be null"); Assert.hasText(request.getMonitorData(), "monitorData can not be null"); if (NodeType.TASK_TRACKER.equals(request.getNodeType())) { monitorDataService.addTaskTrackerMonitorData(request); } else if (NodeType.JOB_TRACKER.equals(request.getNodeType())) { monitorDataService.addJobTrackerMonitorData(request); } else if (NodeType.JOB_CLIENT.equals(request.getNodeType())) { monitorDataService.addJobClientMonitorData(request); } response.setSuccess(true); return response; } catch (Exception e) { response.setSuccess(false); response.setMsg(e.getMessage()); return response; } }