oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/requests/factory/v6/V6IndexFactory.java [59:79]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public HttpRequest create(String index,
                              Mappings mappings,
                              Map<String, ?> settings) {
        checkArgument(!Strings.isNullOrEmpty(index), "index cannot be null or empty");

        final ImmutableMap.Builder<String, Object> bodyBuilder = ImmutableMap.builder();
        if (mappings != null) {
            bodyBuilder.put("mappings", mappings);
        }
        if (settings != null) {
            bodyBuilder.put("settings", settings);
        }
        final ImmutableMap<String, Object> body = bodyBuilder.build();
        final byte[] content = version.codec().encode(body);

        return HttpRequest.builder()
                          .put("/{index}")
                          .pathParam("index", index)
                          .content(MediaType.JSON, content)
                          .build();
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/requests/factory/v7plus/V7IndexFactory.java [59:79]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public HttpRequest create(String index,
                              Mappings mappings,
                              Map<String, ?> settings) {
        checkArgument(!Strings.isNullOrEmpty(index), "index cannot be null or empty");

        final ImmutableMap.Builder<String, Object> bodyBuilder = ImmutableMap.builder();
        if (mappings != null) {
            bodyBuilder.put("mappings", mappings);
        }
        if (settings != null) {
            bodyBuilder.put("settings", settings);
        }
        final ImmutableMap<String, Object> body = bodyBuilder.build();
        final byte[] content = version.codec().encode(body);

        return HttpRequest.builder()
                          .put("/{index}")
                          .pathParam("index", index)
                          .content(MediaType.JSON, content)
                          .build();
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



