Skip to content

Commit c82f1c4

Browse files
kkondakaEC2 Default User
authored andcommitted
Rename OTEL standard template mappings index-types (opensearch-project#5587)
Rename OTEL standard template mappings index-types to plain Signed-off-by: Krishna Kondaka <krishkdk@amazon.com>
1 parent a280b6f commit c82f1c4

6 files changed

Lines changed: 18 additions & 18 deletions

File tree

data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/index/IndexConfiguration.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private IndexConfiguration(final Builder builder) {
164164

165165
String documentIdField = builder.documentIdField;
166166
String documentId = builder.documentId;
167-
if (indexType.equals(IndexType.TRACE_ANALYTICS_RAW) || indexType.equals(IndexType.TRACE_ANALYTICS_RAW_STANDARD)) {
167+
if (indexType.equals(IndexType.TRACE_ANALYTICS_RAW) || indexType.equals(IndexType.TRACE_ANALYTICS_RAW_PLAIN)) {
168168
documentId = "${spanId}";
169169
} else if (indexType.equals(IndexType.TRACE_ANALYTICS_SERVICE_MAP)) {
170170
documentId = "${hashId}";
@@ -430,17 +430,17 @@ private Map<String, Object> readIndexTemplate(final String templateFile, final I
430430
InputStream s3TemplateFile = null;
431431
if (indexType.equals(IndexType.TRACE_ANALYTICS_RAW)) {
432432
templateURL = loadExistingTemplate(templateType, IndexConstants.RAW_DEFAULT_TEMPLATE_FILE);
433-
} else if (indexType.equals(IndexType.TRACE_ANALYTICS_RAW_STANDARD)) {
433+
} else if (indexType.equals(IndexType.TRACE_ANALYTICS_RAW_PLAIN)) {
434434
templateURL = loadExistingTemplate(templateType, IndexConstants.RAW_STANDARD_TEMPLATE_FILE);
435435
} else if (indexType.equals(IndexType.TRACE_ANALYTICS_SERVICE_MAP)) {
436436
templateURL = loadExistingTemplate(templateType, IndexConstants.SERVICE_MAP_DEFAULT_TEMPLATE_FILE);
437437
} else if (indexType.equals(IndexType.LOG_ANALYTICS)) {
438438
templateURL = loadExistingTemplate(templateType, IndexConstants.LOGS_DEFAULT_TEMPLATE_FILE);
439-
} else if (indexType.equals(IndexType.LOG_ANALYTICS_STANDARD)) {
439+
} else if (indexType.equals(IndexType.LOG_ANALYTICS_PLAIN)) {
440440
templateURL = loadExistingTemplate(templateType, IndexConstants.LOGS_STANDARD_TEMPLATE_FILE);
441441
} else if (indexType.equals(IndexType.METRIC_ANALYTICS)) {
442442
templateURL = loadExistingTemplate(templateType, IndexConstants.METRICS_DEFAULT_TEMPLATE_FILE);
443-
} else if (indexType.equals(IndexType.METRIC_ANALYTICS_STANDARD)) {
443+
} else if (indexType.equals(IndexType.METRIC_ANALYTICS_PLAIN)) {
444444
templateURL = loadExistingTemplate(templateType, IndexConstants.METRICS_STANDARD_TEMPLATE_FILE);
445445
} else if (templateFile != null) {
446446
if (templateFile.toLowerCase().startsWith(S3_PREFIX)) {

data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/index/IndexConstants.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public class IndexConstants {
4242
// TODO: extract out version number into version enum
4343
TYPE_TO_DEFAULT_ALIAS.put(IndexType.TRACE_ANALYTICS_SERVICE_MAP, "otel-v1-apm-service-map");
4444
TYPE_TO_DEFAULT_ALIAS.put(IndexType.TRACE_ANALYTICS_RAW, "otel-v1-apm-span");
45-
TYPE_TO_DEFAULT_ALIAS.put(IndexType.TRACE_ANALYTICS_RAW_STANDARD, "otel-v1-apm-span");
45+
TYPE_TO_DEFAULT_ALIAS.put(IndexType.TRACE_ANALYTICS_RAW_PLAIN, "otel-v1-apm-span");
4646
TYPE_TO_DEFAULT_ALIAS.put(IndexType.LOG_ANALYTICS, "logs-otel-v1");
47-
TYPE_TO_DEFAULT_ALIAS.put(IndexType.LOG_ANALYTICS_STANDARD, "logs-otel-v1");
47+
TYPE_TO_DEFAULT_ALIAS.put(IndexType.LOG_ANALYTICS_PLAIN, "logs-otel-v1");
4848
TYPE_TO_DEFAULT_ALIAS.put(IndexType.METRIC_ANALYTICS, "metrics-otel-v1");
49-
TYPE_TO_DEFAULT_ALIAS.put(IndexType.METRIC_ANALYTICS_STANDARD, "metrics-otel-v1");
49+
TYPE_TO_DEFAULT_ALIAS.put(IndexType.METRIC_ANALYTICS_PLAIN, "metrics-otel-v1");
5050
}
5151
}

data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/index/IndexManagerFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public final IndexManager getIndexManager(final IndexType indexType,
5151
IndexManager indexManager;
5252
switch (indexType) {
5353
case TRACE_ANALYTICS_RAW:
54-
case TRACE_ANALYTICS_RAW_STANDARD:
54+
case TRACE_ANALYTICS_RAW_PLAIN:
5555
indexManager = new TraceAnalyticsRawIndexManager(
5656
restHighLevelClient, openSearchClient, openSearchSinkConfiguration, clusterSettingsParser, templateStrategy, indexAlias);
5757
break;
@@ -60,12 +60,12 @@ public final IndexManager getIndexManager(final IndexType indexType,
6060
restHighLevelClient, openSearchClient, openSearchSinkConfiguration, clusterSettingsParser, templateStrategy, indexAlias);
6161
break;
6262
case LOG_ANALYTICS:
63-
case LOG_ANALYTICS_STANDARD:
63+
case LOG_ANALYTICS_PLAIN:
6464
indexManager = new LogAnalyticsIndexManager(
6565
restHighLevelClient, openSearchClient, openSearchSinkConfiguration, clusterSettingsParser, templateStrategy, indexAlias);
6666
break;
6767
case METRIC_ANALYTICS:
68-
case METRIC_ANALYTICS_STANDARD:
68+
case METRIC_ANALYTICS_PLAIN:
6969
indexManager = new MetricAnalyticsIndexManager(
7070
restHighLevelClient, openSearchClient, openSearchSinkConfiguration, clusterSettingsParser, templateStrategy, indexAlias);
7171
break;

data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/index/IndexType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
public enum IndexType {
1515
TRACE_ANALYTICS_RAW("trace-analytics-raw"),
16-
TRACE_ANALYTICS_RAW_STANDARD("trace-analytics-standard-raw"),
16+
TRACE_ANALYTICS_RAW_PLAIN("trace-analytics-plain-raw"),
1717
TRACE_ANALYTICS_SERVICE_MAP("trace-analytics-service-map"),
1818
LOG_ANALYTICS("log-analytics"),
19-
LOG_ANALYTICS_STANDARD("log-analytics-standard"),
19+
LOG_ANALYTICS_PLAIN("log-analytics-plain"),
2020
METRIC_ANALYTICS("metric-analytics"),
21-
METRIC_ANALYTICS_STANDARD("metric-analytics-standard"),
21+
METRIC_ANALYTICS_PLAIN("metric-analytics-plain"),
2222
CUSTOM("custom"),
2323
MANAGEMENT_DISABLED("management_disabled");
2424

data-prepper-plugins/opensearch/src/test/java/org/opensearch/dataprepper/plugins/sink/opensearch/index/IndexTypeTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ public void getByValue() {
2626
assertEquals(Optional.of(IndexType.CUSTOM), IndexType.getByValue("custom"));
2727
assertEquals(Optional.of(IndexType.MANAGEMENT_DISABLED), IndexType.getByValue("management_disabled"));
2828
assertEquals(Optional.of(IndexType.TRACE_ANALYTICS_RAW), IndexType.getByValue("trace-analytics-raw"));
29-
assertEquals(Optional.of(IndexType.TRACE_ANALYTICS_RAW_STANDARD), IndexType.getByValue("trace-analytics-standard-raw"));
29+
assertEquals(Optional.of(IndexType.TRACE_ANALYTICS_RAW_PLAIN), IndexType.getByValue("trace-analytics-plain-raw"));
3030
assertEquals(Optional.of(IndexType.TRACE_ANALYTICS_SERVICE_MAP), IndexType.getByValue("trace-analytics-service-map"));
3131
assertEquals(Optional.of(IndexType.LOG_ANALYTICS), IndexType.getByValue("log-analytics"));
32-
assertEquals(Optional.of(IndexType.LOG_ANALYTICS_STANDARD), IndexType.getByValue("log-analytics-standard"));
32+
assertEquals(Optional.of(IndexType.LOG_ANALYTICS_PLAIN), IndexType.getByValue("log-analytics-plain"));
3333
assertEquals(Optional.of(IndexType.METRIC_ANALYTICS), IndexType.getByValue("metric-analytics"));
34-
assertEquals(Optional.of(IndexType.METRIC_ANALYTICS_STANDARD), IndexType.getByValue("metric-analytics-standard"));
34+
assertEquals(Optional.of(IndexType.METRIC_ANALYTICS_PLAIN), IndexType.getByValue("metric-analytics-plain"));
3535
}
3636

3737
@Test
3838
public void getIndexTypeValues() {
39-
assertEquals("[trace-analytics-raw, trace-analytics-standard-raw, trace-analytics-service-map, log-analytics, log-analytics-standard, metric-analytics, metric-analytics-standard, custom, management_disabled]", IndexType.getIndexTypeValues());
39+
assertEquals("[trace-analytics-raw, trace-analytics-plain-raw, trace-analytics-service-map, log-analytics, log-analytics-plain, metric-analytics, metric-analytics-plain, custom, management_disabled]", IndexType.getIndexTypeValues());
4040
}
4141

4242
@ParameterizedTest

data-prepper-plugins/opensearch/src/test/java/org/opensearch/dataprepper/plugins/sink/opensearch/index/TraceAnalyticsRawIndexManagerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ void checkAndCreateIndex_NeedToCreateNewIndex() throws IOException {
277277
@Test
278278
void checkAndCreateIndex_NeedToCreateNewIndex_withStandardIndexManager() throws IOException {
279279
traceAnalyticsRawStandardIndexManager = indexManagerFactory.getIndexManager(
280-
IndexType.TRACE_ANALYTICS_RAW_STANDARD, openSearchClient, restHighLevelClient, openSearchSinkConfiguration, templateStrategy);
280+
IndexType.TRACE_ANALYTICS_RAW_PLAIN, openSearchClient, restHighLevelClient, openSearchSinkConfiguration, templateStrategy);
281281

282282
when(openSearchIndicesClient.existsAlias(any(ExistsAliasRequest.class))).thenReturn(new BooleanResponse(false));
283283
when(openSearchIndicesClient.create(any(CreateIndexRequest.class)))

0 commit comments

Comments
 (0)