Skip to content

Commit

Permalink
Merge pull request #53 from johnmbw/NT-thread-safe-payload-decoder-lo…
Browse files Browse the repository at this point in the history
…ading

NT use a concurrent map for the payload decoder cache
  • Loading branch information
johnmbw authored Apr 28, 2022
2 parents 459be3f + 422117e commit a7f0060
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion solr/core/src/java/org/apache/solr/schema/IndexSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -160,7 +161,7 @@ public class IndexSchema {
protected DynamicCopy[] dynamicCopyFields = new DynamicCopy[] {};
public DynamicCopy[] getDynamicCopyFields() { return dynamicCopyFields; }

private Map<FieldType, PayloadDecoder> decoders = new HashMap<>(); // cache to avoid scanning token filters repeatedly, unnecessarily
private Map<FieldType, PayloadDecoder> decoders = new ConcurrentHashMap<>(); // cache to avoid scanning token filters repeatedly, unnecessarily

/**
* keys are all fields copied to, count is num of copyField
Expand Down

0 comments on commit a7f0060

Please sign in to comment.