You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2019/05/14 17:47:44 UTC

[GitHub] [incubator-ratis] joshelser commented on a change in pull request #19: RATIS-549, RATIS-550, RATIS-552, RATIS-553 Metric Framework for Ratis

joshelser commented on a change in pull request #19: RATIS-549,RATIS-550,RATIS-552,RATIS-553 Metric Framework for Ratis
URL: https://github.com/apache/incubator-ratis/pull/19#discussion_r283914205
 
 

 ##########
 File path: ratis-logservice/src/main/java/org/apache/ratis/logservice/server/MetaStateMachine.java
 ##########
 @@ -172,27 +176,30 @@ public TransactionContext preAppendTransaction(TransactionContext trx) throws IO
 
     @Override
     public CompletableFuture<Message> query(Message request) {
-        if (currentGroup == null) {
-            try {
-                List<RaftGroup> x = StreamSupport.stream(raftServer.getGroups().spliterator(), false)
-                    .filter(group -> group.getGroupId().equals(metadataGroupId))
-                    .collect(Collectors.toList());
-                if (x.size() == 1) {
-                    currentGroup = x.get(0);
+        long start = System.currentTimeMillis();
 
 Review comment:
   Using `System.nanoTime()` would prevent the clock from rolling back. I don't recall if there's any meaningful performance impact of `nanoTime()` over `currentTimeMillis()` though.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services