From 8cdc92ab56b2dc681fc13b31470df19065d9b166 Mon Sep 17 00:00:00 2001 From: Ayu <127600988+ayu-v0@users.noreply.github.com> Date: Sun, 24 Nov 2024 21:01:25 +0800 Subject: [PATCH] [chore] Delete redundant Spaces (#2834) Signed-off-by: ayu-v0 <127600988+ayu-v0@users.noreply.github.com> Co-authored-by: Ayu <14359932+lin-Ayu0v0@user.noreply.gitee.com> Co-authored-by: tomsun28 --- .../hertzbeat/collector/collect/snmp/SnmpCollectImpl.java | 3 --- .../apache/hertzbeat/collector/dispatch/MetricsCollect.java | 4 ---- .../hertzbeat/manager/service/ai/AlibabaAiServiceImpl.java | 2 -- .../hertzbeat/manager/service/ai/KimiAiServiceImpl.java | 1 - .../hertzbeat/manager/service/ai/SparkDeskAiServiceImpl.java | 1 - .../hertzbeat/manager/service/ai/ZhiPuServiceImpl.java | 1 - .../service/impl/AbstractGeneralConfigServiceImpl.java | 2 ++ .../hertzbeat/manager/service/impl/AppServiceImpl.java | 5 ----- .../manager/service/impl/NoticeConfigServiceImpl.java | 1 - .../hertzbeat/manager/service/impl/PluginServiceImpl.java | 2 -- 10 files changed, 2 insertions(+), 20 deletions(-) diff --git a/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java b/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java index f0b9b184075..4a7fd6311e3 100644 --- a/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java +++ b/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java @@ -74,7 +74,6 @@ public class SnmpCollectImpl extends AbstractCollect { private static final String AES128 = "1"; - private static final String SHA1 = "1"; private static final String DEFAULT_PROTOCOL = "udp"; private static final String OPERATION_GET = "get"; @@ -88,7 +87,6 @@ public class SnmpCollectImpl extends AbstractCollect { private final Map versionSnmpService = new ConcurrentHashMap<>(3); - @Override public void preCheck(Metrics metrics) throws IllegalArgumentException { if (metrics == null || metrics.getSnmp() == null) { @@ -263,7 +261,6 @@ public String supportProtocol() { return DispatchConstants.PROTOCOL_SNMP; } - private synchronized Snmp getSnmpService(int snmpVersion, SnmpBuilder snmpBuilder) throws IOException { Snmp snmpService = versionSnmpService.get(snmpVersion); if (snmpService != null) { diff --git a/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java b/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java index 9ed7d83a0e2..745dc22ff60 100644 --- a/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java +++ b/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java @@ -179,7 +179,6 @@ public void run() { collectDataDispatch.dispatchCollectData(timeout, metrics, metricsData); } - /** * Calculate the real metrics value according to the calculates and aliasFields configuration * @@ -255,7 +254,6 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col } } - for (Metrics.Field field : fields) { String realField = field.getField(); JexlExpression expression = fieldExpressionMap.get(realField); @@ -342,7 +340,6 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col } } - /** * @param cal cal * @param fieldAliasMap field alias map @@ -362,7 +359,6 @@ private Object[] transformCal(String cal, Map fieldAliasMap) { return new Object[]{field, expression}; } - /** * transform unit * diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/AlibabaAiServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/AlibabaAiServiceImpl.java index 0f0fc339be3..f9c1236ab7a 100644 --- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/AlibabaAiServiceImpl.java +++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/AlibabaAiServiceImpl.java @@ -90,7 +90,6 @@ public Flux> requestAi(String text) { .build()) .build(); - return webClient.post() .body(BodyInserters.fromValue(aliAiRequestParamDTO)) .retrieve() @@ -111,7 +110,6 @@ public Flux> requestAi(String text) { .doOnError(error -> log.info("AlibabaAiServiceImpl.requestAi exception:{}", error.getMessage())); } - private void checkParam(String param, String apiKey, String model) { Assert.notNull(param, "text is null"); Assert.notNull(model, "model is null"); diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/KimiAiServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/KimiAiServiceImpl.java index 031a33271b3..5063949150e 100644 --- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/KimiAiServiceImpl.java +++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/KimiAiServiceImpl.java @@ -79,7 +79,6 @@ public Flux> requestAi(String text) { .messages(List.of(new AiMessage(AiConstants.KimiAiConstants.REQUEST_ROLE, text))) .build(); - return webClient.post() .body(BodyInserters.fromValue(zhiPuRequestParamDTO)) .retrieve() diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/SparkDeskAiServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/SparkDeskAiServiceImpl.java index 4c2520f63a0..c35b1f664e9 100644 --- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/SparkDeskAiServiceImpl.java +++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/SparkDeskAiServiceImpl.java @@ -47,7 +47,6 @@ @Slf4j public class SparkDeskAiServiceImpl implements AiService { - @Autowired private AiProperties aiProperties; diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/ZhiPuServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/ZhiPuServiceImpl.java index 75a55f1b8cd..1a8ef2d934e 100644 --- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/ZhiPuServiceImpl.java +++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/ai/ZhiPuServiceImpl.java @@ -97,5 +97,4 @@ private void checkParam(String param, String model, String apiKey) { Assert.notNull(apiKey, "ai.api-key is null"); } - } diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AbstractGeneralConfigServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AbstractGeneralConfigServiceImpl.java index 52e644eebc0..b02af53b96a 100644 --- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AbstractGeneralConfigServiceImpl.java +++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AbstractGeneralConfigServiceImpl.java @@ -31,7 +31,9 @@ */ @Slf4j abstract class AbstractGeneralConfigServiceImpl implements GeneralConfigService { + protected final GeneralConfigDao generalConfigDao; + protected final ObjectMapper objectMapper; /** diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AppServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AppServiceImpl.java index d2537515be2..6f879c5bb70 100644 --- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AppServiceImpl.java +++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AppServiceImpl.java @@ -203,7 +203,6 @@ public List getAppDefineMetricNames(String app) { return metricNames; } - @Override public Map getI18nResources(String lang) { Map i18nMap = new HashMap<>(128); @@ -266,7 +265,6 @@ public Map getI18nApps(String lang) { return i18nMap; } - @Override public List getAllAppHierarchy(String lang) { LinkedList hierarchies = new LinkedList<>(); @@ -360,7 +358,6 @@ private void queryAppHierarchy(String lang, LinkedList hierarchies, J } } - private void combineHierarchyMetrics(List hierarchyMetricList, Hierarchy hierarchyMetric) { Optional preHierarchyOptional = hierarchyMetricList.stream() .filter(item -> item.getValue().equals(hierarchyMetric.getValue())) @@ -383,13 +380,11 @@ private void combineHierarchyMetrics(List hierarchyMetricList, Hierar } } - @Override public Map getAllAppDefines() { return appDefines; } - @Override public String getMonitorDefineFileContent(String app) { var appDefine = appDefineStore.loadAppDefine(app); diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/NoticeConfigServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/NoticeConfigServiceImpl.java index b11f2af5068..b4dd9b5c01d 100644 --- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/NoticeConfigServiceImpl.java +++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/NoticeConfigServiceImpl.java @@ -84,7 +84,6 @@ public class NoticeConfigServiceImpl implements NoticeConfigService, CommandLine @Lazy private DispatcherAlarm dispatcherAlarm; - @Override public List getNoticeReceivers(String name) { Specification specification = (root, query, criteriaBuilder) -> { diff --git a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/PluginServiceImpl.java b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/PluginServiceImpl.java index c1b52d2703f..b3d497cc970 100644 --- a/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/PluginServiceImpl.java +++ b/hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/PluginServiceImpl.java @@ -376,8 +376,6 @@ private void syncSinglePluginStatus(PluginMetadata plugin) { PLUGIN_ENABLE_STATUS.put(item.getClassIdentifier(), plugin.getEnableStatus()); ITEM_TO_PLUGINMETADATAID_MAP.put(item.getClassIdentifier(), plugin.getId()); } - - } @PostConstruct