瀏覽代碼

HDFS-13611. Unsafe use of Text as a ConcurrentHashMap key in PBHelperClient.

(cherry picked from commit c9b63deb533274ca8ef4939f6cd13f728a067f7b)
Andrew Wang 7 年之前
父節點
當前提交
731abae557

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java

@@ -240,7 +240,7 @@ public class PBHelperClient {
     ByteString value = fixedByteStringCache.get(key);
     if (value == null) {
       value = ByteString.copyFromUtf8(key.toString());
-      fixedByteStringCache.put(key, value);
+      fixedByteStringCache.put(new Text(key.copyBytes()), value);
     }
     return value;
   }