You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aa...@apache.org on 2021/10/18 10:58:37 UTC

[hadoop] branch branch-2.10 updated: HDFS-16257. Set initialCapacity for guava cache to solve performance issue (#3524)

This is an automated email from the ASF dual-hosted git repository.

aajisaka pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new b7bb43f  HDFS-16257. Set initialCapacity for guava cache to solve performance issue (#3524)
b7bb43f is described below

commit b7bb43f6db8120a35a9aecd5b385302efdda2444
Author: Symious <yi...@foxmail.com>
AuthorDate: Mon Oct 18 18:58:00 2021 +0800

    HDFS-16257. Set initialCapacity for guava cache to solve performance issue (#3524)
    
    * HDFS-16257. Set initialCapacity for guava cache to solve performance issue
    
    * HDFS-16257. Add comments
    
    Co-authored-by: Symious <yi...@gmail.com>
---
 .../hadoop/hdfs/server/federation/resolver/MountTableResolver.java     | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java
index bdd75c7..aaa0520 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java
@@ -138,6 +138,9 @@ public class MountTableResolver
           FEDERATION_MOUNT_TABLE_MAX_CACHE_SIZE,
           FEDERATION_MOUNT_TABLE_MAX_CACHE_SIZE_DEFAULT);
       this.locationCache = CacheBuilder.newBuilder()
+          // To workaround guava bug https://github.com/google/guava/issues/1055
+          // Fixed since guava 13.0
+          .initialCapacity(maxCacheSize)
           .maximumSize(maxCacheSize)
           .build();
     } else {

---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org