Skip to content

Commit e4180b5

Browse files
committed
SCMOD-3536: Updated dependency versions
1 parent 0b94c99 commit e4180b5

File tree

4 files changed

+373
-26
lines changed

4 files changed

+373
-26
lines changed

elastic-mapping-updater/src/main/java/com/github/cafdataprocessing/elastic/tools/ElasticMappingUpdater.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
import org.apache.commons.lang3.StringUtils;
3232
import org.elasticsearch.client.indices.GetIndexResponse;
33-
import org.elasticsearch.client.indices.IndexTemplateMetaData;
34-
import org.elasticsearch.cluster.metadata.MappingMetaData;
33+
import org.elasticsearch.client.indices.IndexTemplateMetadata;
34+
import org.elasticsearch.cluster.metadata.MappingMetadata;
3535
import org.slf4j.Logger;
3636
import org.slf4j.LoggerFactory;
3737

@@ -135,23 +135,23 @@ private ElasticMappingUpdater(
135135
private void updateIndexes()
136136
throws IOException, GetIndexException, GetTemplatesException, UnexpectedResponseException
137137
{
138-
final List<IndexTemplateMetaData> templates = elasticRequestHandler.getTemplates();
138+
final List<IndexTemplateMetadata> templates = elasticRequestHandler.getTemplates();
139139
LOGGER.info("Templates found in Elasticsearch: {}",
140140
templates.stream().map(template -> template.name()).collect(Collectors.toList()));
141-
for (final IndexTemplateMetaData template : templates) {
141+
for (final IndexTemplateMetadata template : templates) {
142142
updateIndexesForTemplate(template);
143143
}
144144
}
145145

146-
private void updateIndexesForTemplate(final IndexTemplateMetaData template)
146+
private void updateIndexesForTemplate(final IndexTemplateMetadata template)
147147
throws IOException, GetIndexException, GetTemplatesException, UnexpectedResponseException
148148
{
149149
final String templateName = template.name();
150150
LOGGER.info("---- Analyzing indexes matching template '{}' ----", templateName);
151151

152152
final List<String> patterns = template.patterns();
153153

154-
final MappingMetaData mapping = template.mappings();
154+
final MappingMetadata mapping = template.mappings();
155155
if (mapping == null) {
156156
LOGGER.info("No mappings in template '{}'. Indexes for this template will not be updated.", templateName);
157157
return;
@@ -168,7 +168,7 @@ private void updateIndexesForTemplate(final IndexTemplateMetaData template)
168168
LOGGER.info("Found {} index(es) that match template '{}'", indexes.size(), templateName);
169169
for (final String indexName : indexes) {
170170
GetIndexResponse getIndexResponse = elasticRequestHandler.getIndex(indexName);
171-
MappingMetaData indexMappings = getIndexResponse.getMappings().get(indexName);
171+
MappingMetadata indexMappings = getIndexResponse.getMappings().get(indexName);
172172
Map<String, Object> indexTypeMappings = indexMappings.getSourceAsMap();
173173

174174
LOGGER.info("Comparing index mapping for '{}'", indexName);

elastic-mapping-updater/src/main/java/com/github/cafdataprocessing/elastic/tools/ElasticRequestHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.elasticsearch.client.RestClient;
3434
import org.elasticsearch.client.indices.GetIndexResponse;
3535
import org.elasticsearch.client.indices.GetIndexTemplatesResponse;
36-
import org.elasticsearch.client.indices.IndexTemplateMetaData;
36+
import org.elasticsearch.client.indices.IndexTemplateMetadata;
3737
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
3838
import org.elasticsearch.common.xcontent.XContentFactory;
3939
import org.elasticsearch.common.xcontent.XContentParser;
@@ -60,7 +60,7 @@ public ElasticRequestHandler(final ElasticMappingUpdaterConfiguration schemaUpda
6060
this.elasticClient = ElasticProvider.getClient(schemaUpdaterConfig.getElasticSettings());
6161
}
6262

63-
List<IndexTemplateMetaData> getTemplates()
63+
List<IndexTemplateMetadata> getTemplates()
6464
throws IOException, GetTemplatesException
6565
{
6666
LOGGER.debug("Getting templates...");
@@ -73,7 +73,7 @@ List<IndexTemplateMetaData> getTemplates()
7373
final XContentParser parser
7474
= XContentFactory.xContent(XContentType.JSON).createParser(NamedXContentRegistry.EMPTY, null, resultJsonStream)) {
7575
final GetIndexTemplatesResponse getTemplatesResponse = GetIndexTemplatesResponse.fromXContent(parser);
76-
final List<IndexTemplateMetaData> templates = getTemplatesResponse.getIndexTemplates();
76+
final List<IndexTemplateMetadata> templates = getTemplatesResponse.getIndexTemplates();
7777
return templates;
7878
}
7979
} else {

elastic-mapping-updater/src/test/java/com/github/cafdataprocessing/elastic/tools/test/ElasticMappingUpdaterIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import org.elasticsearch.action.support.master.AcknowledgedResponse;
4444
import org.elasticsearch.client.indices.GetIndexResponse;
4545
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
46-
import org.elasticsearch.cluster.metadata.MappingMetaData;
46+
import org.elasticsearch.cluster.metadata.MappingMetadata;
4747
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
4848
import org.elasticsearch.common.xcontent.XContentFactory;
4949
import org.elasticsearch.common.xcontent.XContentParser;
@@ -1312,7 +1312,7 @@ private Map<String, Object> getIndexMapping(final String testName, final String
13121312
final XContentParser parser
13131313
= XContentFactory.xContent(XContentType.JSON).createParser(NamedXContentRegistry.EMPTY, null, resultJsonStream)) {
13141314
final GetIndexResponse getIndexResponse = GetIndexResponse.fromXContent(parser);
1315-
final MappingMetaData indexMappings = getIndexResponse.getMappings().get(indexName);
1315+
final MappingMetadata indexMappings = getIndexResponse.getMappings().get(indexName);
13161316
final Map<String, Object> indexTypeMappings = indexMappings.getSourceAsMap();
13171317
LOGGER.info("{}------Updated mapping for index '{}': {}", testName, indexName, indexTypeMappings);
13181318
return indexTypeMappings;

0 commit comments

Comments
 (0)