private void determineIndexType()

in data-prepper-plugins/opensearch/src/main/java/com/amazon/dataprepper/plugins/sink/opensearch/index/IndexConfiguration.java [84:104]


    private void determineIndexType(Builder builder) {
        if(builder.indexType != null) {
            Optional<IndexType> mappedIndexType = IndexType.getByValue(builder.indexType);
            indexType = mappedIndexType.orElseThrow(
                    () -> new IllegalArgumentException("Value of the parameter, index_type, must be from the list: "
                    + IndexType.getIndexTypeValues()));
        } else if (builder.isTraceAnalyticsRaw && builder.isTraceAnalyticsServiceMap) {
            throw new IllegalStateException("trace_analytics_raw and trace_analytics_service_map cannot be both true.");
        } else if (builder.isTraceAnalyticsRaw) {
            this.indexType  = IndexType.TRACE_ANALYTICS_RAW;
        } else if (builder.isTraceAnalyticsServiceMap) {
            this.indexType  = IndexType.TRACE_ANALYTICS_SERVICE_MAP;
        } else {
            this.indexType  = IndexType.CUSTOM;
        }

        if(builder.isTraceAnalyticsRaw || builder.isTraceAnalyticsServiceMap) {
            LOG.warn("The parameters, trace_analytics_raw and trace_analytics_service_map, are deprecated. Please use index_type parameter instead.");
        }

    }