You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/06/03 07:44:35 UTC

[1/2] camel git commit: CAMEL-10012: Add a Path Home option in camel-elasticsearch configuration

Repository: camel
Updated Branches:
  refs/heads/master 488988402 -> ef0342adb


CAMEL-10012: Add a Path Home option in camel-elasticsearch configuration


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/08f315d3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/08f315d3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/08f315d3

Branch: refs/heads/master
Commit: 08f315d35d8c03d21aebee5635d1d095d4c704fd
Parents: 4889884
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Jun 3 09:35:11 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jun 3 09:35:11 2016 +0200

----------------------------------------------------------------------
 .../elasticsearch/ElasticsearchConfiguration.java | 13 +++++++++++++
 .../elasticsearch/ElasticsearchEndpoint.java      |  3 +++
 ...sticsearchGetSearchDeleteExistsUpdateTest.java | 18 +++++++++---------
 3 files changed, 25 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/08f315d3/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
index 68e2d65..6aef4f8 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java
@@ -51,6 +51,8 @@ public class ElasticsearchConfiguration {
     private int port = ElasticsearchConstants.DEFAULT_PORT;
     @UriParam(defaultValue = "true")
     private Boolean clientTransportSniff = true;
+    @UriParam(defaultValue = "/usr/share/elasticsearch")
+    private String pathHome = "/usr/share/elasticsearch";
 
     /**
      * Name of cluster or use local for local mode
@@ -178,4 +180,15 @@ public class ElasticsearchConfiguration {
     public void setTransportAddressesList(List<InetSocketTransportAddress> transportAddressesList) {
         this.transportAddressesList = transportAddressesList;
     }
+
+    /**
+     * The path.home property of ElasticSearch configuration. You need to provide a valid path, otherwise the default, /usr/share/elasticsearch, will be used.
+     */
+	public String getPathHome() {
+		return pathHome;
+	}
+
+	public void setPathHome(String pathHome) {
+		this.pathHome = pathHome;
+	}
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/08f315d3/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
index 6138019..fdbfbd7 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
@@ -82,6 +82,7 @@ public class ElasticsearchEndpoint extends DefaultEndpoint {
             } else {
                 LOG.info("Joining ElasticSearch cluster " + configuration.getClusterName());
             }
+            
             if (configuration.getIp() != null) {
                 this.client = TransportClient.builder().settings(getSettings()).build()
                     .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(configuration.getIp()), configuration.getPort()));
@@ -100,6 +101,7 @@ public class ElasticsearchEndpoint extends DefaultEndpoint {
                 if (!configuration.isLocal() && configuration.getClusterName() != null) {
                     builder.clusterName(configuration.getClusterName());
                 }
+                builder.getSettings().put("path.home", configuration.getPathHome());
                 node = builder.node();
                 client = node.client();
             }
@@ -113,6 +115,7 @@ public class ElasticsearchEndpoint extends DefaultEndpoint {
                 .put("node.client", true)
                 .put("client.transport.sniff", configuration.getClientTransportSniff())
                 .put("http.enabled", false)
+                .put("path.home", configuration.getPathHome())
                 .build();
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/08f315d3/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
index 40cf6d8..8ec0ce1 100644
--- a/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
+++ b/components/camel-elasticsearch/src/test/java/org/apache/camel/component/elasticsearch/ElasticsearchGetSearchDeleteExistsUpdateTest.java
@@ -308,15 +308,15 @@ public class ElasticsearchGetSearchDeleteExistsUpdateTest extends ElasticsearchB
         return new RouteBuilder() {
             @Override
             public void configure() {
-                from("direct:start").to("elasticsearch://local?operation=INDEX");
-                from("direct:index").to("elasticsearch://local?operation=INDEX&indexName=twitter&indexType=tweet");
-                from("direct:get").to("elasticsearch://local?operation=GET_BY_ID&indexName=twitter&indexType=tweet");
-                from("direct:multiget").to("elasticsearch://local?operation=MULTIGET&indexName=twitter&indexType=tweet");
-                from("direct:delete").to("elasticsearch://local?operation=DELETE&indexName=twitter&indexType=tweet");
-                from("direct:search").to("elasticsearch://local?operation=SEARCH&indexName=twitter&indexType=tweet");
-                from("direct:update").to("elasticsearch://local?operation=UPDATE&indexName=twitter&indexType=tweet");
-                from("direct:exists").to("elasticsearch://local?operation=EXISTS");
-                from("direct:multisearch").to("elasticsearch://local?operation=MULTISEARCH&indexName=test");
+                from("direct:start").to("elasticsearch://local?operation=INDEX&pathHome=target/home");
+                from("direct:index").to("elasticsearch://local?operation=INDEX&indexName=twitter&indexType=tweet&pathHome=target/home");
+                from("direct:get").to("elasticsearch://local?operation=GET_BY_ID&indexName=twitter&indexType=tweet&pathHome=target/home");
+                from("direct:multiget").to("elasticsearch://local?operation=MULTIGET&indexName=twitter&indexType=tweet&pathHome=target/home");
+                from("direct:delete").to("elasticsearch://local?operation=DELETE&indexName=twitter&indexType=tweet&pathHome=target/home");
+                from("direct:search").to("elasticsearch://local?operation=SEARCH&indexName=twitter&indexType=tweet&pathHome=target/home");
+                from("direct:update").to("elasticsearch://local?operation=UPDATE&indexName=twitter&indexType=tweet&pathHome=target/home");
+                from("direct:exists").to("elasticsearch://local?operation=EXISTS&pathHome=target/home");
+                from("direct:multisearch").to("elasticsearch://local?operation=MULTISEARCH&indexName=test&pathHome=target/home");
             }
         };
     }


[2/2] camel git commit: Components docs

Posted by ac...@apache.org.
Components docs


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ef0342ad
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ef0342ad
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ef0342ad

Branch: refs/heads/master
Commit: ef0342adbc3e01efedfcccd148ee01fdac4e58db
Parents: 08f315d
Author: Andrea Cosentino <an...@gmail.com>
Authored: Fri Jun 3 09:40:05 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Fri Jun 3 09:40:05 2016 +0200

----------------------------------------------------------------------
 .../src/main/docs/elasticsearch.adoc            | 60 +++++++++++---------
 1 file changed, 32 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ef0342ad/components/camel-elasticsearch/src/main/docs/elasticsearch.adoc
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/docs/elasticsearch.adoc b/components/camel-elasticsearch/src/main/docs/elasticsearch.adoc
index 4ee8ebf..8462bea 100644
--- a/components/camel-elasticsearch/src/main/docs/elasticsearch.adoc
+++ b/components/camel-elasticsearch/src/main/docs/elasticsearch.adoc
@@ -44,43 +44,47 @@ guide] for more details.
 Endpoint Options
 ^^^^^^^^^^^^^^^^
 
-The following options may be configured on the ElasticSearch endpoint.
-All are required to be set as either an endpoint URI parameter or as a
-header (headers override endpoint properties)
 
-[width="100%",cols="20%,80%",options="header",]
-|=======================================================================
-|name |description 
-
-|operation |required, indicates the operation to perform
-
-|indexName |the name of the index to act against
-
-|indexType |the type of the index to act against
+// component options: START
+The Elasticsearch component supports 1 options which are listed below.
 
-|ip |the TransportClient remote host ip to use *Camel 2.12*
 
-|port |the TransportClient remote port to use (defaults to 9300) *Camel 2.12*
 
-|transportAddresses |comma separated list with _ip:port_ formatted remote transport addresses
-to use *Camel 2.16*. Options _ip_ and _port_ must be left blank for _transportAddresses_ to
-be considered instead.
+{% raw %}
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| client | Client | To use an existing configured Elasticsearch client instead of creating a client per endpoint.
+|=======================================================================
+{% endraw %}
+// component options: END
 
-|consistencyLevel |the write consistency level to use with INDEX and BULK operations (can
-be any of ONE, QUORUM, ALL or DEFAULT) *Camel 2.16*
 
-|replicationType |the replication type to use with INDEX and BULK operations (can be any
-of SYNC, ASYNC or DEFAULT) *Camel 2.16* .*From version 2.17 replicationType option has been removed, since from
-elasticsearch 2.0.0 the async replication has been removed.*
 
-|parent |optionally used with INDEX operations for Elasticsearch
-https://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child.html[Parent-Child
-relationships] to specify the ID of the parent record *Camel 2.16.1 /
-2.17.0*
+// endpoint options: START
+The Elasticsearch component supports 13 endpoint options which are listed below:
 
-|clientTransportSniff |*From Camel 2.17* Define if the client is allowed to sniff the rest of
-the cluster
+{% raw %}
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
 |=======================================================================
+| Name | Group | Default | Java Type | Description
+| clusterName | producer |  | String | *Required* Name of cluster or use local for local mode
+| clientTransportSniff | producer | true | Boolean | Is the client allowed to sniff the rest of the cluster or not (default true). This setting map to the client.transport.sniff setting.
+| consistencyLevel | producer | DEFAULT | WriteConsistencyLevel | The write consistency level to use with INDEX and BULK operations (can be any of ONE QUORUM ALL or DEFAULT)
+| data | producer |  | Boolean | Is the node going to be allowed to allocate data (shards) to it or not. This setting map to the node.data setting.
+| indexName | producer |  | String | The name of the index to act against
+| indexType | producer |  | String | The type of the index to act against
+| ip | producer |  | String | The TransportClient remote host ip to use
+| operation | producer |  | String | What operation to perform
+| pathHome | producer | /usr/share/elasticsearch | String | The path.home property of ElasticSearch configuration. You need to provide a valid path otherwise the default /usr/share/elasticsearch will be used.
+| port | producer | 9300 | int | The TransportClient remote port to use (defaults to 9300)
+| transportAddresses | producer |  | String | Comma separated list with ip:port formatted remote transport addresses to use. The ip and port options must be left blank for transportAddresses to be considered instead.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+|=======================================================================
+{% endraw %}
+// endpoint options: END
+
 
 [[ElasticSearch-MessageOperations]]
 Message Operations