hanishakoneru commented on a change in pull request #856:
URL: https://github.com/apache/hadoop-ozone/pull/856#discussion_r418304296



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java
##########
@@ -173,17 +196,19 @@ private void flushTransactions() {
                 flushedTransactionsSize);
           }
 
-          long lastRatisTransactionIndex =
-              readyBuffer.stream().map(DoubleBufferEntry::getTrxLogIndex)
-                  .max(Long::compareTo).get();
-
-          List<Long> flushedEpochs =
-              readyBuffer.stream().map(DoubleBufferEntry::getTrxLogIndex)
-                  .sorted().collect(Collectors.toList());
+          // When non-HA do this step here, as the sorted is not require in
+          // flush to DB. As in non-HA We want to complete futures as quick
+          // as possible after flush to DB, to release rpc handler threads.
+          if (!isRatisEnabled) {

Review comment:
       Sorry this comment is not clear. Do you mean sorted Transaction list is 
not required here?

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java
##########
@@ -86,10 +89,10 @@
 
   private final boolean isRatisEnabled;
 
-  public OzoneManagerDoubleBuffer(OMMetadataManager omMetadataManager,
-      OzoneManagerRatisSnapshot ozoneManagerRatisSnapShot) {
-    this(omMetadataManager, ozoneManagerRatisSnapShot, true);
-  }
+  /**
+   * function which will get term associated with the transaction index.
+   */
+  private Function<Long, Long> termGet = null;
 
   public OzoneManagerDoubleBuffer(OMMetadataManager omMetadataManager,
       OzoneManagerRatisSnapshot ozoneManagerRatisSnapShot,

Review comment:
       For this constructor, termGet will be null. But a daemon is initialized 
to flushTransactions. Could it lead to NullPointer?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to