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

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new f46d8eb  Switch to using ConcurrentHashMap (#1675)
f46d8eb is described below

commit f46d8eba1701d07e39704f72b01616c206b94966
Author: Ali Ahmed <alahmed...@gmail.com>
AuthorDate: Fri Apr 27 16:22:03 2018 -0700

    Switch to using ConcurrentHashMap (#1675)
---
 .../functions/utils/functioncache/FunctionCacheManagerImpl.java  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/functioncache/FunctionCacheManagerImpl.java
 
b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/functioncache/FunctionCacheManagerImpl.java
index df4c734..dd2cc69 100644
--- 
a/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/functioncache/FunctionCacheManagerImpl.java
+++ 
b/pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/functioncache/FunctionCacheManagerImpl.java
@@ -19,15 +19,14 @@
 
 package org.apache.pulsar.functions.utils.functioncache;
 
+import org.apache.pulsar.functions.utils.Exceptions;
+
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
-import org.apache.pulsar.functions.utils.Exceptions;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * An implementation of {@link FunctionCacheManager}.
@@ -38,7 +37,7 @@ public class FunctionCacheManagerImpl implements 
FunctionCacheManager {
     private final Map<String, FunctionCacheEntry> cacheFunctions;
 
     public FunctionCacheManagerImpl() {
-        this.cacheFunctions = Collections.synchronizedMap(new HashMap<>());
+        this.cacheFunctions = new ConcurrentHashMap<>();
     }
 
     Map<String, FunctionCacheEntry> getCacheFunctions() {

-- 
To stop receiving notification emails like this one, please contact
si...@apache.org.

Reply via email to