Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.apache.rocketmq.controller.impl;

import io.openmessaging.storage.dledger.entry.DLedgerEntry;
import io.openmessaging.storage.dledger.exception.DLedgerException;
import io.openmessaging.storage.dledger.snapshot.SnapshotReader;
import io.openmessaging.storage.dledger.snapshot.SnapshotWriter;
import io.openmessaging.storage.dledger.statemachine.CommittedEntryIterator;
Expand All @@ -28,8 +29,6 @@
import org.apache.rocketmq.logging.org.slf4j.Logger;
import org.apache.rocketmq.logging.org.slf4j.LoggerFactory;

import java.util.concurrent.CompletableFuture;

/**
* The state machine implementation of the dledger controller
*/
Expand All @@ -46,6 +45,11 @@ public DLedgerControllerStateMachine(final ReplicasInfoManager replicasInfoManag
this.dLedgerId = generateDLedgerId(dLedgerGroupId, dLedgerSelfId);
}

@Override
public String generateDLedgerId(String dLedgerGroupId, String dLedgerSelfId) {
return new StringBuilder(20).append(dLedgerGroupId).append("#").append(dLedgerSelfId).toString();
}

@Override
public void onApply(CommittedEntryIterator iterator) {
int applyingSize = 0;
Expand All @@ -66,7 +70,8 @@ public void onApply(CommittedEntryIterator iterator) {
}

@Override
public void onSnapshotSave(SnapshotWriter writer, CompletableFuture<Boolean> future) {
public boolean onSnapshotSave(SnapshotWriter writer) {
return true;
}

@Override
Expand All @@ -76,6 +81,12 @@ public boolean onSnapshotLoad(SnapshotReader reader) {

@Override
public void onShutdown() {
log.info("StateMachine {} onShutdown", this.dLedgerId);
}

@Override
public void onError(DLedgerException exception) {
log.error("Encountered an error on StateMachine {}, dLedger may stop working since some error occurs, you should figure out the cause and repair or remove this node.", this.dLedgerId, exception);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<lz4-java.version>1.8.0</lz4-java.version>
<opentracing.version>0.33.0</opentracing.version>
<jaeger.version>1.8.1</jaeger.version>
<dleger.version>0.3.1.2</dleger.version>
<dleger.version>0.3.2</dleger.version>
<annotations-api.version>6.0.53</annotations-api.version>
<extra-enforcer-rules.version>1.0-beta-4</extra-enforcer-rules.version>
<concurrentlinkedhashmap-lru.version>1.4.2</concurrentlinkedhashmap-lru.version>
Expand Down
Loading