hadoop-yetus commented on a change in pull request #977: (HDFS-14541)when 
evictableMmapped or evictable size is zero, do not throw NoSuchE… 
URL: https://github.com/apache/hadoop/pull/977#discussion_r294277928
 
 

 ##########
 File path: 
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/shortcircuit/ShortCircuitCache.java
 ##########
 @@ -540,16 +538,18 @@ private void trimEvictionMaps() {
         return;
       }
       ShortCircuitReplica replica;
-      try {
-        if (evictableSize == 0) {
-          replica = (ShortCircuitReplica)evictableMmapped.get(evictableMmapped
-              .firstKey());
-        } else {
-          replica = (ShortCircuitReplica)evictable.get(evictable.firstKey());
-        }
-      } catch (NoSuchElementException e) {
-        break;
+      // maxTotalSize > 0
+      // if evictableSize == 0, evictableMmappedSize > 0 evictableMmapped do 
not
+      // throw NoSuchElementException
+      // if evictableMmappedSize == 0, evictableSize > 0 evictable do not throw
+      // NoSuchElementException
+      if (evictableSize == 0) {
+        replica = (ShortCircuitReplica) evictableMmapped
+            .get(evictableMmapped.firstKey());
+      } else {
+        replica = (ShortCircuitReplica) evictable.get(evictable.firstKey());
       }
+      
 
 Review comment:
   whitespace:end of line
   

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


With regards,
Apache Git Services

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

Reply via email to