From 122ef430b7ce27086d09acfbd6dc67061e7a0247 Mon Sep 17 00:00:00 2001 From: gaibu <1016771049@qq.com> Date: Fri, 5 Jul 2024 22:42:59 +0800 Subject: [PATCH] [Improve] add @Override --- .../apache/hertzbeat/collector/collect/ftp/FtpCollectImpl.java | 1 + .../collector/collect/mongodb/MongodbSingleCollectImpl.java | 1 + .../collector/collect/mq/RocketmqSingleCollectImpl.java | 1 + .../collector/collect/redis/RedisCommonCollectImpl.java | 1 + 4 files changed, 4 insertions(+) diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/ftp/FtpCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/ftp/FtpCollectImpl.java index e287eea3332..2769f1609bb 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/collect/ftp/FtpCollectImpl.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/ftp/FtpCollectImpl.java @@ -44,6 +44,7 @@ public class FtpCollectImpl extends AbstractCollect { /** * preCheck params */ + @Override public void preCheck(Metrics metrics) throws IllegalArgumentException{ if (metrics == null || metrics.getFtp() == null) { throw new IllegalArgumentException("Ftp collect must has ftp params."); diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java index 45ab1b3dd7c..9471c1874e8 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java @@ -88,6 +88,7 @@ public MongodbSingleCollectImpl() { /** * Check that the mongodb connection information in metrics is complete */ + @Override public void preCheck(Metrics metrics) throws IllegalArgumentException{ Assert.isTrue(metrics != null && metrics.getMongodb() != null, "Mongodb collect must has mongodb params"); MongodbProtocol mongodbProtocol = metrics.getMongodb(); diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/mq/RocketmqSingleCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/mq/RocketmqSingleCollectImpl.java index e3da2227780..6e59ee381b3 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/collect/mq/RocketmqSingleCollectImpl.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/mq/RocketmqSingleCollectImpl.java @@ -110,6 +110,7 @@ public void destroy() { * preCheck params * @param metrics metrics config */ + @Override public void preCheck(Metrics metrics) throws IllegalArgumentException { Assert.isTrue(metrics != null && metrics.getRocketmq() != null, "Mongodb collect must has rocketmq params"); RocketmqProtocol rocketmq = metrics.getRocketmq(); diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/redis/RedisCommonCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/redis/RedisCommonCollectImpl.java index 04b28ebab93..ef4a5bbb230 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/collect/redis/RedisCommonCollectImpl.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/redis/RedisCommonCollectImpl.java @@ -73,6 +73,7 @@ public RedisCommonCollectImpl() { connectionCommonCache = new ConnectionCommonCache<>(); } + @Override public void preCheck(Metrics metrics) throws IllegalArgumentException{ Assert.noNullElements(new Object[] {metrics, metrics.getRedis()}, "Redis collect must has redis params"); RedisProtocol redisProtocol = metrics.getRedis();