From a38038a0cadadb244f703455611e188d53ec1d6e Mon Sep 17 00:00:00 2001
From: Kohsuke Kawaguchi
Date: Mon, 30 Jun 2014 18:09:07 -0700
Subject: [PATCH 01/21] Update to elasticsearch 1.2.0
Closes #20.
Closes #21.
---
README.md | 9 +++---
pom.xml | 2 +-
.../wares/AbstractServletRestChannel.java | 29 ++++---------------
3 files changed, 11 insertions(+), 29 deletions(-)
diff --git a/README.md b/README.md
index 6366e91..3055ebb 100644
--- a/README.md
+++ b/README.md
@@ -8,22 +8,21 @@ but instead use the jar file in addition to elasticsearch itself in your web app
org.elasticsearch
elasticsearch-transport-wares
- 2.0.0.RC1
+ 2.2.0-SNAPSHOT
```
* For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/master).
+* For 1.2.x elasticsearch versions, look at [es-1.2 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.2).
* For 0.90.x elasticsearch versions, look at [es-0.90 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-0.90).
| Wares Transport Plugin | elasticsearch | Release date |
|-----------------------------|-----------------------|:------------:|
-| 2.0.0-SNAPSHOT | 1.0.0.RC1 -> master | XXXX-XX-XX |
-| 2.0.0.RC1 | 1.0.0.RC1 -> master | 2014-10-15 |
+| 2.2.0-SNAPSHOT | 1.2.1 -> 1.2 | XXXX-XX-XX |
Please read documentation relative to the version you are using:
-* [2.0.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/master/README.md)
-* [2.0.0.RC1](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/v2.2.0.RC1/README.md)
+* [2.2.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/es-1.2/README.md)
Tomcat configuration (CORS filter)
----------------------------------
diff --git a/pom.xml b/pom.xml
index c19d208..a182b73 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
- 1.0.0.RC1
+ 1.2.1
diff --git a/src/main/java/org/elasticsearch/wares/AbstractServletRestChannel.java b/src/main/java/org/elasticsearch/wares/AbstractServletRestChannel.java
index 1b43100..75a26f5 100644
--- a/src/main/java/org/elasticsearch/wares/AbstractServletRestChannel.java
+++ b/src/main/java/org/elasticsearch/wares/AbstractServletRestChannel.java
@@ -31,12 +31,10 @@
* Base implementation of RestChannel responsible for mapping a
* RestResponse to an HttpServletResponse.
*/
-abstract class AbstractServletRestChannel implements RestChannel {
+abstract class AbstractServletRestChannel extends RestChannel {
- final RestRequest restRequest;
-
- protected AbstractServletRestChannel(RestRequest restRequest) {
- this.restRequest = restRequest;
+ protected AbstractServletRestChannel(RestRequest request) {
+ super(request);
}
@Override
@@ -44,29 +42,14 @@ public void sendResponse(RestResponse response) {
HttpServletResponse resp = getServletResponse();
resp.setStatus(response.status().getStatus());
resp.setContentType(response.contentType());
- String opaque = restRequest.header("X-Opaque-Id");
+ String opaque = request.header("X-Opaque-Id");
if (opaque != null) {
resp.addHeader("X-Opaque-Id", opaque);
}
try {
- int contentLength = response.contentLength();
- if (response.prefixContent() != null) {
- contentLength += response.prefixContentLength();
- }
- if (response.suffixContent() != null) {
- contentLength += response.suffixContentLength();
- }
-
- resp.setContentLength(contentLength);
-
+ resp.setContentLength(response.content().length());
ServletOutputStream out = resp.getOutputStream();
- if (response.prefixContent() != null) {
- out.write(response.prefixContent(), 0, response.prefixContentLength());
- }
- out.write(response.content(), 0, response.contentLength());
- if (response.suffixContent() != null) {
- out.write(response.suffixContent(), 0, response.suffixContentLength());
- }
+ response.content().writeTo(out);
out.close();
} catch (IOException e) {
errorOccured(e);
From 65ec540e0d748917513f29bc76764cfe0dc4903d Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Wed, 2 Jul 2014 19:25:03 +0200
Subject: [PATCH 02/21] Update to elasticsearch 1.2.0
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a182b73..449fca5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.elasticsearch
elasticsearch-transport-wares
- 2.0.0-SNAPSHOT
+ 2.2.0-SNAPSHOT
jar
Elasticsearch Servlet Transport plugin
The wares transport plugin allows to use the REST interface over servlets.
From 5e10b272dc3d50211b9e23c4e06f1b09b1846022 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Wed, 2 Jul 2014 19:24:30 +0200
Subject: [PATCH 03/21] Update to elasticsearch 1.3.0
Closes #23.
---
README.md | 5 +++--
pom.xml | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 3055ebb..9fd594e 100644
--- a/README.md
+++ b/README.md
@@ -13,16 +13,17 @@ but instead use the jar file in addition to elasticsearch itself in your web app
```
* For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/master).
+* For 1.3.x elasticsearch versions, look at [es-1.3 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.3).
* For 1.2.x elasticsearch versions, look at [es-1.2 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.2).
* For 0.90.x elasticsearch versions, look at [es-0.90 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-0.90).
| Wares Transport Plugin | elasticsearch | Release date |
|-----------------------------|-----------------------|:------------:|
-| 2.2.0-SNAPSHOT | 1.2.1 -> 1.2 | XXXX-XX-XX |
+| 2.3.0-SNAPSHOT | 1.3 | XXXX-XX-XX |
Please read documentation relative to the version you are using:
-* [2.2.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/es-1.2/README.md)
+* [2.3.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/es-1.3/README.md)
Tomcat configuration (CORS filter)
----------------------------------
diff --git a/pom.xml b/pom.xml
index 449fca5..46e79c8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.elasticsearch
elasticsearch-transport-wares
- 2.2.0-SNAPSHOT
+ 2.3.0-SNAPSHOT
jar
Elasticsearch Servlet Transport plugin
The wares transport plugin allows to use the REST interface over servlets.
@@ -33,7 +33,7 @@
- 1.2.1
+ 1.3.0-SNAPSHOT
From 0828ce93d47aa350dadf06ba3da559744b58a05f Mon Sep 17 00:00:00 2001
From: tstibbs
Date: Wed, 2 Jul 2014 19:53:38 +0200
Subject: [PATCH 04/21] NodeServlet should use an elasticsearch node created
elsewhere in the webapp
My code already creates an elasticsearch node using NodeBuilder.
I'd like NodeServlet to be able to use the node I've already created, rather than create a new one.
Closes #17
(cherry picked from commit 79934d8)
---
README.md | 8 ++
.../org/elasticsearch/wares/NodeServlet.java | 91 +++++++++++--------
2 files changed, 59 insertions(+), 40 deletions(-)
diff --git a/README.md b/README.md
index 9fd594e..0891896 100644
--- a/README.md
+++ b/README.md
@@ -41,6 +41,14 @@ The [Tomcat configuration](http://tomcat.apache.org/tomcat-7.0-doc/config/filter
```
+Node resource
+-------------
+
+The node is registered as a servlet context attribute under `elasticsearchNode` so it is easily accessible from other web resources if needed.
+
+You can also preregister your own node using `elasticsearchNode` servlet context attribute. It will be used by the NodeServlet.
+
+
License
-------
diff --git a/src/main/java/org/elasticsearch/wares/NodeServlet.java b/src/main/java/org/elasticsearch/wares/NodeServlet.java
index a1b4b66..1d3c264 100644
--- a/src/main/java/org/elasticsearch/wares/NodeServlet.java
+++ b/src/main/java/org/elasticsearch/wares/NodeServlet.java
@@ -56,51 +56,62 @@ public class NodeServlet extends HttpServlet {
@Override
public void init() throws ServletException {
- getServletContext().log("Initializing elasticsearch Node '" + getServletName() + "'");
- ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
-
- InputStream resourceAsStream = getServletContext().getResourceAsStream("/WEB-INF/elasticsearch.json");
- if (resourceAsStream != null) {
- settings.loadFromStream("/WEB-INF/elasticsearch.json", resourceAsStream);
- try {
- resourceAsStream.close();
- } catch (IOException e) {
- // ignore
+ final Object nodeAttribute = getServletContext().getAttribute(NODE_KEY);
+ if (nodeAttribute == null || !(nodeAttribute instanceof InternalNode)) {
+ if (nodeAttribute != null) {
+ getServletContext().log(
+ "Warning: overwriting attribute with key \"" + NODE_KEY + "\" and type \""
+ + nodeAttribute.getClass().getName() + "\".");
}
- }
-
- resourceAsStream = getServletContext().getResourceAsStream("/WEB-INF/elasticsearch.yml");
- if (resourceAsStream != null) {
- settings.loadFromStream("/WEB-INF/elasticsearch.yml", resourceAsStream);
- try {
- resourceAsStream.close();
- } catch (IOException e) {
- // ignore
+ getServletContext().log("Initializing elasticsearch Node '" + getServletName() + "'");
+ ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
+
+ InputStream resourceAsStream = getServletContext().getResourceAsStream("/WEB-INF/elasticsearch.json");
+ if (resourceAsStream != null) {
+ settings.loadFromStream("/WEB-INF/elasticsearch.json", resourceAsStream);
+ try {
+ resourceAsStream.close();
+ } catch (IOException e) {
+ // ignore
+ }
}
- }
-
- Enumeration enumeration = getServletContext().getAttributeNames();
-
- while (enumeration.hasMoreElements()) {
- String key = enumeration.nextElement();
-
- if (key.startsWith(NAME_PREFIX)) {
- Object attribute = getServletContext().getAttribute(key);
-
- if (attribute != null)
- attribute = attribute.toString();
-
- settings.put(key.substring(NAME_PREFIX.length()), (String) attribute);
+
+ resourceAsStream = getServletContext().getResourceAsStream("/WEB-INF/elasticsearch.yml");
+ if (resourceAsStream != null) {
+ settings.loadFromStream("/WEB-INF/elasticsearch.yml", resourceAsStream);
+ try {
+ resourceAsStream.close();
+ } catch (IOException e) {
+ // ignore
+ }
}
+
+ Enumeration enumeration = getServletContext().getAttributeNames();
+
+ while (enumeration.hasMoreElements()) {
+ String key = enumeration.nextElement();
+
+ if (key.startsWith(NAME_PREFIX)) {
+ Object attribute = getServletContext().getAttribute(key);
+
+ if (attribute != null)
+ attribute = attribute.toString();
+
+ settings.put(key.substring(NAME_PREFIX.length()), (String) attribute);
+ }
+ }
+
+ if (settings.get("http.enabled") == null) {
+ settings.put("http.enabled", false);
+ }
+
+ node = NodeBuilder.nodeBuilder().settings(settings).node();
+ getServletContext().setAttribute(NODE_KEY, node);
+ } else {
+ getServletContext().log("Using pre-initialized elasticsearch Node '" + getServletName() + "'");
+ this.node = (InternalNode) nodeAttribute;
}
-
- if (settings.get("http.enabled") == null) {
- settings.put("http.enabled", false);
- }
-
- node = NodeBuilder.nodeBuilder().settings(settings).node();
restController = ((InternalNode) node).injector().getInstance(RestController.class);
- getServletContext().setAttribute(NODE_KEY, node);
}
@Override
From a5ece71723c8a090c5797c583ba00192c053d779 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Tue, 29 Jul 2014 09:13:30 +0200
Subject: [PATCH 05/21] Update to elasticsearch 1.3.1
Related to #23.
---
README.md | 2 +-
pom.xml | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 0891896..2996d63 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ but instead use the jar file in addition to elasticsearch itself in your web app
org.elasticsearch
elasticsearch-transport-wares
- 2.2.0-SNAPSHOT
+ 2.3.0-SNAPSHOT
```
diff --git a/pom.xml b/pom.xml
index 46e79c8..fcbf3e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
- 1.3.0-SNAPSHOT
+ 1.3.1
@@ -67,8 +67,8 @@
maven-compiler-plugin
2.3.2
- 1.6
- 1.6
+ 1.7
+ 1.7
From 6e35c138d522fbc64de9d5b8979fbe00d02b1931 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Tue, 29 Jul 2014 09:15:17 +0200
Subject: [PATCH 06/21] Update to elasticsearch 1.4.0
Closes #25.
---
README.md | 7 ++++---
pom.xml | 4 ++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 2996d63..e5c13de 100644
--- a/README.md
+++ b/README.md
@@ -8,22 +8,23 @@ but instead use the jar file in addition to elasticsearch itself in your web app
org.elasticsearch
elasticsearch-transport-wares
- 2.3.0-SNAPSHOT
+ 2.4.0-SNAPSHOT
```
* For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/master).
+* For 1.x.x elasticsearch versions, look at [es-1.x branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.x).
* For 1.3.x elasticsearch versions, look at [es-1.3 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.3).
* For 1.2.x elasticsearch versions, look at [es-1.2 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.2).
* For 0.90.x elasticsearch versions, look at [es-0.90 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-0.90).
| Wares Transport Plugin | elasticsearch | Release date |
|-----------------------------|-----------------------|:------------:|
-| 2.3.0-SNAPSHOT | 1.3 | XXXX-XX-XX |
+| 2.4.0-SNAPSHOT | 1.x | XXXX-XX-XX |
Please read documentation relative to the version you are using:
-* [2.3.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/es-1.3/README.md)
+* [2.4.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/es-1.x/README.md)
Tomcat configuration (CORS filter)
----------------------------------
diff --git a/pom.xml b/pom.xml
index fcbf3e6..3bb07a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.elasticsearch
elasticsearch-transport-wares
- 2.3.0-SNAPSHOT
+ 2.4.0-SNAPSHOT
jar
Elasticsearch Servlet Transport plugin
The wares transport plugin allows to use the REST interface over servlets.
@@ -33,7 +33,7 @@
- 1.3.1
+ 1.4.0-SNAPSHOT
From 35106629d939d1e2a1ddc2cd6310d7009a6ab877 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Mon, 15 Sep 2014 14:40:10 +0200
Subject: [PATCH 07/21] Create branch es-1.4 for elasticsearch 1.4.0
---
README.md | 5 +++--
pom.xml | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index e5c13de..b6f507a 100644
--- a/README.md
+++ b/README.md
@@ -14,17 +14,18 @@ but instead use the jar file in addition to elasticsearch itself in your web app
* For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/master).
* For 1.x.x elasticsearch versions, look at [es-1.x branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.x).
+* For 1.4.x elasticsearch versions, look at [es-1.4 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.4).
* For 1.3.x elasticsearch versions, look at [es-1.3 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.3).
* For 1.2.x elasticsearch versions, look at [es-1.2 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.2).
* For 0.90.x elasticsearch versions, look at [es-0.90 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-0.90).
| Wares Transport Plugin | elasticsearch | Release date |
|-----------------------------|-----------------------|:------------:|
-| 2.4.0-SNAPSHOT | 1.x | XXXX-XX-XX |
+| 2.5.0-SNAPSHOT | 1.x | XXXX-XX-XX |
Please read documentation relative to the version you are using:
-* [2.4.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/es-1.x/README.md)
+* [2.5.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/es-1.x/README.md)
Tomcat configuration (CORS filter)
----------------------------------
diff --git a/pom.xml b/pom.xml
index 3bb07a8..33f633f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.elasticsearch
elasticsearch-transport-wares
- 2.4.0-SNAPSHOT
+ 2.5.0-SNAPSHOT
jar
Elasticsearch Servlet Transport plugin
The wares transport plugin allows to use the REST interface over servlets.
@@ -33,7 +33,7 @@
- 1.4.0-SNAPSHOT
+ 1.5.0-SNAPSHOT
From 608a3c0ffabec9baee2c63cd16f972e086b949ef Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Tue, 16 Dec 2014 16:10:32 +0100
Subject: [PATCH 08/21] Depend on elasticsearch-parent
To simplify plugins maintenance and provide more value in the future, we are starting to build an `elasticsearch-parent` project.
This commit is the first step for this plugin to depend on this new `pom` maven project.
(cherry picked from commit bf789b4)
---
pom.xml | 49 ++++++++++---------------------------------------
1 file changed, 10 insertions(+), 39 deletions(-)
diff --git a/pom.xml b/pom.xml
index 33f633f..789cde0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,6 +4,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
+
+ org.elasticsearch
+ elasticsearch-parent
+ 1.5.0-SNAPSHOT
+
+
org.elasticsearch
elasticsearch-transport-wares
2.5.0-SNAPSHOT
@@ -21,29 +27,21 @@
scm:git:git@github.com:elasticsearch/elasticsearch-transport-wares.git
- scm:git:git@github.com:elasticsearch/elasticsearch-transport-wares.git
-
+ scm:git:git@github.com:elasticsearch/elasticsearch-transport-wares.git
http://github.com/elasticsearch/elasticsearch-transport-wares
-
- org.sonatype.oss
- oss-parent
- 7
-
-
- 1.5.0-SNAPSHOT
+
org.elasticsearch
elasticsearch
- ${elasticsearch.version}
- compile
+
javax.servlet
javax.servlet-api
@@ -54,10 +52,7 @@
log4j
log4j
- 1.2.16
- runtime
-
@@ -65,38 +60,14 @@
org.apache.maven.plugins
maven-compiler-plugin
- 2.3.2
-
- 1.7
- 1.7
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.11
-
-
- **/*Tests.java
-
-
org.apache.maven.plugins
maven-source-plugin
- 2.1.2
-
-
- attach-sources
-
- jar
-
-
-
+ org.apache.maven.plugins
maven-assembly-plugin
- 2.3
false
${project.build.directory}/releases/
From 2e2e96ac74dcf855fc3aebfafe371b8f72c5efbb Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Fri, 2 Jan 2015 19:21:34 +0100
Subject: [PATCH 09/21] Add sonatype snapshot repository
(cherry picked from commit d7e1343)
---
pom.xml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/pom.xml b/pom.xml
index 789cde0..f672310 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,4 +86,12 @@
+
+
+
+ oss-snapshots
+ Sonatype OSS Snapshots
+ https://oss.sonatype.org/content/repositories/snapshots/
+
+
From 0c891f7fb549a59a397023c2ec68633c8b736947 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Mon, 16 Mar 2015 17:08:34 -0700
Subject: [PATCH 10/21] create `es-1.5` branch
---
README.md | 23 +++--------------------
pom.xml | 4 ++--
2 files changed, 5 insertions(+), 22 deletions(-)
diff --git a/README.md b/README.md
index b6f507a..9daf137 100644
--- a/README.md
+++ b/README.md
@@ -4,28 +4,11 @@ Servlet Transport for Elasticsearch
The wares transport plugin allows to use the REST interface over servlets. You don't really install this plugin,
but instead use the jar file in addition to elasticsearch itself in your web app using the maven repo:
-```xml
-
- org.elasticsearch
- elasticsearch-transport-wares
- 2.4.0-SNAPSHOT
-
-```
-
-* For master elasticsearch versions, look at [master branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/master).
-* For 1.x.x elasticsearch versions, look at [es-1.x branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.x).
-* For 1.4.x elasticsearch versions, look at [es-1.4 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.4).
-* For 1.3.x elasticsearch versions, look at [es-1.3 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.3).
-* For 1.2.x elasticsearch versions, look at [es-1.2 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-1.2).
-* For 0.90.x elasticsearch versions, look at [es-0.90 branch](https://github.com/elasticsearch/elasticsearch-transport-wares/tree/es-0.90).
-
-| Wares Transport Plugin | elasticsearch | Release date |
-|-----------------------------|-----------------------|:------------:|
-| 2.5.0-SNAPSHOT | 1.x | XXXX-XX-XX |
+## Version 2.6.0-SNAPSHOT for Elasticsearch: 1.6
-Please read documentation relative to the version you are using:
+If you are looking for another version documentation, please refer to the
+[compatibility matrix](http://github.com/elastic/elasticsearch-transport-wares).
-* [2.5.0-SNAPSHOT](https://github.com/elasticsearch/elasticsearch-transport-wares/blob/es-1.x/README.md)
Tomcat configuration (CORS filter)
----------------------------------
diff --git a/pom.xml b/pom.xml
index f672310..4fcd58d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,12 +7,12 @@
org.elasticsearch
elasticsearch-parent
- 1.5.0-SNAPSHOT
+ 1.6.0-SNAPSHOT
org.elasticsearch
elasticsearch-transport-wares
- 2.5.0-SNAPSHOT
+ 2.6.0-SNAPSHOT
jar
Elasticsearch Servlet Transport plugin
The wares transport plugin allows to use the REST interface over servlets.
From 6e3beb3c4020c0d965c346bab1c2fa2b1b29d347 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Sun, 29 Mar 2015 08:25:00 +0200
Subject: [PATCH 11/21] Move parent after artifact coordinates
---
pom.xml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index 4fcd58d..120144d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,12 +4,6 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
-
- org.elasticsearch
- elasticsearch-parent
- 1.6.0-SNAPSHOT
-
-
org.elasticsearch
elasticsearch-transport-wares
2.6.0-SNAPSHOT
@@ -31,6 +25,12 @@
http://github.com/elasticsearch/elasticsearch-transport-wares
+
+ org.elasticsearch
+ elasticsearch-parent
+ 1.6.0-SNAPSHOT
+
+
From 7dc3ce1178f4fb079f18aa5af341424edb6f303d Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Sun, 29 Mar 2015 08:25:37 +0200
Subject: [PATCH 12/21] Move to elastic owner
---
dev-tools/build_release.py | 2 +-
pom.xml | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dev-tools/build_release.py b/dev-tools/build_release.py
index 27a4652..7493d3a 100755
--- a/dev-tools/build_release.py
+++ b/dev-tools/build_release.py
@@ -380,7 +380,7 @@ def get_github_repository(reponame,
else:
g = github3.GitHub()
- return g.repository("elasticsearch", reponame)
+ return g.repository("elastic", reponame)
# Check if there are some remaining open issues and fails
def check_opened_issues(version, repository, reponame):
diff --git a/pom.xml b/pom.xml
index 120144d..a452eb6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
jar
Elasticsearch Servlet Transport plugin
The wares transport plugin allows to use the REST interface over servlets.
- https://github.com/elasticsearch/elasticsearch-transport-wares/
+ https://github.com/elastic/elasticsearch-transport-wares/
2009
@@ -20,9 +20,9 @@
- scm:git:git@github.com:elasticsearch/elasticsearch-transport-wares.git
- scm:git:git@github.com:elasticsearch/elasticsearch-transport-wares.git
- http://github.com/elasticsearch/elasticsearch-transport-wares
+ scm:git:git@github.com:elastic/elasticsearch-transport-wares.git
+ scm:git:git@github.com:elastic/elasticsearch-transport-wares.git
+ http://github.com/elastic/elasticsearch-transport-wares
From 7bb6c8a827af51537aabf05eae0b832c17849de5 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Sun, 29 Mar 2015 08:28:32 +0200
Subject: [PATCH 13/21] elasticsearch-parent compatibility
Projects which are depending on `elasticsearch-parent` pom don't have anymore an `elasticsearch.version` property.
We need to deal with that and check that we don't release a version which depends on a `SNAPSHOT` parent.
---
dev-tools/build_release.py | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/dev-tools/build_release.py b/dev-tools/build_release.py
index 7493d3a..9174247 100755
--- a/dev-tools/build_release.py
+++ b/dev-tools/build_release.py
@@ -289,14 +289,27 @@ def find_release_version(src_branch):
return match.group(1)
raise RuntimeError('Could not find release version in branch %s' % src_branch)
-# extract a value from pom.xml
-def find_from_pom(tag):
+# extract a value from pom.xml after a given line
+def find_from_pom(tag, first_line=None):
with open(POM_FILE, encoding='utf-8') as file:
+ previous_line_matched = False
+ if first_line is None:
+ previous_line_matched = True
for line in file:
- match = re.search(r'<%s>(.+)%s>' % (tag, tag), line)
- if match:
- return match.group(1)
- raise RuntimeError('Could not find <%s> in pom.xml file' % (tag))
+ if previous_line_matched:
+ match = re.search(r'<%s>(.+)%s>' % (tag, tag), line)
+ if match:
+ return match.group(1)
+
+ if first_line is not None:
+ match = re.search(r'%s' % first_line, line)
+ if match:
+ previous_line_matched = True
+
+ if first_line is not None:
+ raise RuntimeError('Could not find %s in pom.xml file after %s' % (tag, first_line))
+ else:
+ raise RuntimeError('Could not find %s in pom.xml file' % tag)
def get_artifacts(artifact_id, release):
artifact_path = ROOT_DIR + 'target/releases/%s-%s.zip' % (artifact_id, release)
@@ -626,7 +639,14 @@ def check_email_settings():
artifact_name = find_from_pom('name')
artifact_description = find_from_pom('description')
project_url = find_from_pom('url')
- elasticsearch_version = find_from_pom('elasticsearch.version')
+
+ try:
+ elasticsearch_version = find_from_pom('elasticsearch.version')
+ except RuntimeError:
+ # With projects using elasticsearch-parent project, we need to consider elasticsearch version
+ # to be after elasticsearch-parent
+ elasticsearch_version = find_from_pom('version', 'elasticsearch-parent')
+
print(' Artifact Id: [%s]' % artifact_id)
print(' Release version: [%s]' % release_version)
print(' Elasticsearch: [%s]' % elasticsearch_version)
From 849a4578084abdeab48e1a306064e0677041d839 Mon Sep 17 00:00:00 2001
From: tstibbs
Date: Fri, 27 Mar 2015 12:09:31 +0100
Subject: [PATCH 14/21] Fix change in RestChannel
`RestChannel` now has a parameter `detailedErrorsEnabled` which wasn't being passed in, causing a `NoSuchMethodError` if you try to run it with elasticsearch 1.5 (and a compile error if you tried to compile it).
See also https://github.com/elastic/elasticsearch/pull/10117
Closes #30.
(cherry picked from commit 91445ef)
---
.../wares/AbstractServletRestChannel.java | 4 ++--
.../org/elasticsearch/wares/AsyncNodeServlet.java | 7 ++++---
.../java/org/elasticsearch/wares/NodeServlet.java | 12 ++++++++----
3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/elasticsearch/wares/AbstractServletRestChannel.java b/src/main/java/org/elasticsearch/wares/AbstractServletRestChannel.java
index 75a26f5..f421764 100644
--- a/src/main/java/org/elasticsearch/wares/AbstractServletRestChannel.java
+++ b/src/main/java/org/elasticsearch/wares/AbstractServletRestChannel.java
@@ -33,8 +33,8 @@
*/
abstract class AbstractServletRestChannel extends RestChannel {
- protected AbstractServletRestChannel(RestRequest request) {
- super(request);
+ protected AbstractServletRestChannel(RestRequest request, boolean detailedErrorsEnabled) {
+ super(request, detailedErrorsEnabled);
}
@Override
diff --git a/src/main/java/org/elasticsearch/wares/AsyncNodeServlet.java b/src/main/java/org/elasticsearch/wares/AsyncNodeServlet.java
index 7a5ccf4..b777983 100644
--- a/src/main/java/org/elasticsearch/wares/AsyncNodeServlet.java
+++ b/src/main/java/org/elasticsearch/wares/AsyncNodeServlet.java
@@ -48,7 +48,8 @@ public void destroy() {
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
final AsyncContext asyncContext = req.startAsync();
ServletRestRequest request = new ServletRestRequest(req);
- AsyncServletRestChannel channel = new AsyncServletRestChannel(request, asyncContext);
+ AsyncServletRestChannel channel = new AsyncServletRestChannel(request, asyncContext,
+ detailedErrorsEnabled);
restController.dispatchRequest(request, channel);
}
@@ -56,8 +57,8 @@ static class AsyncServletRestChannel extends AbstractServletRestChannel {
final AsyncContext asyncContext;
- AsyncServletRestChannel(RestRequest restRequest, AsyncContext asyncContext) {
- super(restRequest);
+ AsyncServletRestChannel(RestRequest restRequest, AsyncContext asyncContext, boolean detailedErrorsEnabled) {
+ super(restRequest, detailedErrorsEnabled);
this.asyncContext = asyncContext;
}
diff --git a/src/main/java/org/elasticsearch/wares/NodeServlet.java b/src/main/java/org/elasticsearch/wares/NodeServlet.java
index 1d3c264..5b51639 100644
--- a/src/main/java/org/elasticsearch/wares/NodeServlet.java
+++ b/src/main/java/org/elasticsearch/wares/NodeServlet.java
@@ -20,6 +20,7 @@
package org.elasticsearch.wares;
import org.elasticsearch.common.settings.ImmutableSettings;
+import org.elasticsearch.http.netty.NettyHttpServerTransport;
import org.elasticsearch.node.Node;
import org.elasticsearch.node.NodeBuilder;
import org.elasticsearch.node.internal.InternalNode;
@@ -53,6 +54,8 @@ public class NodeServlet extends HttpServlet {
protected Node node;
protected RestController restController;
+
+ protected boolean detailedErrorsEnabled;
@Override
public void init() throws ServletException {
@@ -111,7 +114,8 @@ public void init() throws ServletException {
getServletContext().log("Using pre-initialized elasticsearch Node '" + getServletName() + "'");
this.node = (InternalNode) nodeAttribute;
}
- restController = ((InternalNode) node).injector().getInstance(RestController.class);
+ restController = ((InternalNode) node).injector().getInstance(RestController.class);
+ detailedErrorsEnabled = this.node.settings().getAsBoolean(NettyHttpServerTransport.SETTING_HTTP_DETAILED_ERRORS_ENABLED, true);
}
@Override
@@ -125,7 +129,7 @@ public void destroy() {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
ServletRestRequest request = new ServletRestRequest(req);
- ServletRestChannel channel = new ServletRestChannel(request, resp);
+ ServletRestChannel channel = new ServletRestChannel(request, resp, this.detailedErrorsEnabled);
try {
restController.dispatchRequest(request, channel);
channel.latch.await();
@@ -145,8 +149,8 @@ static class ServletRestChannel extends AbstractServletRestChannel {
IOException sendFailure;
- ServletRestChannel(RestRequest restRequest, HttpServletResponse resp) {
- super(restRequest);
+ ServletRestChannel(RestRequest restRequest, HttpServletResponse resp, boolean detailedErrorsEnabled) {
+ super(restRequest, detailedErrorsEnabled);
this.resp = resp;
this.latch = new CountDownLatch(1);
}
From 08610d78ebf43c74d7960e8489acbb62535f95d3 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Thu, 11 Jun 2015 10:12:18 +0200
Subject: [PATCH 15/21] Remove RestRequest#contentUnsafe()
From 1.6, `RestRequest#contentUnsafe()` has been removed.
Closes #33.
---
.../java/org/elasticsearch/wares/ServletRestRequest.java | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/main/java/org/elasticsearch/wares/ServletRestRequest.java b/src/main/java/org/elasticsearch/wares/ServletRestRequest.java
index abd1248..40ac7ac 100644
--- a/src/main/java/org/elasticsearch/wares/ServletRestRequest.java
+++ b/src/main/java/org/elasticsearch/wares/ServletRestRequest.java
@@ -81,11 +81,6 @@ public boolean hasContent() {
return content.length > 0;
}
- @Override
- public boolean contentUnsafe() {
- return false;
- }
-
@Override
public BytesReference content() {
return new BytesArray(content);
From 16abc27543490ee98c92207580a248729aa79db8 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Thu, 11 Jun 2015 10:12:42 +0200
Subject: [PATCH 16/21] Update to elasticsearch 1.6.0
Closes #32.
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a452eb6..fbfe7e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
org.elasticsearch
elasticsearch-parent
- 1.6.0-SNAPSHOT
+ 1.6.0
From 14547f6328fa11f229498919ba74c25a9198e824 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Thu, 11 Jun 2015 10:13:25 +0200
Subject: [PATCH 17/21] Update to elasticsearch 1.7.0-SNAPSHOT
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index fbfe7e2..b9397d5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.elasticsearch
elasticsearch-transport-wares
- 2.6.0-SNAPSHOT
+ 2.7.0-SNAPSHOT
jar
Elasticsearch Servlet Transport plugin
The wares transport plugin allows to use the REST interface over servlets.
@@ -28,7 +28,7 @@
org.elasticsearch
elasticsearch-parent
- 1.6.0
+ 1.7.0-SNAPSHOT
From 33814e074545c708911a5b5d28469d32e3fa77e7 Mon Sep 17 00:00:00 2001
From: David Pilato
Date: Thu, 11 Jun 2015 10:20:48 +0200
Subject: [PATCH 18/21] Move to discourse
---
dev-tools/build_release.py | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/dev-tools/build_release.py b/dev-tools/build_release.py
index 9174247..9271886 100755
--- a/dev-tools/build_release.py
+++ b/dev-tools/build_release.py
@@ -63,7 +63,7 @@
(see https://github.com/settings/applications#personal-access-tokens) - Optional: default to no authentication
- SMTP_HOST - Optional: default to localhost
- MAIL_SENDER - Optional: default to 'david@pilato.fr': must be authorized to send emails to elasticsearch mailing list
- - MAIL_TO - Optional: default to 'elasticsearch@googlegroups.com'
+ - MAIL_TO - Optional: default to 'discuss+announcements@elastic.co'
"""
env = os.environ
@@ -399,7 +399,7 @@ def get_github_repository(reponame,
def check_opened_issues(version, repository, reponame):
opened_issues = [i for i in repository.iter_issues(state='open', labels='%s' % version)]
if len(opened_issues)>0:
- raise NameError('Some issues [%s] are still opened. Check https://github.com/elasticsearch/%s/issues?labels=%s&state=open'
+ raise NameError('Some issues [%s] are still opened. Check https://github.com/elastic/%s/issues?labels=%s&state=open'
% (len(opened_issues), reponame, version))
# List issues from github: can be done anonymously if you don't
@@ -466,8 +466,7 @@ def prepare_email(artifact_id, release_version, repository,
%(issues_new)s
%(issues_doc)s
-Issues, Pull requests, Feature requests are warmly welcome on %(artifact_id)s project repository: %(project_url)s
-For questions or comments around this plugin, feel free to use elasticsearch mailing list: https://groups.google.com/forum/#!forum/elasticsearch
+For questions or comments around this plugin, feel free to use elasticsearch mailing list: https://discuss.elastic.co/c/elasticsearch
Enjoy,
@@ -499,14 +498,12 @@ def prepare_email(artifact_id, release_version, repository,
%(issues_new)s
%(issues_doc)s
-Issues, Pull requests, Feature requests are warmly welcome on
-%(artifact_id)s project repository!
For questions or comments around this plugin, feel free to use elasticsearch
-mailing list!
+mailing list!
Enjoy,
-- The Elasticsearch team
+- The Elastic team