incubator-unomi git commit: UNOMI-87 : Rewrite the queries for the scroring plans update
Repository: incubator-unomi Updated Branches: refs/heads/master cd3bc9ff0 -> 2f687915a UNOMI-87 : Rewrite the queries for the scroring plans update Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/2f687915 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/2f687915 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/2f687915 Branch: refs/heads/master Commit: 2f687915a8929af291e43ee2536ba4208e752496 Parents: cd3bc9f Author: Abdelkader Midani Authored: Mon Mar 20 12:09:36 2017 +0100 Committer: Abdelkader Midani Committed: Mon Mar 20 12:09:42 2017 +0100 -- .../ElasticSearchPersistenceServiceImpl.java| 124 ++- ...g.apache.unomi.persistence.elasticsearch.cfg | 4 +- persistence-elasticsearch/pom.xml | 1 - .../persistence/spi/PersistenceService.java | 12 ++ .../PropertyConditionESQueryBuilder.java| 3 + .../conditions/PropertyConditionEvaluator.java | 3 - pom.xml | 2 +- .../services/services/SegmentServiceImpl.java | 119 +- 8 files changed, 169 insertions(+), 99 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/2f687915/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java -- diff --git a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java index e2d1645..4e66418 100644 --- a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java +++ b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java @@ -56,7 +56,11 @@ import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.RangeQueryBuilder; +import org.elasticsearch.index.reindex.BulkIndexByScrollResponse; +import org.elasticsearch.index.reindex.UpdateByQueryAction; +import org.elasticsearch.index.reindex.UpdateByQueryRequestBuilder; import org.elasticsearch.script.Script; +import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; @@ -92,22 +96,21 @@ import java.util.*; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import static org.elasticsearch.index.query.QueryBuilders.termQuery; + @SuppressWarnings("rawtypes") public class ElasticSearchPersistenceServiceImpl implements PersistenceService, SynchronousBundleListener { -private static final Logger logger = LoggerFactory.getLogger(ElasticSearchPersistenceServiceImpl.class.getName()); - public static final String NUMBER_OF_SHARDS = "number_of_shards"; public static final String NUMBER_OF_REPLICAS = "number_of_replicas"; public static final String CLUSTER_NAME = "cluster.name"; - public static final String BULK_PROCESSOR_NAME = "bulkProcessor.name"; public static final String BULK_PROCESSOR_CONCURRENT_REQUESTS = "bulkProcessor.concurrentRequests"; public static final String BULK_PROCESSOR_BULK_ACTIONS = "bulkProcessor.bulkActions"; public static final String BULK_PROCESSOR_BULK_SIZE = "bulkProcessor.bulkSize"; public static final String BULK_PROCESSOR_FLUSH_INTERVAL = "bulkProcessor.flushInterval"; public static final String BULK_PROCESSOR_BACKOFF_POLICY = "bulkProcessor.backoffPolicy"; - +private static final Logger logger = LoggerFactory.getLogger(ElasticSearchPersistenceServiceImpl.class.getName()); private TransportClient client; private BulkProcessor bulkProcessor; private String elasticSearchAddresses; @@ -123,7 +126,7 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService, private ConditionEvaluatorDispatcher conditionEvaluatorDispatcher; private ConditionESQueryBuilderDispatcher conditionESQueryBuilderDispatcher; -private Map indexNames; +private Map indexNames; private List itemsMonthlyIndexed; private Map routingByType; private Set existingIndexNames = new TreeSet(); @@ -135,7 +138,7 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService, private String bulkProcessorName = "unomi-bulk"; private String bulkProcessorConcurrentRe
[10/50] [abbrv] incubator-unomi git commit: UNOMI-87 : Rewrite the queries for the scroring plans update
UNOMI-87 : Rewrite the queries for the scroring plans update Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/2f687915 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/2f687915 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/2f687915 Branch: refs/heads/feature-UNOMI-5-KARAF4 Commit: 2f687915a8929af291e43ee2536ba4208e752496 Parents: cd3bc9f Author: Abdelkader Midani Authored: Mon Mar 20 12:09:36 2017 +0100 Committer: Abdelkader Midani Committed: Mon Mar 20 12:09:42 2017 +0100 -- .../ElasticSearchPersistenceServiceImpl.java| 124 ++- ...g.apache.unomi.persistence.elasticsearch.cfg | 4 +- persistence-elasticsearch/pom.xml | 1 - .../persistence/spi/PersistenceService.java | 12 ++ .../PropertyConditionESQueryBuilder.java| 3 + .../conditions/PropertyConditionEvaluator.java | 3 - pom.xml | 2 +- .../services/services/SegmentServiceImpl.java | 119 +- 8 files changed, 169 insertions(+), 99 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/2f687915/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java -- diff --git a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java index e2d1645..4e66418 100644 --- a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java +++ b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java @@ -56,7 +56,11 @@ import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.RangeQueryBuilder; +import org.elasticsearch.index.reindex.BulkIndexByScrollResponse; +import org.elasticsearch.index.reindex.UpdateByQueryAction; +import org.elasticsearch.index.reindex.UpdateByQueryRequestBuilder; import org.elasticsearch.script.Script; +import org.elasticsearch.script.ScriptException; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHits; @@ -92,22 +96,21 @@ import java.util.*; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import static org.elasticsearch.index.query.QueryBuilders.termQuery; + @SuppressWarnings("rawtypes") public class ElasticSearchPersistenceServiceImpl implements PersistenceService, SynchronousBundleListener { -private static final Logger logger = LoggerFactory.getLogger(ElasticSearchPersistenceServiceImpl.class.getName()); - public static final String NUMBER_OF_SHARDS = "number_of_shards"; public static final String NUMBER_OF_REPLICAS = "number_of_replicas"; public static final String CLUSTER_NAME = "cluster.name"; - public static final String BULK_PROCESSOR_NAME = "bulkProcessor.name"; public static final String BULK_PROCESSOR_CONCURRENT_REQUESTS = "bulkProcessor.concurrentRequests"; public static final String BULK_PROCESSOR_BULK_ACTIONS = "bulkProcessor.bulkActions"; public static final String BULK_PROCESSOR_BULK_SIZE = "bulkProcessor.bulkSize"; public static final String BULK_PROCESSOR_FLUSH_INTERVAL = "bulkProcessor.flushInterval"; public static final String BULK_PROCESSOR_BACKOFF_POLICY = "bulkProcessor.backoffPolicy"; - +private static final Logger logger = LoggerFactory.getLogger(ElasticSearchPersistenceServiceImpl.class.getName()); private TransportClient client; private BulkProcessor bulkProcessor; private String elasticSearchAddresses; @@ -123,7 +126,7 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService, private ConditionEvaluatorDispatcher conditionEvaluatorDispatcher; private ConditionESQueryBuilderDispatcher conditionESQueryBuilderDispatcher; -private Map indexNames; +private Map indexNames; private List itemsMonthlyIndexed; private Map routingByType; private Set existingIndexNames = new TreeSet(); @@ -135,7 +138,7 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService, private String bulkProcessorName = "unomi-bulk"; private String bulkProcessorConcurrentRequests = "1"; private String bulkProcessorBulkActions = "1000"; -p