make the cached compile scripts a soft map

This commit is contained in:
kimchy 2010-09-02 16:29:41 +03:00
parent 7bd08d638d
commit 807c485a38

View File

@ -19,13 +19,13 @@
package org.elasticsearch.script;
import org.elasticsearch.common.collect.MapMaker;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.math.UnboxedMathUtils;
import org.elasticsearch.common.mvel2.MVEL;
import org.elasticsearch.common.mvel2.ParserContext;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@ -37,7 +37,7 @@ import java.util.concurrent.ConcurrentMap;
*/
public class ScriptService extends AbstractComponent {
private final ConcurrentMap<String, Object> cache = ConcurrentCollections.newConcurrentMap();
private final ConcurrentMap<String, Object> cache = new MapMaker().softValues().makeMap();
private final ParserContext parserContext;