You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by ji...@apache.org on 2017/02/22 22:26:10 UTC

incubator-ratis git commit: RATIS-7. Code cleanup for SimpleStateMachine4Testing. Contributed by Garvit Bansal

Repository: incubator-ratis
Updated Branches:
  refs/heads/master 3dcda9c1c -> e22768799


RATIS-7. Code cleanup for SimpleStateMachine4Testing. Contributed by Garvit Bansal


Project: http://git-wip-us.apache.org/repos/asf/incubator-ratis/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ratis/commit/e2276879
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ratis/tree/e2276879
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ratis/diff/e2276879

Branch: refs/heads/master
Commit: e2276879983e5fcb6942452e4037abc57d95a6ab
Parents: 3dcda9c
Author: Jing Zhao <ji...@apache.org>
Authored: Wed Feb 22 14:26:02 2017 -0800
Committer: Jing Zhao <ji...@apache.org>
Committed: Wed Feb 22 14:26:02 2017 -0800

----------------------------------------------------------------------
 .../ratis/statemachine/SimpleStateMachine4Testing.java    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ratis/blob/e2276879/ratis-server/src/test/java/org/apache/ratis/statemachine/SimpleStateMachine4Testing.java
----------------------------------------------------------------------
diff --git a/ratis-server/src/test/java/org/apache/ratis/statemachine/SimpleStateMachine4Testing.java b/ratis-server/src/test/java/org/apache/ratis/statemachine/SimpleStateMachine4Testing.java
index 74d10ba..f8c22b7 100644
--- a/ratis-server/src/test/java/org/apache/ratis/statemachine/SimpleStateMachine4Testing.java
+++ b/ratis-server/src/test/java/org/apache/ratis/statemachine/SimpleStateMachine4Testing.java
@@ -56,11 +56,11 @@ import com.google.common.base.Preconditions;
  * For snapshot it simply merges all the log segments together.
  */
 public class SimpleStateMachine4Testing extends BaseStateMachine {
-  static volatile int SNAPSHOT_THRESHOLD = 100;
-  static final Logger LOG = LoggerFactory.getLogger(SimpleStateMachine4Testing.class);
-  public static final String RAFT_TEST_SIMPLE_STATE_MACHINE_TAKE_SNAPSHOT_KEY
+  private static volatile int SNAPSHOT_THRESHOLD = 100;
+  private static final Logger LOG = LoggerFactory.getLogger(SimpleStateMachine4Testing.class);
+  private static final String RAFT_TEST_SIMPLE_STATE_MACHINE_TAKE_SNAPSHOT_KEY
       = "raft.test.simple.state.machine.take.snapshot";
-  public static final boolean RAFT_TEST_SIMPLE_STATE_MACHINE_TAKE_SNAPSHOT_DEFAULT = false;
+  private static final boolean RAFT_TEST_SIMPLE_STATE_MACHINE_TAKE_SNAPSHOT_DEFAULT = false;
 
   public static SimpleStateMachine4Testing get(RaftServerImpl s) {
     return (SimpleStateMachine4Testing)s.getStateMachine();
@@ -184,7 +184,7 @@ public class SimpleStateMachine4Testing extends BaseStateMachine {
     return storage;
   }
 
-  public synchronized long loadSnapshot(SingleFileSnapshotInfo snapshot)
+  private synchronized long loadSnapshot(SingleFileSnapshotInfo snapshot)
       throws IOException {
     if (snapshot == null || !snapshot.getFile().getPath().toFile().exists()) {
       LOG.info("The snapshot file {} does not exist",