[ISSUE #5558] Fix typos in DLedgerController

This commit is contained in:
hzh0425
2022-11-22 11:39:09 +08:00
committed by GitHub
parent 4469fb51dd
commit 139dad04c7
@@ -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