@Override public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { BizLogSendRequest requestBody = request.getBody(); List<BizLog> bizLogs = requestBody.getBizLogs(); if (CollectionUtils.isNotEmpty(bizLogs)) { for (BizLog bizLog : bizLogs) { JobLogPo jobLogPo = new JobLogPo(); jobLogPo.setGmtCreated(SystemClock.now()); jobLogPo.setLogTime(bizLog.getLogTime()); jobLogPo.setTaskTrackerNodeGroup(bizLog.getTaskTrackerNodeGroup()); jobLogPo.setTaskTrackerIdentity(bizLog.getTaskTrackerIdentity()); jobLogPo.setJobId(bizLog.getJobId()); jobLogPo.setTaskId(bizLog.getTaskId()); jobLogPo.setMsg(bizLog.getMsg()); jobLogPo.setSuccess(true); jobLogPo.setLevel(bizLog.getLevel()); jobLogPo.setLogType(LogType.BIZ); application.getJobLogger().log(jobLogPo); } } return RemotingCommand.createResponseCommand( JobProtos.ResponseCode.BIZ_LOG_SEND_SUCCESS.code(), ""); }
private void populateMap(Object bean) { Class<?> clazz = bean.getClass(); Set<MethodInfo> methodInfos = getGetterMethodInfo(clazz); if (CollectionUtils.isNotEmpty(methodInfos)) { for (MethodInfo methodInfo : methodInfos) { try { Object result = methodInfo.getMethod().invoke(bean, (Object[]) null); if (result != null) { this.map.put(methodInfo.getFieldName(), wrap(result)); } } catch (Exception ignored) { } } } }