From 175b8d643ac7d4dc64a8c73987e77202bdba43e7 Mon Sep 17 00:00:00 2001 From: zengqiao Date: Fri, 2 Dec 2022 14:39:57 +0800 Subject: [PATCH] =?UTF-8?q?[Optimize]=E7=BB=9F=E4=B8=80=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F-part1(#800)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/cluster/impl/ClusterZookeepersManagerImpl.java | 2 +- .../impl/KafkaControllerServiceImpl.java | 6 +++--- .../service/partition/impl/OpPartitionServiceImpl.java | 4 ++-- .../partition/impl/PartitionMetricServiceImpl.java | 10 +++++----- .../km/core/service/topic/impl/TopicServiceImpl.java | 4 ++-- .../core/service/zookeeper/impl/ZnodeServiceImpl.java | 8 ++++---- .../zookeeper/impl/ZookeeperMetricServiceImpl.java | 2 +- .../service/zookeeper/impl/ZookeeperServiceImpl.java | 6 +++--- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/km-biz/src/main/java/com/xiaojukeji/know/streaming/km/biz/cluster/impl/ClusterZookeepersManagerImpl.java b/km-biz/src/main/java/com/xiaojukeji/know/streaming/km/biz/cluster/impl/ClusterZookeepersManagerImpl.java index 6441087e..aca30269 100644 --- a/km-biz/src/main/java/com/xiaojukeji/know/streaming/km/biz/cluster/impl/ClusterZookeepersManagerImpl.java +++ b/km-biz/src/main/java/com/xiaojukeji/know/streaming/km/biz/cluster/impl/ClusterZookeepersManagerImpl.java @@ -94,7 +94,7 @@ public class ClusterZookeepersManagerImpl implements ClusterZookeepersManager { ); if (metricsResult.failed()) { LOGGER.error( - "class=ClusterZookeepersManagerImpl||method=getClusterPhyZookeepersState||clusterPhyId={}||errMsg={}", + "method=getClusterPhyZookeepersState||clusterPhyId={}||errMsg={}", clusterPhyId, metricsResult.getMessage() ); return Result.buildSuc(vo); diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/kafkacontroller/impl/KafkaControllerServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/kafkacontroller/impl/KafkaControllerServiceImpl.java index 8048eabe..6047d844 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/kafkacontroller/impl/KafkaControllerServiceImpl.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/kafkacontroller/impl/KafkaControllerServiceImpl.java @@ -140,7 +140,7 @@ public class KafkaControllerServiceImpl implements KafkaControllerService { try { adminClient = kafkaAdminClient.getClient(clusterPhy.getId()); } catch (Exception e) { - log.error("class=KafkaControllerServiceImpl||method=getControllerFromAdminClient||clusterPhyId={}||errMsg=exception", clusterPhy.getId(), e); + log.error("method=getControllerFromAdminClient||clusterPhyId={}||errMsg=exception", clusterPhy.getId(), e); // 集群已经加载进来,但是创建admin-client失败,则设置无controller return Result.buildSuc(); @@ -178,7 +178,7 @@ public class KafkaControllerServiceImpl implements KafkaControllerService { )); } catch (Exception e) { log.error( - "class=KafkaControllerServiceImpl||method=getControllerFromAdminClient||clusterPhyId={}||tryTime={}||errMsg=exception", + "method=getControllerFromAdminClient||clusterPhyId={}||tryTime={}||errMsg=exception", clusterPhy.getId(), i, e ); } @@ -192,7 +192,7 @@ public class KafkaControllerServiceImpl implements KafkaControllerService { try { return Result.buildSuc(kafkaZKDAO.getKafkaController(clusterPhy.getId(), false)); } catch (Exception e) { - log.error("class=KafkaControllerServiceImpl||method=getControllerFromZKClient||clusterPhyId={}||errMsg=exception", clusterPhy.getId(), e); + log.error("method=getControllerFromZKClient||clusterPhyId={}||errMsg=exception", clusterPhy.getId(), e); return Result.buildFromRSAndMsg(ResultStatus.KAFKA_OPERATE_FAILED, e.getMessage()); } diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/partition/impl/OpPartitionServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/partition/impl/OpPartitionServiceImpl.java index 0f1186ef..6dbb5816 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/partition/impl/OpPartitionServiceImpl.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/partition/impl/OpPartitionServiceImpl.java @@ -84,7 +84,7 @@ public class OpPartitionServiceImpl extends BaseVersionControlService implements return Result.buildSuc(); } catch (Exception e) { LOGGER.error( - "class=OpPartitionServiceImpl||method=preferredReplicaElectionByZKClient||clusterPhyId={}||errMsg=exception", + "method=preferredReplicaElectionByZKClient||clusterPhyId={}||errMsg=exception", partitionParam.getClusterPhyId(), e ); @@ -109,7 +109,7 @@ public class OpPartitionServiceImpl extends BaseVersionControlService implements return Result.buildSuc(); } catch (Exception e) { LOGGER.error( - "class=OpPartitionServiceImpl||method=preferredReplicaElectionByKafkaClient||clusterPhyId={}||errMsg=exception", + "method=preferredReplicaElectionByKafkaClient||clusterPhyId={}||errMsg=exception", partitionParam.getClusterPhyId(), e ); diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/partition/impl/PartitionMetricServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/partition/impl/PartitionMetricServiceImpl.java index 90646fe4..e6ce6a62 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/partition/impl/PartitionMetricServiceImpl.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/partition/impl/PartitionMetricServiceImpl.java @@ -191,7 +191,7 @@ public class PartitionMetricServiceImpl extends BaseMetricService implements Par } } else { LOGGER.warn( - "class=PartitionMetricServiceImpl||method=getOffsetRelevantMetrics||clusterPhyId={}||topicName={}||resultMsg={}||msg=get begin offset failed", + "method=getOffsetRelevantMetrics||clusterPhyId={}||topicName={}||resultMsg={}||msg=get begin offset failed", clusterPhyId, topicName, beginOffsetMapResult.getMessage() ); } @@ -211,7 +211,7 @@ public class PartitionMetricServiceImpl extends BaseMetricService implements Par } } else { LOGGER.warn( - "class=PartitionMetricServiceImpl||method=getOffsetRelevantMetrics||clusterPhyId={}||topicName={}||resultMsg={}||msg=get end offset failed", + "method=getOffsetRelevantMetrics||clusterPhyId={}||topicName={}||resultMsg={}||msg=get end offset failed", clusterPhyId, topicName, endOffsetMapResult.getMessage() ); } @@ -235,7 +235,7 @@ public class PartitionMetricServiceImpl extends BaseMetricService implements Par } } else { LOGGER.warn( - "class=PartitionMetricServiceImpl||method=getOffsetRelevantMetrics||clusterPhyId={}||topicName={}||endResultMsg={}||beginResultMsg={}||msg=get messages failed", + "method=getOffsetRelevantMetrics||clusterPhyId={}||topicName={}||endResultMsg={}||beginResultMsg={}||msg=get messages failed", clusterPhyId, topicName, endOffsetMapResult.getMessage(), beginOffsetMapResult.getMessage() ); } @@ -286,7 +286,7 @@ public class PartitionMetricServiceImpl extends BaseMetricService implements Par continue; } catch (Exception e) { LOGGER.error( - "class=PartitionMetricServiceImpl||method=getMetricFromJmx||clusterPhyId={}||topicName={}||partitionId={}||leaderBrokerId={}||metricName={}||msg={}", + "method=getMetricFromJmx||clusterPhyId={}||topicName={}||partitionId={}||leaderBrokerId={}||metricName={}||msg={}", clusterPhyId, topicName, partition.getPartitionId(), partition.getLeaderBrokerId(), metricName, e.getClass().getName() ); } @@ -341,7 +341,7 @@ public class PartitionMetricServiceImpl extends BaseMetricService implements Par continue; } catch (Exception e) { LOGGER.error( - "class=PartitionMetricServiceImpl||method=getTopicAvgMetricFromJmx||clusterPhyId={}||topicName={}||partitionId={}||leaderBrokerId={}||metricName={}||msg={}", + "method=getTopicAvgMetricFromJmx||clusterPhyId={}||topicName={}||partitionId={}||leaderBrokerId={}||metricName={}||msg={}", clusterPhyId, topicName, partition.getPartitionId(), partition.getLeaderBrokerId(), metricName, e.getClass().getName() ); } diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/topic/impl/TopicServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/topic/impl/TopicServiceImpl.java index 2c0309f0..2689373c 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/topic/impl/TopicServiceImpl.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/topic/impl/TopicServiceImpl.java @@ -260,7 +260,7 @@ public class TopicServiceImpl implements TopicService { return Result.buildSuc(topicList); } catch (Exception e) { - log.error("class=TopicServiceImpl||method=getTopicsFromAdminClient||clusterPhyId={}||errMsg=exception", clusterPhy.getId(), e); + log.error("method=getTopicsFromAdminClient||clusterPhyId={}||errMsg=exception", clusterPhy.getId(), e); return Result.buildFromRSAndMsg(ResultStatus.KAFKA_OPERATE_FAILED, e.getMessage()); } @@ -278,7 +278,7 @@ public class TopicServiceImpl implements TopicService { return Result.buildSuc(topicList); } catch (Exception e) { - log.error("class=TopicServiceImpl||method=getTopicsFromZKClient||clusterPhyId={}||errMsg=exception", clusterPhy.getId(), e); + log.error("method=getTopicsFromZKClient||clusterPhyId={}||errMsg=exception", clusterPhy.getId(), e); return Result.buildFromRSAndMsg(ResultStatus.KAFKA_OPERATE_FAILED, e.getMessage()); } diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZnodeServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZnodeServiceImpl.java index 73ff251f..af613c03 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZnodeServiceImpl.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZnodeServiceImpl.java @@ -43,10 +43,10 @@ public class ZnodeServiceImpl implements ZnodeService { try { children = kafkaZKDAO.getChildren(clusterPhyId, path, false); } catch (NotExistException e) { - LOGGER.error("class=ZnodeServiceImpl||method=listZnodeChildren||clusterPhyId={}||errMsg={}", clusterPhyId, "create ZK client create failed"); + LOGGER.error("method=listZnodeChildren||clusterPhyId={}||errMsg={}", clusterPhyId, "create ZK client create failed"); return Result.buildFromRSAndMsg(ResultStatus.NOT_EXIST, "ZK客户端创建失败"); } catch (Exception e) { - LOGGER.error("class=ZnodeServiceImpl||method=listZnodeChildren||clusterPhyId={}||errMsg={}", clusterPhyId, "ZK operate failed"); + LOGGER.error("method=listZnodeChildren||clusterPhyId={}||errMsg={}", clusterPhyId, "ZK operate failed"); return Result.buildFromRSAndMsg(ResultStatus.ZK_OPERATE_FAILED, "ZK操作失败"); } @@ -69,10 +69,10 @@ public class ZnodeServiceImpl implements ZnodeService { try { dataAndStat = kafkaZKDAO.getDataAndStat(clusterPhyId, path); } catch (NotExistException e) { - LOGGER.error("class=ZnodeServiceImpl||method=getZnode||clusterPhyId={}||errMsg={}", clusterPhyId, "create ZK client create failed"); + LOGGER.error("method=getZnode||clusterPhyId={}||errMsg={}", clusterPhyId, "create ZK client create failed"); return Result.buildFromRSAndMsg(ResultStatus.NOT_EXIST, "ZK客户端创建失败"); } catch (Exception e) { - LOGGER.error("class=ZnodeServiceImpl||method=getZnode||clusterPhyId={}||errMsg={}", clusterPhyId, "ZK operate failed"); + LOGGER.error("method=getZnode||clusterPhyId={}||errMsg={}", clusterPhyId, "ZK operate failed"); return Result.buildFromRSAndMsg(ResultStatus.ZK_OPERATE_FAILED, "ZK操作失败"); } diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZookeeperMetricServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZookeeperMetricServiceImpl.java index a9be87f6..d90ec378 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZookeeperMetricServiceImpl.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZookeeperMetricServiceImpl.java @@ -140,7 +140,7 @@ public class ZookeeperMetricServiceImpl extends BaseMetricService implements Zoo metrics.putMetric(ret.getData().getMetrics()); } catch (Exception e){ LOGGER.error( - "class=ZookeeperMetricServiceImpl||method=collectMetricsFromZookeeper||clusterPhyId={}||metricName={}||errMsg=exception!", + "method=collectMetricsFromZookeeper||clusterPhyId={}||metricName={}||errMsg=exception!", clusterPhyId, metricName, e ); } diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZookeeperServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZookeeperServiceImpl.java index 84d7eb4c..8b0d63d1 100644 --- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZookeeperServiceImpl.java +++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/zookeeper/impl/ZookeeperServiceImpl.java @@ -41,7 +41,7 @@ public class ZookeeperServiceImpl implements ZookeeperService { addressList = ZookeeperUtils.connectStringParser(zookeeperAddress); } catch (Exception e) { LOGGER.error( - "class=ZookeeperServiceImpl||method=listFromZookeeperCluster||clusterPhyId={}||zookeeperAddress={}||errMsg=exception!", + "method=listFromZookeeperCluster||clusterPhyId={}||zookeeperAddress={}||errMsg=exception!", clusterPhyId, zookeeperAddress, e ); @@ -87,7 +87,7 @@ public class ZookeeperServiceImpl implements ZookeeperService { zookeeperDAO.updateById(newInfo); } } catch (Exception e) { - LOGGER.error("class=ZookeeperServiceImpl||method=batchReplaceDataInDB||clusterPhyId={}||newInfo={}||errMsg=exception", clusterPhyId, newInfo, e); + LOGGER.error("method=batchReplaceDataInDB||clusterPhyId={}||newInfo={}||errMsg=exception", clusterPhyId, newInfo, e); } } @@ -96,7 +96,7 @@ public class ZookeeperServiceImpl implements ZookeeperService { try { zookeeperDAO.deleteById(entry.getValue().getId()); } catch (Exception e) { - LOGGER.error("class=ZookeeperServiceImpl||method=batchReplaceDataInDB||clusterPhyId={}||expiredInfo={}||errMsg=exception", clusterPhyId, entry.getValue(), e); + LOGGER.error("method=batchReplaceDataInDB||clusterPhyId={}||expiredInfo={}||errMsg=exception", clusterPhyId, entry.getValue(), e); } }); }