Commit a8020984 authored by neelesh thakur's avatar neelesh thakur
Browse files

Merge branch 'elastic-license' into 'master'

move IndicesService & IMappingService interface back to Indexer service

See merge request !261
parents bcd1d733 afe87f02
Pipeline #86499 failed with stages
in 42 minutes and 59 seconds
This diff is collapsed.
......@@ -16,7 +16,7 @@
<properties>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<osdu.oscorecommon.version>0.13.0-rc4</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.13.0-rc6</osdu.oscorecommon.version>
</properties>
<dependencies>
......
// Copyright 2017-2019, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
......@@ -22,7 +20,6 @@ import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.search.IndexInfo;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.springframework.beans.factory.annotation.Value;
......
......@@ -15,14 +15,17 @@
package org.opengroup.osdu.indexer.service;
import org.elasticsearch.client.RestHighLevelClient;
import org.opengroup.osdu.core.common.search.IMappingService;
import org.opengroup.osdu.core.common.model.indexer.IndexSchema;
import java.io.IOException;
import java.util.Map;
import java.util.Set;
public interface IndexerMappingService extends IMappingService {
public interface IMappingService {
String getIndexMapping(RestHighLevelClient client, String index) throws Exception;
String getIndexSchema(String index) throws Exception;
String createMapping(RestHighLevelClient client, IndexSchema schema, String index, boolean merge) throws IOException;
......
......@@ -30,7 +30,6 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.tenant.TenantInfo;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.core.common.search.Preconditions;
import org.opengroup.osdu.indexer.logging.AuditLogger;
import org.opengroup.osdu.core.common.model.indexer.IElasticSettingService;
......@@ -55,7 +54,7 @@ public class IndexCopyServiceImpl implements IndexCopyService {
@Inject
private IElasticSettingService elasticSettingService;
@Inject
private IndexerMappingService mappingService;
private IMappingService mappingService;
@Inject
private DpsHeaders headersInfo;
@Inject
......
......@@ -30,7 +30,6 @@ import org.opengroup.osdu.core.common.model.search.RecordMetaAttribute;
import org.opengroup.osdu.core.common.model.storage.Schema;
import org.opengroup.osdu.core.common.model.storage.SchemaItem;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.provider.interfaces.ISchemaCache;
import org.opengroup.osdu.indexer.schema.converter.exeption.SchemaProcessingException;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
......@@ -61,7 +60,7 @@ public class IndexSchemaServiceImpl implements IndexSchemaService {
@Inject
private ElasticIndexNameResolver elasticIndexNameResolver;
@Inject
private IndexerMappingService mappingService;
private IMappingService mappingService;
@Inject
private IndicesService indicesService;
@Inject
......
......@@ -36,7 +36,6 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.indexer.IndexSchema;
import org.opengroup.osdu.core.common.provider.interfaces.IIndexCache;
import org.opengroup.osdu.core.common.search.IMappingService;
import org.opengroup.osdu.core.common.search.Preconditions;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.opengroup.osdu.indexer.util.TypeMapper;
......@@ -49,7 +48,7 @@ import java.lang.reflect.Type;
import java.util.*;
@Service
public class IndexerMappingServiceImpl extends MappingServiceImpl implements IndexerMappingService {
public class IndexerMappingServiceImpl extends MappingServiceImpl implements IMappingService {
@Inject
private JaxRsDpsLog log;
......
......@@ -41,7 +41,6 @@ import org.opengroup.osdu.core.common.model.search.RecordChangedMessages;
import org.opengroup.osdu.core.common.model.search.RecordMetaAttribute;
import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.logging.AuditLogger;
import org.opengroup.osdu.indexer.provider.interfaces.IPublisher;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
......@@ -81,7 +80,7 @@ public class IndexerServiceImpl implements IndexerService {
@Inject
private IndicesService indicesService;
@Inject
private IndexerMappingService mappingService;
private IMappingService mappingService;
@Inject
private IPublisher progressPublisher;
@Inject
......
// Copyright 2017-2019, Schlumberger
//
// Licensed 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.
package org.opengroup.osdu.indexer.service;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ElasticsearchStatusException;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.settings.Settings;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.search.IndexInfo;
import java.io.IOException;
import java.util.List;
import java.util.Map;
public interface IndicesService {
boolean createIndex(RestHighLevelClient client, String index, Settings settings, String type, Map<String, Object> mapping) throws ElasticsearchStatusException, IOException;
boolean isIndexExist(RestHighLevelClient client, String index) throws IOException;
boolean deleteIndex(RestHighLevelClient client, String index) throws ElasticsearchException, IOException, AppException;
boolean deleteIndex(String index) throws ElasticsearchException, IOException, AppException;
List<IndexInfo> getIndexInfo(RestHighLevelClient client, String indexPattern) throws IOException;
}
......@@ -37,7 +37,6 @@ import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.RestStatus;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.core.common.provider.interfaces.IIndexCache;
import org.opengroup.osdu.core.common.model.search.IndexInfo;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
......
......@@ -24,8 +24,6 @@ import org.elasticsearch.client.indices.GetMappingsResponse;
import org.elasticsearch.common.unit.TimeValue;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.opengroup.osdu.core.common.search.IMappingService;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.core.common.search.Preconditions;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -39,7 +37,7 @@ import java.util.Objects;
@Service
@RequestScope
public class MappingServiceImpl implements IMappingService {
public abstract class MappingServiceImpl implements IMappingService {
@Autowired
private IndicesService indicesService;
......
......@@ -28,7 +28,6 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.indexer.IndexSchema;
import org.opengroup.osdu.core.common.model.search.RecordMetaAttribute;
import org.opengroup.osdu.core.common.provider.interfaces.IIndexCache;
import org.opengroup.osdu.core.common.search.IMappingService;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.opengroup.osdu.indexer.util.TypeMapper;
import org.powermock.api.mockito.PowerMockito;
......
......@@ -28,7 +28,6 @@ import org.opengroup.osdu.core.common.model.http.RequestStatus;
import org.opengroup.osdu.core.common.model.indexer.IndexSchema;
import org.opengroup.osdu.core.common.model.indexer.OperationType;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.provider.interfaces.ISchemaCache;
import org.opengroup.osdu.indexer.schema.converter.exeption.SchemaProcessingException;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
......@@ -75,7 +74,7 @@ public class IndexerSchemaServiceTest {
@Mock
private ElasticIndexNameResolver elasticIndexNameResolver;
@Mock
private IndexerMappingService mappingService;
private IMappingService mappingService;
@Mock
private IndicesService indicesService;
@Mock
......
......@@ -13,7 +13,6 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.opengroup.osdu.core.common.model.indexer.RecordInfo;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.springframework.test.context.junit4.SpringRunner;
......
......@@ -19,7 +19,7 @@
<java.version>1.8</java.version>
<springfox-version>2.7.0</springfox-version>
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
<os-core-common.version>0.13.0-rc4</os-core-common.version>
<os-core-common.version>0.13.0-rc6</os-core-common.version>
<snakeyaml.version>1.26</snakeyaml.version>
<hibernate-validator.version>6.1.5.Final</hibernate-validator.version>
<jackson.version>2.11.4</jackson.version>
......
......@@ -42,7 +42,7 @@
<indexer-core.version>0.13.0-SNAPSHOT</indexer-core.version>
<spring-security-jwt.version>1.1.1.RELEASE</spring-security-jwt.version>
<osdu.corelibazure.version>0.13.0-rc6</osdu.corelibazure.version>
<osdu.oscorecommon.version>0.13.0-rc4</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.13.0-rc6</osdu.oscorecommon.version>
<reactor-netty.version>0.9.12.RELEASE</reactor-netty.version>
<java-jwt.version>3.8.1</java-jwt.version>
<powermock.version>2.0.2</powermock.version>
......
......@@ -28,7 +28,7 @@ import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties;
import org.opengroup.osdu.indexer.service.CronServiceImpl;
import org.opengroup.osdu.core.common.model.search.IndexInfo;
import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.service.IndicesService;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.springframework.test.context.junit4.SpringRunner;
......
......@@ -32,13 +32,13 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.indexer.logging.AuditLogger;
import org.opengroup.osdu.indexer.service.IMappingService;
import org.opengroup.osdu.indexer.service.IndexCopyServiceImpl;
import org.opengroup.osdu.indexer.service.IndexerMappingService;
import org.opengroup.osdu.core.common.model.search.ClusterSettings;
import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo;
import org.opengroup.osdu.core.common.model.indexer.IElasticSettingService;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.indexer.service.IndicesService;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.powermock.core.classloader.annotations.PrepareForTest;
......@@ -74,7 +74,7 @@ public class IndexCopyServiceImplTest {
@Mock
private IndicesService indicesService;
@Mock
private IndexerMappingService mappingService;
private IMappingService mappingService;
@Mock
private ElasticClientHandler elasticClientHandler;
@Mock
......
......@@ -25,7 +25,6 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.search.IndexInfo;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.powermock.core.classloader.annotations.PrepareForTest;
......
......@@ -37,7 +37,6 @@ import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.indexer.logging.AuditLogger;
import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo;
import org.opengroup.osdu.core.common.model.indexer.IElasticSettingService;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.util.ElasticClientHandler;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.powermock.core.classloader.annotations.PrepareForTest;
......@@ -73,7 +72,7 @@ public class IndexCopyServiceImplTest {
@Mock
private IndicesService indicesService;
@Mock
private IndexerMappingService mappingService;
private IMappingService mappingService;
@Mock
private ElasticClientHandler elasticClientHandler;
@Mock
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment