This is an automated email from the ASF dual-hosted git repository. yuzhou pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push: new 6b59155661 [ISSUE #7941] add override annotation (#7959) 6b59155661 is described below commit 6b591556612566c23afeca1ded14c04dfc9dc43d Author: hqbfz <125714719+3424672...@users.noreply.github.com> AuthorDate: Thu Jun 13 10:28:02 2024 +0800 [ISSUE #7941] add override annotation (#7959) * increase missing annotation * Revert "increase missing annotation" This reverts commit c1f3cef51d781c132d2064e773a58dc496f9c48c. * increase missing annotation --- .../test/util/data/collect/impl/ListDataCollectorImpl.java | 11 +++++++++++ .../test/util/data/collect/impl/MapDataCollectorImpl.java | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/test/src/main/java/org/apache/rocketmq/test/util/data/collect/impl/ListDataCollectorImpl.java b/test/src/main/java/org/apache/rocketmq/test/util/data/collect/impl/ListDataCollectorImpl.java index bdd991a335..b0a1ee3c6a 100644 --- a/test/src/main/java/org/apache/rocketmq/test/util/data/collect/impl/ListDataCollectorImpl.java +++ b/test/src/main/java/org/apache/rocketmq/test/util/data/collect/impl/ListDataCollectorImpl.java @@ -39,19 +39,23 @@ public class ListDataCollectorImpl implements DataCollector { } } + @Override public Collection<Object> getAllData() { return datas; } + @Override public synchronized void resetData() { datas.clear(); unlockIncrement(); } + @Override public long getDataSizeWithoutDuplicate() { return getAllDataWithoutDuplicate().size(); } + @Override public synchronized void addData(Object data) { if (lock) { return; @@ -59,18 +63,22 @@ public class ListDataCollectorImpl implements DataCollector { datas.add(data); } + @Override public long getDataSize() { return datas.size(); } + @Override public boolean isRepeatedData(Object data) { return Collections.frequency(datas, data) == 1; } + @Override public synchronized Collection<Object> getAllDataWithoutDuplicate() { return new HashSet<Object>(datas); } + @Override public int getRepeatedTimeForData(Object data) { int res = 0; for (Object obj : datas) { @@ -81,14 +89,17 @@ public class ListDataCollectorImpl implements DataCollector { return res; } + @Override public synchronized void removeData(Object data) { datas.remove(data); } + @Override public void lockIncrement() { lock = true; } + @Override public void unlockIncrement() { lock = false; } diff --git a/test/src/main/java/org/apache/rocketmq/test/util/data/collect/impl/MapDataCollectorImpl.java b/test/src/main/java/org/apache/rocketmq/test/util/data/collect/impl/MapDataCollectorImpl.java index 899bb85558..7c51af7528 100644 --- a/test/src/main/java/org/apache/rocketmq/test/util/data/collect/impl/MapDataCollectorImpl.java +++ b/test/src/main/java/org/apache/rocketmq/test/util/data/collect/impl/MapDataCollectorImpl.java @@ -41,6 +41,7 @@ public class MapDataCollectorImpl implements DataCollector { } } + @Override public synchronized void addData(Object data) { if (lock) { return; @@ -52,6 +53,7 @@ public class MapDataCollectorImpl implements DataCollector { } } + @Override public Collection<Object> getAllData() { List<Object> lst = new ArrayList<Object>(); for (Entry<Object, AtomicInteger> entry : datas.entrySet()) { @@ -62,15 +64,18 @@ public class MapDataCollectorImpl implements DataCollector { return lst; } + @Override public long getDataSizeWithoutDuplicate() { return datas.keySet().size(); } + @Override public void resetData() { datas.clear(); unlockIncrement(); } + @Override public long getDataSize() { long sum = 0; for (AtomicInteger count : datas.values()) { @@ -79,6 +84,7 @@ public class MapDataCollectorImpl implements DataCollector { return sum; } + @Override public boolean isRepeatedData(Object data) { if (datas.containsKey(data)) { return datas.get(data).get() == 1; @@ -86,10 +92,12 @@ public class MapDataCollectorImpl implements DataCollector { return false; } + @Override public Collection<Object> getAllDataWithoutDuplicate() { return datas.keySet(); } + @Override public int getRepeatedTimeForData(Object data) { if (datas.containsKey(data)) { return datas.get(data).intValue(); @@ -97,14 +105,17 @@ public class MapDataCollectorImpl implements DataCollector { return 0; } + @Override public void removeData(Object data) { datas.remove(data); } + @Override public void lockIncrement() { lock = true; } + @Override public void unlockIncrement() { lock = false; }