Skip to content

Commit 8e37a8d

Browse files
committed
Address review comments.
1 parent 92c6ff9 commit 8e37a8d

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

ratis-common/src/main/java/org/apache/ratis/util/FileUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,13 @@ static void listDir(Path dir, Consumer<Object> out, BiConsumer<String, Throwable
395395
try {
396396
listDir(dir, out);
397397
} catch (IOException e) {
398-
err.accept("Failed to lsDir: " + dir, e);
398+
err.accept("Failed to listDir: " + dir, e);
399399
}
400400
}
401401

402402
static void listDir(Path dir, Consumer<Object> out) throws IOException {
403403
if (!Files.isDirectory(dir, LinkOption.NOFOLLOW_LINKS)) {
404-
throw new NotDirectoryException( "Failed to lsDir: " + dir + " is not a directory.");
404+
throw new NotDirectoryException( "Failed to listDir: " + dir + " is not a directory.");
405405
}
406406

407407
try(Stream<Path> s = Files.list(dir)) {

ratis-examples/src/test/java/org/apache/ratis/examples/counter/server/TestManualRestoreSnapshot.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@
4545
import static org.junit.jupiter.api.Assertions.assertTrue;
4646

4747
/**
48-
* Test StateMachine related functionality
48+
* Test manually restoring a snapshot.
49+
* Due to hardware failures or software bugs,
50+
* the state of a state machine can become corrupted.
51+
* In such case, we may manually copy a snapshot from the leader
52+
* and then install it to the corrupted state machine.
4953
*/
5054
public class TestManualRestoreSnapshot extends BaseTest implements MiniRaftClusterWithGrpc.FactoryGet {
5155
public static final int NUM_SERVERS = 3;

ratis-server/src/main/java/org/apache/ratis/statemachine/impl/BaseStateMachine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
*/
5151
public class BaseStateMachine implements StateMachine, StateMachine.DataApi,
5252
StateMachine.EventApi, StateMachine.LeaderEventApi, StateMachine.FollowerEventApi {
53-
static final AtomicInteger ID_GENERATOR = new AtomicInteger();
53+
private static final AtomicInteger ID_GENERATOR = new AtomicInteger();
5454

5555
private final int id = ID_GENERATOR.incrementAndGet();
5656
private final CompletableFuture<RaftServer> server = new CompletableFuture<>();

0 commit comments

Comments
 (0)