mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
[Optimize]日志统一格式&优化输出内容-part3(#800)
This commit is contained in:
@@ -307,7 +307,7 @@ public class TopicStateManagerImpl implements TopicStateManager {
|
|||||||
if (metricsResult.failed()) {
|
if (metricsResult.failed()) {
|
||||||
// 仅打印错误日志,但是不直接返回错误
|
// 仅打印错误日志,但是不直接返回错误
|
||||||
log.error(
|
log.error(
|
||||||
"class=TopicStateManagerImpl||method=getTopicPartitions||clusterPhyId={}||topicName={}||result={}||msg=get metrics from es failed",
|
"method=getTopicPartitions||clusterPhyId={}||topicName={}||result={}||msg=get metrics from es failed",
|
||||||
clusterPhyId, topicName, metricsResult
|
clusterPhyId, topicName, metricsResult
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,13 +99,13 @@ public class ConfigCmdDataParser implements FourLetterWordDataParser<ConfigCmdDa
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"class=ConfigCmdDataParser||method=parseAndInitData||name={}||value={}||msg=data not parsed!",
|
"method=parseAndInitData||name={}||value={}||msg=data not parsed!",
|
||||||
elem.getKey(), elem.getValue()
|
elem.getKey(), elem.getValue()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=ConfigCmdDataParser||method=parseAndInitData||clusterPhyId={}||host={}||port={}||name={}||value={}||errMsg=exception!",
|
"method=parseAndInitData||clusterPhyId={}||host={}||port={}||name={}||value={}||errMsg=exception!",
|
||||||
clusterPhyId, host, port, elem.getKey(), elem.getValue(), e
|
clusterPhyId, host, port, elem.getKey(), elem.getValue(), e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,13 +100,13 @@ public class MonitorCmdDataParser implements FourLetterWordDataParser<MonitorCmd
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"class=MonitorCmdDataParser||method=parseAndInitData||name={}||value={}||msg=data not parsed!",
|
"method=parseAndInitData||name={}||value={}||msg=data not parsed!",
|
||||||
elem.getKey(), elem.getValue()
|
elem.getKey(), elem.getValue()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=MonitorCmdDataParser||method=parseAndInitData||clusterPhyId={}||host={}||port={}||name={}||value={}||errMsg=exception!",
|
"method=parseAndInitData||clusterPhyId={}||host={}||port={}||name={}||value={}||errMsg=exception!",
|
||||||
clusterPhyId, host, port, elem.getKey(), elem.getValue(), e
|
clusterPhyId, host, port, elem.getKey(), elem.getValue(), e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,13 +80,13 @@ public class ServerCmdDataParser implements FourLetterWordDataParser<ServerCmdDa
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"class=ServerCmdDataParser||method=parseAndInitData||name={}||value={}||msg=data not parsed!",
|
"method=parseAndInitData||name={}||value={}||msg=data not parsed!",
|
||||||
elem.getKey(), elem.getValue()
|
elem.getKey(), elem.getValue()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=ServerCmdDataParser||method=parseAndInitData||clusterPhyId={}||host={}||port={}||name={}||value={}||errMsg=exception!",
|
"method=parseAndInitData||clusterPhyId={}||host={}||port={}||name={}||value={}||errMsg=exception!",
|
||||||
clusterPhyId, host, port, elem.getKey(), elem.getValue(), e
|
clusterPhyId, host, port, elem.getKey(), elem.getValue(), e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public abstract class BaseExtendFactory {
|
|||||||
try {
|
try {
|
||||||
handler = doGet(classNamePre, clazz);
|
handler = doGet(classNamePre, clazz);
|
||||||
} catch (NotFindSubclassException e) {
|
} catch (NotFindSubclassException e) {
|
||||||
LOGGER.error("class=BaseExtendFactory||method=getByClassNamePer||handleNamePre={}||msg={}", classNamePre,
|
LOGGER.error("method=getByClassNamePer||handleNamePre={}||msg={}", classNamePre,
|
||||||
e.getMessage());
|
e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ public abstract class BaseExtendFactory {
|
|||||||
try {
|
try {
|
||||||
beans = SpringTool.getBeansOfType(clazz);
|
beans = SpringTool.getBeansOfType(clazz);
|
||||||
} catch (BeansException e) {
|
} catch (BeansException e) {
|
||||||
LOGGER.error("class=BaseExtendFactory||method=findFromSpringContext||handleNamePre={}||msg={}",
|
LOGGER.error("method=findFromSpringContext||handleNamePre={}||msg={}",
|
||||||
classNamePre, e.getMessage());
|
classNamePre, e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class RestTemplateConfig {
|
|||||||
try {
|
try {
|
||||||
traceResponse(request, response, exe, subFlag, beginNano);
|
traceResponse(request, response, exe, subFlag, beginNano);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
SYSTEM_LOGGER.warn("class=LogHttpRequestInterceptor||method=intercept||msg={}", e.getMessage());
|
SYSTEM_LOGGER.warn("method=intercept||msg={}", e.getMessage());
|
||||||
}
|
}
|
||||||
throw new ThirdPartRemoteException("rest-template: " + exe.getMessage(), exe,
|
throw new ThirdPartRemoteException("rest-template: " + exe.getMessage(), exe,
|
||||||
ResultStatus.HTTP_REQ_ERROR);
|
ResultStatus.HTTP_REQ_ERROR);
|
||||||
@@ -98,7 +98,7 @@ public class RestTemplateConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void traceRequest(HttpRequest request, String subFlag, byte[] body) throws IOException {
|
private void traceRequest(HttpRequest request, String subFlag, byte[] body) throws IOException {
|
||||||
REQ_LOGGER.info("class=LogHttpRequestInterceptor||method=traceRequest||remoteRequest||url={}||method={}||headers={}||body={}||subFlag={}",
|
REQ_LOGGER.info("method=traceRequest||remoteRequest||url={}||method={}||headers={}||body={}||subFlag={}",
|
||||||
request.getURI(), request.getMethod(), JSON.toJSONString(request.getHeaders()), new String(body, "UTF-8"), subFlag);
|
request.getURI(), request.getMethod(), JSON.toJSONString(request.getHeaders()), new String(body, "UTF-8"), subFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ public class RestTemplateConfig {
|
|||||||
StringBuilder inputStringBuilder = new StringBuilder();
|
StringBuilder inputStringBuilder = new StringBuilder();
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
RESP_LOGGER.warn(
|
RESP_LOGGER.warn(
|
||||||
"class=LogHttpRequestInterceptor||method=traceResponse||remoteResponse||code=-1||url={}||text={}||headers={}||body={}||timeCost={}||subFlag={}",
|
"method=traceResponse||remoteResponse||code=-1||url={}||text={}||headers={}||body={}||timeCost={}||subFlag={}",
|
||||||
url, null, null, null, (System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
url, null, null, null, (System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ public class RestTemplateConfig {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
RESP_LOGGER.warn(
|
RESP_LOGGER.warn(
|
||||||
"class=remoteResponse||code={}||url={}||text={}||headers={}||body={}||error={}||timeCost={}||subFlag={}",
|
"method=traceResponse||code={}||url={}||text={}||headers={}||body={}||error={}||timeCost={}||subFlag={}",
|
||||||
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(),
|
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(),
|
||||||
inputStringBuilder.toString(), e, (System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
inputStringBuilder.toString(), e, (System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
||||||
if (!response.getStatusCode().is2xxSuccessful()) {
|
if (!response.getStatusCode().is2xxSuccessful()) {
|
||||||
@@ -144,12 +144,12 @@ public class RestTemplateConfig {
|
|||||||
if (!response.getStatusCode().is2xxSuccessful()) {
|
if (!response.getStatusCode().is2xxSuccessful()) {
|
||||||
if (exception == null) {
|
if (exception == null) {
|
||||||
RESP_LOGGER.warn(
|
RESP_LOGGER.warn(
|
||||||
"class=LogHttpRequestInterceptor||method=traceResponse||remoteResponse||code={}||url={}||text={}||headers={}||body={}||timeCost={}||subFlag={}",
|
"method=traceResponse||remoteResponse||code={}||url={}||text={}||headers={}||body={}||timeCost={}||subFlag={}",
|
||||||
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(), responseString,
|
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(), responseString,
|
||||||
(System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
(System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
||||||
} else {
|
} else {
|
||||||
RESP_LOGGER.warn(
|
RESP_LOGGER.warn(
|
||||||
"remoteResponse||code={}||url={}||text={}||headers={}||body={}||error={}||timeCost={}||subFlag={}",
|
"method=traceResponse||remoteResponse||code={}||url={}||text={}||headers={}||body={}||error={}||timeCost={}||subFlag={}",
|
||||||
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(), responseString,
|
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(), responseString,
|
||||||
exception, (System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
exception, (System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
||||||
}
|
}
|
||||||
@@ -158,12 +158,12 @@ public class RestTemplateConfig {
|
|||||||
|
|
||||||
if (exception == null) {
|
if (exception == null) {
|
||||||
RESP_LOGGER.info(
|
RESP_LOGGER.info(
|
||||||
"class=LogHttpRequestInterceptor||method=traceResponse||remoteResponse||code={}||url={}||text={}||headers={}||responseBody={}||timeCost={}||subFlag={}",
|
"method=traceResponse||remoteResponse||code={}||url={}||text={}||headers={}||responseBody={}||timeCost={}||subFlag={}",
|
||||||
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(), responseString,
|
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(), responseString,
|
||||||
(System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
(System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
||||||
} else {
|
} else {
|
||||||
RESP_LOGGER.warn(
|
RESP_LOGGER.warn(
|
||||||
"class=LogHttpRequestInterceptor||method=traceResponse||remoteResponse||code={}||url={}||text={}||headers={}||responseBody={}||error={}||timeCost={}||subFlag={}",
|
"method=traceResponse||remoteResponse||code={}||url={}||text={}||headers={}||responseBody={}||error={}||timeCost={}||subFlag={}",
|
||||||
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(), responseString,
|
response.getStatusCode(), url, response.getStatusText(), response.getHeaders(), responseString,
|
||||||
exception, (System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
exception, (System.nanoTime() - nanoTime) / 1000 / 1000, subFlag);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class RestTool {
|
|||||||
new HttpEntity<>(null, getJsonContentHeaders(headers)), String.class);
|
new HttpEntity<>(null, getJsonContentHeaders(headers)), String.class);
|
||||||
return JSON.parseObject(result.getBody(), resultType);
|
return JSON.parseObject(result.getBody(), resultType);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
LOGGER.error("class=RestTool||method=getForObject||url={}||msg=exception!", url, e);
|
LOGGER.error("method=getForObject||url={}||msg=exception!", url, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -151,7 +151,7 @@ public class RestTool {
|
|||||||
new HttpEntity<>(null, headers), String.class);
|
new HttpEntity<>(null, headers), String.class);
|
||||||
return JSON.parseObject(result.getBody(), resultType);
|
return JSON.parseObject(result.getBody(), resultType);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
LOGGER.error("class=RestTool||method=getForObject||url={}||msg=exception!", url, e);
|
LOGGER.error("method=getForObject||url={}||msg=exception!", url, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ public enum VersionItemTypeEnum {
|
|||||||
/**
|
/**
|
||||||
* 指标
|
* 指标
|
||||||
*/
|
*/
|
||||||
METRIC_TOPIC(100, "topic_metric"),
|
METRIC_TOPIC(100, "TopicMetric"),
|
||||||
METRIC_CLUSTER(101, "cluster_metric"),
|
METRIC_CLUSTER(101, "ClusterMetric"),
|
||||||
METRIC_GROUP(102, "group_metric"),
|
METRIC_GROUP(102, "GroupMetric"),
|
||||||
METRIC_BROKER(103, "broker_metric"),
|
METRIC_BROKER(103, "BrokerMetric"),
|
||||||
METRIC_PARTITION(104, "partition_metric"),
|
METRIC_PARTITION(104, "PartitionMetric"),
|
||||||
METRIC_REPLICATION(105, "replication_metric"),
|
METRIC_REPLICATION(105, "ReplicaMetric"),
|
||||||
|
|
||||||
METRIC_ZOOKEEPER(110, "zookeeper_metric"),
|
METRIC_ZOOKEEPER(110, "ZookeeperMetric"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务端查询
|
* 服务端查询
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class CommonUtils {
|
|||||||
//转换为16进制
|
//转换为16进制
|
||||||
return new BigInteger(1, digest).toString(16);
|
return new BigInteger(1, digest).toString(16);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("class=CommonUtils||method=getMD5||msg=获取文件的md5失败:{}", e.getMessage());
|
LOGGER.error("method=getMD5||msg=获取文件的md5失败:{}", e.getMessage());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ public class ConvertUtil {
|
|||||||
BeanUtils.copyProperties(srcObj, tgt);
|
BeanUtils.copyProperties(srcObj, tgt);
|
||||||
consumer.accept(tgt);
|
consumer.accept(tgt);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.warn("class=ConvertUtil||method=obj2Obj||msg={}", e.getMessage());
|
LOGGER.warn("method=obj2Obj||msg={}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return tgt;
|
return tgt;
|
||||||
@@ -236,7 +236,7 @@ public class ConvertUtil {
|
|||||||
try {
|
try {
|
||||||
map.put(field.getName(), field.get(obj));
|
map.put(field.getName(), field.get(obj));
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
LOGGER.warn("class=ConvertUtil||method=Obj2Map||msg={}", e.getMessage(), e);
|
LOGGER.warn("method=Obj2Map||msg={}", e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
@@ -256,7 +256,7 @@ public class ConvertUtil {
|
|||||||
field.set(obj, map.get(field.getName()));
|
field.set(obj, map.get(field.getName()));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.warn("class=ConvertUtil||method=map2Obj||msg={}", e.getMessage(), e);
|
LOGGER.warn("method=map2Obj||msg={}", e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class FutureNoWaitUtil<T> {
|
|||||||
while (true) {
|
while (true) {
|
||||||
FutureTaskDelayQueueData<T> data = null;
|
FutureTaskDelayQueueData<T> data = null;
|
||||||
try {
|
try {
|
||||||
LOGGER.debug("class=FutureNoWaitUtil||method=runCheck||delayQueueSize={}", delayQueueData.size());
|
LOGGER.debug("method=runCheck||delayQueueSize={}", delayQueueData.size());
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
data = delayQueueData.take();
|
data = delayQueueData.take();
|
||||||
@@ -81,7 +81,7 @@ public class FutureNoWaitUtil<T> {
|
|||||||
// 停1000ms
|
// 停1000ms
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("class=FutureNoWaitUtil||method=runCheck||taskName={}||errMsg=exception!", data == null? "": data.getTaskName(), e);
|
LOGGER.error("method=runCheck||taskName={}||errMsg=exception!", data == null? "": data.getTaskName(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,11 +123,11 @@ public class FutureWaitUtil<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 达到超时时间,但是任务未完成,则打印日志并强制取消
|
// 达到超时时间,但是任务未完成,则打印日志并强制取消
|
||||||
LOGGER.error("class=FutureUtil||method=waitExecute||taskName={}||msg=cancel task", queueData.getTaskName());
|
LOGGER.error("method=waitExecute||taskName={}||msg=cancel task", queueData.getTaskName());
|
||||||
|
|
||||||
queueData.getFutureTask().cancel(true);
|
queueData.getFutureTask().cancel(true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("class=FutureUtil||method=waitExecute||msg=exception", e);
|
LOGGER.error("method=waitExecute||msg=exception", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ public class FutureWaitUtil<T> {
|
|||||||
return queueData.getFutureTask().get(stepWaitTimeUnitMs, TimeUnit.MILLISECONDS);
|
return queueData.getFutureTask().get(stepWaitTimeUnitMs, TimeUnit.MILLISECONDS);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 达到超时时间,但是任务未完成,则打印日志并强制取消
|
// 达到超时时间,但是任务未完成,则打印日志并强制取消
|
||||||
LOGGER.error("class=FutureUtil||method=stepWaitResult||taskName={}||errMsg=exception", queueData.getTaskName(), e);
|
LOGGER.error("method=stepWaitResult||taskName={}||errMsg=exception", queueData.getTaskName(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ public class PaginationMetricsUtil {
|
|||||||
try {
|
try {
|
||||||
Field defaultField = FieldUtils.getField(allDataList.get(0).getClass(), defaultSortField, true);
|
Field defaultField = FieldUtils.getField(allDataList.get(0).getClass(), defaultSortField, true);
|
||||||
if(ValidateUtils.anyNull(defaultField)) {
|
if(ValidateUtils.anyNull(defaultField)) {
|
||||||
log.debug("class=PaginationMetricsUtil||method=sortMetrics||className={}||metricName={}||defaultFieldName={}||metricSortType={}||msg=default field not exist.",
|
log.debug("method=sortMetrics||className={}||metricName={}||defaultFieldName={}||metricSortType={}||msg=default field not exist.",
|
||||||
allDataList.get(0).getClass().getSimpleName(), metricName, defaultSortField, sortType);
|
allDataList.get(0).getClass().getSimpleName(), metricName, defaultSortField, sortType);
|
||||||
|
|
||||||
// 字段不存在,则排序失效,直接返回
|
// 字段不存在,则排序失效,直接返回
|
||||||
@@ -172,7 +172,7 @@ public class PaginationMetricsUtil {
|
|||||||
|
|
||||||
Collections.sort(allDataList, (a1, a2) -> sortMetricsObject(a1, a2, metricName, defaultField));
|
Collections.sort(allDataList, (a1, a2) -> sortMetricsObject(a1, a2, metricName, defaultField));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.debug("class=PaginationMetricsUtil||method=sortMetrics||className={}||metricName={}||defaultFieldName={}||metricSortType={}||errMsg=exception.",
|
log.debug("method=sortMetrics||className={}||metricName={}||defaultFieldName={}||metricSortType={}||errMsg=exception.",
|
||||||
allDataList.get(0).getClass().getSimpleName(), metricName, defaultSortField, sortType, e);
|
allDataList.get(0).getClass().getSimpleName(), metricName, defaultSortField, sortType, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ public class PaginationMetricsUtil {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.debug("class=PaginationMetricsUtil||method=sortMetricsObject||metricsA={}||metricsB={}||metricName={}||defaultFieldName={}||errMsg=exception.",
|
log.debug("method=sortMetricsObject||metricsA={}||metricsB={}||metricName={}||defaultFieldName={}||errMsg=exception.",
|
||||||
a1, a2, metricName, defaultField.getName(), e);
|
a1, a2, metricName, defaultField.getName(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,12 +94,12 @@ public class RetryExecutor {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (!handler.needRetry(e) || tryCount == retryCount) {
|
if (!handler.needRetry(e) || tryCount == retryCount) {
|
||||||
LOGGER.warn("class=RetryExecutor||method=execute||errMsg={}||handlerName={}||tryCount={}",
|
LOGGER.warn("method=execute||errMsg={}||handlerName={}||tryCount={}",
|
||||||
e.getMessage(), name, tryCount, e);
|
e.getMessage(), name, tryCount, e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.warn("class=RetryExecutor||method=execute||errMsg={}||handlerName={}||tryCount={}||maxTryCount={}",
|
LOGGER.warn("method=execute||errMsg={}||handlerName={}||tryCount={}||maxTryCount={}",
|
||||||
e.getMessage(), name, tryCount,retryCount);
|
e.getMessage(), name, tryCount,retryCount);
|
||||||
}
|
}
|
||||||
} while (tryCount++ < retryCount);
|
} while (tryCount++ < retryCount);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class FourLetterWordUtil {
|
|||||||
return Result.buildSuc(dataParser.parseAndInitData(clusterPhyId, host, port, cmdData));
|
return Result.buildSuc(dataParser.parseAndInitData(clusterPhyId, host, port, cmdData));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=FourLetterWordUtil||method=executeFourLetterCmd||clusterPhyId={}||host={}||port={}||cmd={}||secure={}||timeout={}||errMsg=exception!",
|
"method=executeFourLetterCmd||clusterPhyId={}||host={}||port={}||cmd={}||secure={}||timeout={}||errMsg=exception!",
|
||||||
clusterPhyId, host, port, dataParser.getCmd(), secure, timeout, e
|
clusterPhyId, host, port, dataParser.getCmd(), secure, timeout, e
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ public class FourLetterWordUtil {
|
|||||||
outputStream.close();
|
outputStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=FourLetterWordUtil||method=send4LetterWord||clusterPhyId={}||host={}||port={}||cmd={}||secure={}||timeout={}||errMsg=exception!",
|
"method=send4LetterWord||clusterPhyId={}||host={}||port={}||cmd={}||secure={}||timeout={}||errMsg=exception!",
|
||||||
host, port, cmd, secure, timeout, e
|
host, port, cmd, secure, timeout, e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ public class FourLetterWordUtil {
|
|||||||
bufferedReader.close();
|
bufferedReader.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=FourLetterWordUtil||method=send4LetterWord||host={}||port={}||cmd={}||secure={}||timeout={}||errMsg=exception!",
|
"method=send4LetterWord||host={}||port={}||cmd={}||secure={}||timeout={}||errMsg=exception!",
|
||||||
host, port, cmd, secure, timeout, e
|
host, port, cmd, secure, timeout, e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,7 @@ public class FourLetterWordUtil {
|
|||||||
socket.close();
|
socket.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=FourLetterWordUtil||method=send4LetterWord||host={}||port={}||cmd={}||secure={}||timeout={}||errMsg=exception!",
|
"method=send4LetterWord||host={}||port={}||cmd={}||secure={}||timeout={}||errMsg=exception!",
|
||||||
host, port, cmd, secure, timeout, e
|
host, port, cmd, secure, timeout, e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ public class ZKWatcherManager extends AbstractClusterLoadedChangedHandler {
|
|||||||
try {
|
try {
|
||||||
FutureUtil.quickStartupFutureUtil.submitTask(
|
FutureUtil.quickStartupFutureUtil.submitTask(
|
||||||
() -> {
|
() -> {
|
||||||
log.debug("class={}||method=scheduledTriggerFlush||clusterPhyId={}||msg=flush task start"
|
log.debug("runClass={}||method=scheduledTriggerFlush||clusterPhyId={}||msg=flush task start"
|
||||||
, abstractZKWatcher.getClass().getSimpleName(), clusterPhy.getId());
|
, abstractZKWatcher.getClass().getSimpleName(), clusterPhy.getId());
|
||||||
|
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
|
|
||||||
abstractZKWatcher.flush(clusterPhy);
|
abstractZKWatcher.flush(clusterPhy);
|
||||||
|
|
||||||
log.info("class={}||method=scheduledTriggerFlush||clusterPhyId={}||costTime={}ms||msg=flush task finished"
|
log.info("runClass={}||method=scheduledTriggerFlush||clusterPhyId={}||costTime={}ms||msg=flush task finished"
|
||||||
, abstractZKWatcher.getClass().getSimpleName(), clusterPhy.getId(), System.currentTimeMillis() - startTime);
|
, abstractZKWatcher.getClass().getSimpleName(), clusterPhy.getId(), System.currentTimeMillis() - startTime);
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ import static com.xiaojukeji.know.streaming.km.common.enums.version.VersionEnum.
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class BrokerMetricServiceImpl extends BaseMetricService implements BrokerMetricService {
|
public class BrokerMetricServiceImpl extends BaseMetricService implements BrokerMetricService {
|
||||||
protected static final ILog LOGGER = LogFactory.getLog("METRIC_LOGGER");
|
protected static final ILog LOGGER = LogFactory.getLog(BrokerMetricServiceImpl.class);
|
||||||
|
|
||||||
public static final String BROKER_METHOD_DO_NOTHING = "doNothing";
|
public static final String BROKER_METHOD_DO_NOTHING = "doNothing";
|
||||||
public static final String BROKER_METHOD_GET_METRIC_FROM_KAFKA_BY_JMX = "getMetricFromKafkaByJMX";
|
public static final String BROKER_METHOD_GET_METRIC_FROM_KAFKA_BY_JMX = "getMetricFromKafkaByJMX";
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ public class GroupMetricServiceImpl extends BaseMetricService implements GroupMe
|
|||||||
|
|
||||||
return Result.buildSuc(metricsList);
|
return Result.buildSuc(metricsList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("class=GroupMetricServiceImpl||method=getLagFromAdminClient||clusterPhyId={}||groupName={}||metrics={}||msg=exception", clusterId, groupName, metric, e);
|
LOGGER.error("method=getLagFromAdminClient||clusterPhyId={}||groupName={}||metrics={}||msg=exception", clusterId, groupName, metric, e);
|
||||||
return Result.buildFailure(VC_KAFKA_CLIENT_ERROR);
|
return Result.buildFailure(VC_KAFKA_CLIENT_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import com.xiaojukeji.know.streaming.km.common.bean.entity.version.VersionMethod
|
|||||||
import com.xiaojukeji.know.streaming.km.common.enums.version.VersionEnum;
|
import com.xiaojukeji.know.streaming.km.common.enums.version.VersionEnum;
|
||||||
import com.xiaojukeji.know.streaming.km.common.enums.version.VersionItemTypeEnum;
|
import com.xiaojukeji.know.streaming.km.common.enums.version.VersionItemTypeEnum;
|
||||||
import com.xiaojukeji.know.streaming.km.common.exception.VCHandlerNotExistException;
|
import com.xiaojukeji.know.streaming.km.common.exception.VCHandlerNotExistException;
|
||||||
import com.xiaojukeji.know.streaming.km.common.utils.EnvUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.DependsOn;
|
import org.springframework.context.annotation.DependsOn;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -25,7 +24,7 @@ import java.util.function.Function;
|
|||||||
*/
|
*/
|
||||||
@DependsOn("versionControlService")
|
@DependsOn("versionControlService")
|
||||||
public abstract class BaseVersionControlService {
|
public abstract class BaseVersionControlService {
|
||||||
protected static final ILog LOGGER = LogFactory.getLog("METRIC_LOGGER");
|
protected static final ILog LOGGER = LogFactory.getLog(BaseVersionControlService.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected VersionControlService versionControlService;
|
protected VersionControlService versionControlService;
|
||||||
@@ -61,10 +60,11 @@ public abstract class BaseVersionControlService {
|
|||||||
String methodName = getMethodName(clusterPhyId, action);
|
String methodName = getMethodName(clusterPhyId, action);
|
||||||
Object ret = versionControlService.doHandler(getVersionItemType(), methodName, param);
|
Object ret = versionControlService.doHandler(getVersionItemType(), methodName, param);
|
||||||
|
|
||||||
if(!EnvUtil.isOnline()){
|
LOGGER.debug(
|
||||||
LOGGER.info("method=doVCHandler||clusterId={}||action={}||methodName={}||type={}param={}||ret={}}!",
|
"method=doVCHandler||clusterId={}||action={}||methodName={}||type={}param={}||ret={}!",
|
||||||
clusterPhyId, action, methodName, getVersionItemType().getMessage(), JSON.toJSONString(param), JSON.toJSONString(ret));
|
clusterPhyId, action, methodName, getVersionItemType().getMessage(), JSON.toJSONString(param), JSON.toJSONString(ret)
|
||||||
}
|
);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.xiaojukeji.know.streaming.km.persistence.es;
|
package com.xiaojukeji.know.streaming.km.persistence.es;
|
||||||
|
|
||||||
import com.didiglobal.logi.log.ILog;
|
import com.didiglobal.logi.log.ILog;
|
||||||
import com.didiglobal.logi.log.LogFactory;
|
import com.xiaojukeji.know.streaming.km.common.utils.LoggerUtil;
|
||||||
import com.xiaojukeji.know.streaming.km.persistence.es.dsls.DslLoaderUtil;
|
import com.xiaojukeji.know.streaming.km.persistence.es.dsls.DslLoaderUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
* 直接操作es集群的dao
|
* 直接操作es集群的dao
|
||||||
*/
|
*/
|
||||||
public abstract class BaseESDAO {
|
public abstract class BaseESDAO {
|
||||||
protected static final ILog LOGGER = LogFactory.getLog("ES_LOGGER");
|
protected static final ILog LOGGER = LoggerUtil.getESLogger();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载查询语句工具类
|
* 加载查询语句工具类
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class BaseMetricESDAO extends BaseESDAO {
|
|||||||
|
|
||||||
esOpClient.createIndex(realIndex);
|
esOpClient.createIndex(realIndex);
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
LOGGER.error("method=checkCurrentDayIndexExist||errMsg=exception!", e);
|
LOGGER.error("method=checkCurrentDayIndexExist||errMsg=exception!", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class ZookeeperMetricESDAO extends BaseMetricESDAO {
|
|||||||
ESConstant.DEFAULT_RETRY_TIME
|
ESConstant.DEFAULT_RETRY_TIME
|
||||||
);
|
);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
LOGGER.error("class=ZookeeperMetricESDAO||method=listMetricsByClusterPhyId||clusterPhyId={}||errMsg=exception!",
|
LOGGER.error("method=listMetricsByClusterPhyId||clusterPhyId={}||errMsg=exception!",
|
||||||
clusterPhyId, e
|
clusterPhyId, e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import com.alibaba.fastjson.parser.Feature;
|
|||||||
import com.alibaba.fastjson.parser.ParserConfig;
|
import com.alibaba.fastjson.parser.ParserConfig;
|
||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import com.didiglobal.logi.log.ILog;
|
import com.didiglobal.logi.log.ILog;
|
||||||
import com.didiglobal.logi.log.LogFactory;
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.xiaojukeji.know.streaming.km.common.utils.EnvUtil;
|
import com.xiaojukeji.know.streaming.km.common.utils.EnvUtil;
|
||||||
|
import com.xiaojukeji.know.streaming.km.common.utils.LoggerUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class DslLoaderUtil {
|
public class DslLoaderUtil {
|
||||||
private static final ILog LOGGER = LogFactory.getLog("ES_LOGGER");
|
private static final ILog LOGGER = LoggerUtil.getESLogger();
|
||||||
/**
|
/**
|
||||||
* 查询语句容器
|
* 查询语句容器
|
||||||
*/
|
*/
|
||||||
@@ -42,7 +42,7 @@ public class DslLoaderUtil {
|
|||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
LOGGER.info("class=DslLoaderUtil||method=init||DslLoaderUtil init start.");
|
LOGGER.info("method=init||DslLoaderUtil init start.");
|
||||||
List<String> dslFileNames = Lists.newLinkedList();
|
List<String> dslFileNames = Lists.newLinkedList();
|
||||||
|
|
||||||
// 反射获取接口中定义的变量中的值
|
// 反射获取接口中定义的变量中的值
|
||||||
@@ -52,7 +52,7 @@ public class DslLoaderUtil {
|
|||||||
try {
|
try {
|
||||||
dslFileNames.add(fields[i].get(null).toString());
|
dslFileNames.add(fields[i].get(null).toString());
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
LOGGER.error("class=DslLoaderUtil||method=init||errMsg=fail to read {} error. ", fields[i].getName(),
|
LOGGER.error("method=init||errMsg=fail to read {} error. ", fields[i].getName(),
|
||||||
e);
|
e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,13 +63,13 @@ public class DslLoaderUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 输出加载的查询语句
|
// 输出加载的查询语句
|
||||||
LOGGER.info("class=DslLoaderUtil||method=init||msg=dsl files count {}", dslsMap.size());
|
LOGGER.info("method=init||msg=dsl files count {}", dslsMap.size());
|
||||||
for (Map.Entry<String/*fileRelativePath*/, String/*dslContent*/> entry : dslsMap.entrySet()) {
|
for (Map.Entry<String/*fileRelativePath*/, String/*dslContent*/> entry : dslsMap.entrySet()) {
|
||||||
LOGGER.info("class=DslLoaderUtil||method=init||msg=file name {}, dsl content {}", entry.getKey(),
|
LOGGER.info("method=init||msg=file name {}, dsl content {}", entry.getKey(),
|
||||||
entry.getValue());
|
entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.info("class=DslLoaderUtil||method=init||DslLoaderUtil init finished.");
|
LOGGER.info("method=init||DslLoaderUtil init finished.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,7 +93,7 @@ public class DslLoaderUtil {
|
|||||||
String loadDslContent = getDslByFileName(fileName);
|
String loadDslContent = getDslByFileName(fileName);
|
||||||
|
|
||||||
if (StringUtils.isBlank(loadDslContent)) {
|
if (StringUtils.isBlank(loadDslContent)) {
|
||||||
LOGGER.error("class=DslLoaderUtil||method=getFormatDslByFileName||errMsg=dsl file {} content is empty",
|
LOGGER.error("method=getFormatDslByFileName||errMsg=dsl file {} content is empty",
|
||||||
fileName);
|
fileName);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ public class DslLoaderUtil {
|
|||||||
String dsl = trimJsonBank( String.format(loadDslContent, args));
|
String dsl = trimJsonBank( String.format(loadDslContent, args));
|
||||||
// 如果不是线上环境,则输出dsl语句
|
// 如果不是线上环境,则输出dsl语句
|
||||||
if (!EnvUtil.isOnline()) {
|
if (!EnvUtil.isOnline()) {
|
||||||
LOGGER.info("class=DslLoaderUtil||method=getFormatDslByFileName||dsl={}", dsl);
|
LOGGER.info("method=getFormatDslByFileName||dsl={}", dsl);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dsl;
|
return dsl;
|
||||||
@@ -164,7 +164,7 @@ public class DslLoaderUtil {
|
|||||||
JSON.DEFAULT_PARSER_FEATURE | Feature.OrderedField.getMask());
|
JSON.DEFAULT_PARSER_FEATURE | Feature.OrderedField.getMask());
|
||||||
obj = parser.parse();
|
obj = parser.parse();
|
||||||
} catch (Exception t) {
|
} catch (Exception t) {
|
||||||
LOGGER.error("class=DslLoaderUtil||method=trimJsonBank||errMsg=parse json {} error. ", dsl, t);
|
LOGGER.error("method=trimJsonBank||errMsg=parse json {} error. ", dsl, t);
|
||||||
}
|
}
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
break;
|
break;
|
||||||
@@ -212,7 +212,7 @@ public class DslLoaderUtil {
|
|||||||
return StringUtils.join(lines, "");
|
return StringUtils.join(lines, "");
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error("class=DslLoaderUtil||method=readDslFileInJarFile||errMsg=read file {} error. ", fileName,
|
LOGGER.error("method=readDslFileInJarFile||errMsg=read file {} error. ", fileName,
|
||||||
e);
|
e);
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
@@ -221,12 +221,12 @@ public class DslLoaderUtil {
|
|||||||
inputStream.close();
|
inputStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=DslLoaderUtil||method=readDslFileInJarFile||errMsg=fail to close file {} error. ",
|
"method=readDslFileInJarFile||errMsg=fail to close file {} error. ",
|
||||||
fileName, e);
|
fileName, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGGER.error("class=DslLoaderUtil||method=readDslFileInJarFile||errMsg=fail to read file {} content",
|
LOGGER.error("method=readDslFileInJarFile||errMsg=fail to read file {} content",
|
||||||
fileName);
|
fileName);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class JmxDAOImpl implements JmxDAO {
|
|||||||
return object == null? null: (Long) object;
|
return object == null? null: (Long) object;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(
|
log.error(
|
||||||
"class=JmxDAOImpl||method=getServerStartTime||clusterPhyId={}||jmxHost={}||jmxPort={}||jmxConfig={}||errMsg=exception!",
|
"method=getServerStartTime||clusterPhyId={}||jmxHost={}||jmxPort={}||jmxConfig={}||errMsg=exception!",
|
||||||
clusterPhyId, jmxHost, jmxPort, jmxConfig, e
|
clusterPhyId, jmxHost, jmxPort, jmxConfig, e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class PermissionInterceptor implements HandlerInterceptor {
|
|||||||
classRequestMappingValue = getClassRequestMappingValue(handler);
|
classRequestMappingValue = getClassRequestMappingValue(handler);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
"class=PermissionInterceptor||method=preHandle||uri={}||msg=parse class request-mapping failed",
|
"method=preHandle||uri={}||msg=parse class request-mapping failed",
|
||||||
request.getRequestURI(), e);
|
request.getRequestURI(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ public abstract class AbstractAsyncCommonDispatchTask extends AbstractClusterPhy
|
|||||||
try {
|
try {
|
||||||
TaskResult tr = this.processClusterTask(clusterPhy, triggerTimeUnitMs);
|
TaskResult tr = this.processClusterTask(clusterPhy, triggerTimeUnitMs);
|
||||||
if (TaskResult.SUCCESS_CODE != tr.getCode()) {
|
if (TaskResult.SUCCESS_CODE != tr.getCode()) {
|
||||||
log.error("class=AbstractAsyncCommonDispatchTask||taskName={}||clusterPhyId={}||taskResult={}||msg=failed", this.taskName, clusterPhy.getId(), tr);
|
log.error("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||taskResult={}||msg=failed", this.taskName, clusterPhy.getId(), tr);
|
||||||
} else {
|
} else {
|
||||||
log.debug("class=AbstractAsyncCommonDispatchTask||taskName={}||clusterPhyId={}||msg=success", this.taskName, clusterPhy.getId());
|
log.debug("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||msg=success", this.taskName, clusterPhy.getId());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("class=AbstractAsyncCommonDispatchTask||taskName={}||clusterPhyId={}||errMsg=exception", this.taskName, clusterPhy.getId(), e);
|
log.error("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||errMsg=exception", this.taskName, clusterPhy.getId(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class CommunityReassignJobTask extends AbstractAsyncCommonDispatchTask {
|
|||||||
// 更新任务的状态
|
// 更新任务的状态
|
||||||
Result<Void> rv = reassignJobService.verifyAndUpdateStatue(jobId);
|
Result<Void> rv = reassignJobService.verifyAndUpdateStatue(jobId);
|
||||||
if (rv != null && rv.failed()) {
|
if (rv != null && rv.failed()) {
|
||||||
log.error("class=CommunityReassignJobTask||method=processSubTask||jobId={}||result={}||msg=verify and update task status failed", jobId, rv);
|
log.error("method=processSubTask||jobId={}||result={}||msg=verify and update task status failed", jobId, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新同步进度信息
|
// 更新同步进度信息
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ public abstract class AbstractAsyncMetadataDispatchTask extends AbstractClusterP
|
|||||||
try {
|
try {
|
||||||
TaskResult tr = this.processClusterTask(clusterPhy, triggerTimeUnitMs);
|
TaskResult tr = this.processClusterTask(clusterPhy, triggerTimeUnitMs);
|
||||||
if (TaskResult.SUCCESS_CODE != tr.getCode()) {
|
if (TaskResult.SUCCESS_CODE != tr.getCode()) {
|
||||||
log.error("class=AbstractAsyncMetadataDispatchTask||taskName={}||clusterPhyId={}||taskResult={}||msg=failed", this.taskName, clusterPhy.getId(), tr);
|
log.error("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||taskResult={}||msg=failed", this.taskName, clusterPhy.getId(), tr);
|
||||||
} else {
|
} else {
|
||||||
log.debug("class=AbstractAsyncMetadataDispatchTask||taskName={}||clusterPhyId={}||msg=success", this.taskName, clusterPhy.getId());
|
log.debug("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||msg=success", this.taskName, clusterPhy.getId());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("class=AbstractAsyncMetadataDispatchTask||taskName={}||clusterPhyId={}||errMsg=exception", this.taskName, clusterPhy.getId(), e);
|
log.error("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||errMsg=exception", this.taskName, clusterPhy.getId(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class SyncPartitionTask extends AbstractAsyncMetadataDispatchTask {
|
|||||||
try {
|
try {
|
||||||
partitionService.updatePartitions(clusterPhy.getId(), entry.getKey(), entry.getValue(), dbPartitionMap.getOrDefault(entry.getKey(), new ArrayList<>()));
|
partitionService.updatePartitions(clusterPhy.getId(), entry.getKey(), entry.getValue(), dbPartitionMap.getOrDefault(entry.getKey(), new ArrayList<>()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("class=SyncPartitionTask||method=processSubTask||clusterPhyId={}||topicName={}||errMsg=exception", clusterPhy.getId(), entry.getKey(), e);
|
log.error("method=processSubTask||clusterPhyId={}||topicName={}||errMsg=exception", clusterPhy.getId(), entry.getKey(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ public abstract class AbstractAsyncMetricsDispatchTask extends AbstractClusterPh
|
|||||||
try {
|
try {
|
||||||
TaskResult tr = this.processClusterTask(clusterPhy, triggerTimeUnitMs);
|
TaskResult tr = this.processClusterTask(clusterPhy, triggerTimeUnitMs);
|
||||||
if (TaskResult.SUCCESS_CODE != tr.getCode()) {
|
if (TaskResult.SUCCESS_CODE != tr.getCode()) {
|
||||||
log.error("class=AbstractAsyncMetricsDispatchTask||taskName={}||clusterPhyId={}||taskResult={}||msg=failed", this.taskName, clusterPhy.getId(), tr);
|
log.error("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||taskResult={}||msg=failed", this.taskName, clusterPhy.getId(), tr);
|
||||||
} else {
|
} else {
|
||||||
log.debug("class=AbstractAsyncMetricsDispatchTask||taskName={}||clusterPhyId={}||msg=success", this.taskName, clusterPhy.getId());
|
log.debug("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||msg=success", this.taskName, clusterPhy.getId());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("class=AbstractAsyncMetricsDispatchTask||taskName={}||clusterPhyId={}||errMsg=exception", this.taskName, clusterPhy.getId(), e);
|
log.error("method=asyncProcessSubTask||taskName={}||clusterPhyId={}||errMsg=exception", this.taskName, clusterPhy.getId(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user