From 10b3c8900919d91c3637954aad259d453e189f35 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 23 May 2014 19:54:45 +0200 Subject: [PATCH] Update to elasticsearch 1.2.0 Closes #20 Fix #19 --- README.md | 3 ++- pom.xml | 6 +++--- .../script/javascript/JavaScriptScriptEngineService.java | 5 +++++ .../javascript/JavaScriptScriptMultiThreadedTest.java | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a48e19422866d..af07a4e7757df 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,10 @@ JavaScript lang Plugin for Elasticsearch The JavaScript language plugin allows to have `javascript` (or `js`) as the language of scripts to execute. -In order to install the plugin, simply run: `bin/plugin -install elasticsearch/elasticsearch-lang-javascript/2.0.0.RC1`. +In order to install the plugin, simply run: `bin/plugin -install elasticsearch/elasticsearch-lang-javascript/2.1.0`. * For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/master). +* For 1.2.x elasticsearch versions, look at [es-1.2 branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/es-1.2). * For 1.1.x elasticsearch versions, look at [es-1.1 branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/es-1.1). * For 1.0.x elasticsearch versions, look at [es-1.0 branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/es-1.0). * For 0.90.x elasticsearch versions, look at [es-0.90 branch](https://github.com/elasticsearch/elasticsearch-lang-javascript/tree/es-0.90). diff --git a/pom.xml b/pom.xml index eb8a73f155950..c75544d35ba8b 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 2.0.0-SNAPSHOT - 4.7.0 + 4.8.1 1 true onerror @@ -117,8 +117,8 @@ maven-compiler-plugin 2.3.2 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/src/main/java/org/elasticsearch/script/javascript/JavaScriptScriptEngineService.java b/src/main/java/org/elasticsearch/script/javascript/JavaScriptScriptEngineService.java index eacc8f5f7cb3e..7b564e0fdf8bc 100644 --- a/src/main/java/org/elasticsearch/script/javascript/JavaScriptScriptEngineService.java +++ b/src/main/java/org/elasticsearch/script/javascript/JavaScriptScriptEngineService.java @@ -81,6 +81,11 @@ public String[] extensions() { return new String[]{"js"}; } + @Override + public boolean sandboxed() { + return false; + } + @Override public Object compile(String script) { Context ctx = Context.enter(); diff --git a/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTest.java b/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTest.java index 26eab2091ce7b..381de8e56458f 100644 --- a/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTest.java +++ b/src/test/java/org/elasticsearch/script/javascript/JavaScriptScriptMultiThreadedTest.java @@ -20,7 +20,6 @@ package org.elasticsearch.script.javascript; import org.elasticsearch.common.settings.ImmutableSettings; -import org.elasticsearch.common.util.concurrent.jsr166y.ThreadLocalRandom; import org.elasticsearch.script.ExecutableScript; import org.elasticsearch.test.ElasticsearchTestCase; import org.junit.Test; @@ -29,6 +28,7 @@ import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicBoolean; import static org.hamcrest.Matchers.equalTo;