amaliujia commented on a change in pull request #1725:
URL: https://github.com/apache/ozone/pull/1725#discussion_r549943738



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java
##########
@@ -89,4 +98,12 @@ private Message process(final SCMRatisRequest request)
     }
   }
 
+  @Override
+  public long takeSnapshot() throws IOException {
+    LOG.info("Current Snapshot Index {}", getLastAppliedTermIndex());
+    TermIndex lastTermIndex = getLastAppliedTermIndex();

Review comment:
       I believe we don't need to. 
   
   ```
       public TermIndex getLastAppliedTermIndex() {
           return (TermIndex)this.lastAppliedTermIndex.get();
       }
   ```
   
   ```
       protected boolean updateLastAppliedTermIndex(long term, long index) {
           TermIndex newTI = TermIndex.newTermIndex(term, index);
           TermIndex oldTI = 
(TermIndex)this.lastAppliedTermIndex.getAndSet(newTI);
            ....
   ```
   
   Both function access `this.lastAppliedTermIndex`. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to