ZanderXu commented on code in PR #4565:
URL: https://github.com/apache/hadoop/pull/4565#discussion_r922941580


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/AsyncLoggerSet.java:
##########
@@ -206,197 +194,114 @@ List<AsyncLogger> getLoggersForTests() {
   ///////////////////////////////////////////////////////////////////////////
   
   public QuorumCall<AsyncLogger, GetJournalStateResponseProto> 
getJournalState() {
-    Map<AsyncLogger, ListenableFuture<GetJournalStateResponseProto>> calls =
-        Maps.newHashMap();
-    for (AsyncLogger logger : loggers) {
-      calls.put(logger, logger.getJournalState());
-    }
+    Map<AsyncLogger, ListenableFuture<GetJournalStateResponseProto>> calls = 
Maps.newHashMap();
+    loggers.forEach(l -> calls.put(l, l.getJournalState()));
     return QuorumCall.create(calls);    
   }
   
   public QuorumCall<AsyncLogger, Boolean> isFormatted() {
     Map<AsyncLogger, ListenableFuture<Boolean>> calls = Maps.newHashMap();
-    for (AsyncLogger logger : loggers) {
-      calls.put(logger, logger.isFormatted());
-    }
+    loggers.forEach(l -> calls.put(l, l.isFormatted()));
     return QuorumCall.create(calls);
   }
 
-  public QuorumCall<AsyncLogger,NewEpochResponseProto> newEpoch(
-      NamespaceInfo nsInfo,

Review Comment:
   Thanks @goiri for your review. 
   `nsInfo` is never used. HDFS-12553 started using `nsInfo` in 
`IPCLoggerChannel.class` as follows:
   ```
   @Override
     public ListenableFuture<NewEpochResponseProto> newEpoch(
         final long epoch) {
       return singleThreadExecutor.submit(new Callable<NewEpochResponseProto>() 
{
         @Override
         public NewEpochResponseProto call() throws IOException {
           return getProxy().newEpoch(journalId, nameServiceId, nsInfo, epoch);
         }
       });
     }
   ```
   
   So we can get rid of the useless `nsInfo` here.



-- 
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.

To unsubscribe, e-mail: [email protected]

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