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 03c5a3d [ISSUE #3985] Remove shuffle operation before sorting the
list of 'FaultItem'. (#3986)
03c5a3d is described below
commit 03c5a3d171eb8667a7d13409d45723005c4c22f5
Author: 彭小漪 <[email protected]>
AuthorDate: Mon Mar 14 20:48:23 2022 +0800
[ISSUE #3985] Remove shuffle operation before sorting the list of
'FaultItem'. (#3986)
---
.../apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java | 5 -----
1 file changed, 5 deletions(-)
diff --git
a/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java
b/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java
index 827d972..750759f 100644
---
a/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java
+++
b/client/src/main/java/org/apache/rocketmq/client/latency/LatencyFaultToleranceImpl.java
@@ -70,12 +70,8 @@ public class LatencyFaultToleranceImpl implements
LatencyFaultTolerance<String>
final FaultItem faultItem = elements.nextElement();
tmpList.add(faultItem);
}
-
if (!tmpList.isEmpty()) {
- Collections.shuffle(tmpList);
-
Collections.sort(tmpList);
-
final int half = tmpList.size() / 2;
if (half <= 0) {
return tmpList.get(0).getName();
@@ -84,7 +80,6 @@ public class LatencyFaultToleranceImpl implements
LatencyFaultTolerance<String>
return tmpList.get(i).getName();
}
}
-
return null;
}