You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2022/11/22 03:39:16 UTC

[rocketmq] branch develop updated: [ISSUE #5558] Fix typos in DLedgerController

This is an automated email from the ASF dual-hosted git repository.

jinrongtong 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 139dad04c [ISSUE #5558] Fix typos in DLedgerController
139dad04c is described below

commit 139dad04c7851fc99fcda4dc2f92def24f5bfc74
Author: hzh0425 <64...@qq.com>
AuthorDate: Tue Nov 22 11:39:09 2022 +0800

    [ISSUE #5558] Fix typos in DLedgerController
---
 .../rocketmq/controller/impl/DLedgerController.java    | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/controller/src/main/java/org/apache/rocketmq/controller/impl/DLedgerController.java b/controller/src/main/java/org/apache/rocketmq/controller/impl/DLedgerController.java
index fffc12d36..71e8e465c 100644
--- a/controller/src/main/java/org/apache/rocketmq/controller/impl/DLedgerController.java
+++ b/controller/src/main/java/org/apache/rocketmq/controller/impl/DLedgerController.java
@@ -65,7 +65,7 @@ import org.apache.rocketmq.remoting.protocol.header.controller.GetReplicaInfoReq
 import org.apache.rocketmq.remoting.protocol.header.controller.RegisterBrokerToControllerRequestHeader;
 
 /**
- * The implementation of controller, based on dledger (raft).
+ * The implementation of controller, based on DLedger (raft).
  */
 public class DLedgerController implements Controller {
 
@@ -207,7 +207,7 @@ public class DLedgerController implements Controller {
     }
 
     /**
-     * Append the request to dledger, wait the dledger to commit the request.
+     * Append the request to DLedger, and wait for DLedger to commit the request.
      */
     private boolean appendToDLedgerAndWait(final AppendEntryRequest request) throws Throwable {
         if (request != null) {
@@ -321,7 +321,7 @@ public class DLedgerController implements Controller {
     }
 
     /**
-     * Event handler, get events from supplier, and append events to dledger
+     * Event handler, get events from supplier, and append events to DLedger
      */
     class ControllerEventHandler<T> implements EventHandler<T> {
         private final String name;
@@ -346,8 +346,8 @@ public class DLedgerController implements Controller {
             if (!this.isWriteEvent || result.getEvents() == null || result.getEvents().isEmpty()) {
                 // read event, or write event with empty events in response which also equals to read event
                 if (DLedgerController.this.controllerConfig.isProcessReadEvent()) {
-                    // Now the dledger don't have the function of Read-Index or Lease-Read,
-                    // So we still need to propose an empty request to dledger.
+                    // Now the DLedger don't have the function of Read-Index or Lease-Read,
+                    // So we still need to propose an empty request to DLedger.
                     final AppendEntryRequest request = new AppendEntryRequest();
                     request.setBody(new byte[0]);
                     appendSuccess = appendToDLedgerAndWait(request);
@@ -364,7 +364,7 @@ public class DLedgerController implements Controller {
                         }
                     }
                 }
-                // Append events to dledger
+                // Append events to DLedger
                 if (!eventBytes.isEmpty()) {
                     // batch append events
                     final BatchAppendEntryRequest request = new BatchAppendEntryRequest();
@@ -383,7 +383,7 @@ public class DLedgerController implements Controller {
                 }
                 this.future.complete(response);
             } else {
-                log.error("Failed to append event to dledger, the response is {}, try cancel the future", result.getResponse());
+                log.error("Failed to append event to DLedger, the response is {}, try cancel the future", result.getResponse());
                 this.future.cancel(true);
             }
         }
@@ -430,7 +430,7 @@ public class DLedgerController implements Controller {
                     case LEADER: {
                         log.info("Controller {} change role to leader, try process a initial proposal", this.selfId);
                         // Because the role becomes to leader, but the memory statemachine of the controller is still in the old point,
-                        // some committed logs have not been applied. Therefore, we must first process an empty request to dledger,
+                        // some committed logs have not been applied. Therefore, we must first process an empty request to DLedger,
                         // and after the request is committed, the controller can provide services(startScheduling).
                         int tryTimes = 0;
                         while (true) {
@@ -443,7 +443,7 @@ public class DLedgerController implements Controller {
                                     break;
                                 }
                             } catch (final Throwable e) {
-                                log.error("Error happen when controller leader append initial request to dledger", e);
+                                log.error("Error happen when controller leader append initial request to DLedger", e);
                             }
                             if (!DLedgerController.this.getMemberState().isLeader()) {
                                 // now is not a leader