SOLR-985 -- Fix thread-safety issue with TemplateString for concurrent imports with multiple cores

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@737771 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-01-26 18:00:06 +00:00
parent 9b1cd911f6
commit e36809b163
2 changed files with 6 additions and 1 deletions

View File

@ -94,6 +94,9 @@ Bug Fixes
12. SOLR-884: CachedSqlEntityProcessor should check if the cache key is present in the query results 12. SOLR-884: CachedSqlEntityProcessor should check if the cache key is present in the query results
(Noble Paul via shalin) (Noble Paul via shalin)
13. SOLR-985: Fix thread-safety issue with TemplateString for concurrent imports with multiple cores.
(Ryuuichi Kumai via shalin)
Documentation Documentation
---------------------- ----------------------

View File

@ -20,6 +20,8 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -43,7 +45,7 @@ public class TemplateString {
private Map<String, TemplateString> cache; private Map<String, TemplateString> cache;
public TemplateString() { public TemplateString() {
cache = new HashMap<String, TemplateString>(); cache = new ConcurrentHashMap<String, TemplateString>();
} }
private TemplateString(String s) { private TemplateString(String s) {