You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by zh...@apache.org on 2023/02/14 05:51:12 UTC
[rocketmq] 17/18: Modify abbreviated variables and add comments
This is an automated email from the ASF dual-hosted git repository.
zhouxzhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
commit 7d58f68819be46544e8f7998fa95949f40c2b64a
Author: nowinkey <no...@tom.com>
AuthorDate: Mon Feb 13 21:07:17 2023 +0800
Modify abbreviated variables and add comments
---
.../org/apache/rocketmq/store/DefaultMessageStore.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
index 69dd86897..90493bd1b 100644
--- a/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
+++ b/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java
@@ -2625,8 +2625,8 @@ public class DefaultMessageStore implements MessageStore {
this.buffer = new DispatchRequest[bufferNum][];
}
- public void put(long idx, DispatchRequest[] obj) {
- while (ptr + this.buffer.length <= idx) {
+ public void put(long index, DispatchRequest[] dispatchRequests) {
+ while (ptr + this.buffer.length <= index) {
synchronized (this) {
try {
this.wait();
@@ -2635,12 +2635,12 @@ public class DefaultMessageStore implements MessageStore {
}
}
}
- int mod = (int) (idx % this.buffer.length);
- this.buffer[mod] = obj;
+ int mod = (int) (index % this.buffer.length);
+ this.buffer[mod] = dispatchRequests;
maxPtr.incrementAndGet();
}
- public DispatchRequest[] get(List<DispatchRequest[]> rets) {
+ public DispatchRequest[] get(List<DispatchRequest[]> dispatchRequestsList) {
synchronized (this) {
for (int i = 0; i < this.buffer.length; i++) {
int mod = (int) (ptr % this.buffer.length);
@@ -2649,7 +2649,7 @@ public class DefaultMessageStore implements MessageStore {
this.notifyAll();
return null;
}
- rets.add(ret);
+ dispatchRequestsList.add(ret);
this.buffer[mod] = null;
ptr++;
}
@@ -2911,6 +2911,9 @@ public class DefaultMessageStore implements MessageStore {
private final List<DispatchRequest[]> dispatchRequestsList = new ArrayList<>();
+ // dispatchRequestsList:[
+ // {dispatchRequests:[{dispatchRequest}, {dispatchRequest}]},
+ // {dispatchRequests:[{dispatchRequest}, {dispatchRequest}]}]
private void dispatch() {
dispatchRequestsList.clear();
dispatchRequestOrderlyQueue.get(dispatchRequestsList);