Make ES Cluster Name configurable in Maven Setting
Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/b4fed6ad Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/b4fed6ad Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/b4fed6ad Branch: refs/heads/feature-UNOMI-5-KARAF4 Commit: b4fed6ad054d587898016ac8f0585963bdcfdc02 Parents: 8231d56 Author: Abdelkader Midani <[email protected]> Authored: Thu Jun 15 13:41:43 2017 +0200 Committer: Abdelkader Midani <[email protected]> Committed: Thu Jun 15 13:41:43 2017 +0200 ---------------------------------------------------------------------- persistence-elasticsearch/core/pom.xml | 24 ++++++++++- ...g.apache.unomi.persistence.elasticsearch.cfg | 45 ++++++++++++++++++++ ...g.apache.unomi.persistence.elasticsearch.cfg | 45 -------------------- 3 files changed, 68 insertions(+), 46 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b4fed6ad/persistence-elasticsearch/core/pom.xml ---------------------------------------------------------------------- diff --git a/persistence-elasticsearch/core/pom.xml b/persistence-elasticsearch/core/pom.xml index eb169ef..a98cde6 100644 --- a/persistence-elasticsearch/core/pom.xml +++ b/persistence-elasticsearch/core/pom.xml @@ -146,6 +146,12 @@ </dependencies> <build> + <resources> + <resource> + <directory>src/main/resources-filtered</directory> + <filtering>true</filtering> + </resource> + </resources> <plugins> <plugin> <groupId>org.apache.felix</groupId> @@ -241,7 +247,7 @@ <artifacts> <artifact> <file> - src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg + ${project.build.outputDirectory}/org.apache.unomi.persistence.elasticsearch.cfg </file> <type>cfg</type> <classifier>elasticsearchcfg</classifier> @@ -255,4 +261,20 @@ </build> + <profiles> + <profile> + <id>esClusterName</id> + <activation> + <activeByDefault>true</activeByDefault> + <property> + <name>!esClusterName</name> + </property> + </activation> + + <properties> + <esClusterName>contextElasticSearch</esClusterName> + </properties> + </profile> + </profiles> + </project> http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b4fed6ad/persistence-elasticsearch/core/src/main/resources-filtered/org.apache.unomi.persistence.elasticsearch.cfg ---------------------------------------------------------------------- diff --git a/persistence-elasticsearch/core/src/main/resources-filtered/org.apache.unomi.persistence.elasticsearch.cfg b/persistence-elasticsearch/core/src/main/resources-filtered/org.apache.unomi.persistence.elasticsearch.cfg new file mode 100644 index 0000000..28bf705 --- /dev/null +++ b/persistence-elasticsearch/core/src/main/resources-filtered/org.apache.unomi.persistence.elasticsearch.cfg @@ -0,0 +1,45 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +cluster.name=${esClusterName} +# The elasticSearchAddresses may be a comma seperated list of host names and ports such as +# hostA:9300,hostB:9300 +# Note: the port number must be repeated for each host. +elasticSearchAddresses=localhost:9300 +index.name=context +monthlyIndex.numberOfShards=3 +monthlyIndex.numberOfReplicas=0 +numberOfShards=5 +numberOfReplicas=0 +defaultQueryLimit=10 + +# The following settings control the behavior of the BulkProcessor API. You can find more information about these +# settings and their behavior here : https://www.elastic.co/guide/en/elasticsearch/client/java-api/2.4/java-docs-bulk-processor.html +# The values used here are the default values of the API +bulkProcessor.name=unomi-bulk +bulkProcessor.concurrentRequests=1 +bulkProcessor.bulkActions=1000 +bulkProcessor.bulkSize=5MB +bulkProcessor.flushInterval=5s +bulkProcessor.backoffPolicy=exponential + +# The following settings are used to perform version checks on the connected ElasticSearch cluster, to make sure that +# appropriate versions are used. The check is performed like this : +# for each node in the ElasticSearch cluster: +# minimalElasticSearchVersion <= ElasticSearch node version < maximalElasticSearchVersion +minimalElasticSearchVersion=5.0.0 +maximalElasticSearchVersion=5.3.0 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/b4fed6ad/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg ---------------------------------------------------------------------- diff --git a/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg b/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg deleted file mode 100644 index 77eb091..0000000 --- a/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg +++ /dev/null @@ -1,45 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -cluster.name=contextElasticSearch -# The elasticSearchAddresses may be a comma seperated list of host names and ports such as -# hostA:9300,hostB:9300 -# Note: the port number must be repeated for each host. -elasticSearchAddresses=localhost:9300 -index.name=context -monthlyIndex.numberOfShards=3 -monthlyIndex.numberOfReplicas=0 -numberOfShards=5 -numberOfReplicas=0 -defaultQueryLimit=10 - -# The following settings control the behavior of the BulkProcessor API. You can find more information about these -# settings and their behavior here : https://www.elastic.co/guide/en/elasticsearch/client/java-api/2.4/java-docs-bulk-processor.html -# The values used here are the default values of the API -bulkProcessor.name=unomi-bulk -bulkProcessor.concurrentRequests=1 -bulkProcessor.bulkActions=1000 -bulkProcessor.bulkSize=5MB -bulkProcessor.flushInterval=5s -bulkProcessor.backoffPolicy=exponential - -# The following settings are used to perform version checks on the connected ElasticSearch cluster, to make sure that -# appropriate versions are used. The check is performed like this : -# for each node in the ElasticSearch cluster: -# minimalElasticSearchVersion <= ElasticSearch node version < maximalElasticSearchVersion -minimalElasticSearchVersion=5.0.0 -maximalElasticSearchVersion=5.3.0 \ No newline at end of file
