Internal API: remove undocumented ElasticSearch API usage and use documented one (#10031)
This commit is contained in:
parent
65431ac786
commit
1da72b6af9
|
|
@ -125,12 +125,13 @@
|
|||
25s period.
|
||||
* Fix ID conflicts for all JDBC storage implementations. Due to the insert delay, the JDBC storage implementation would
|
||||
still generate another new insert statement.
|
||||
* [**Breaking Change**] Remove `core/default/enableDatabaseSession` config.
|
||||
* [**Breaking Change**] Add `@BanyanDB.TimestampColumn` to identify `which column in Record` is providing the timestamp(milliseconds) for BanyanDB,
|
||||
* [**Breaking Change**] Remove `core/default/enableDatabaseSession` config.
|
||||
* [**Breaking Change**] Add `@BanyanDB.TimestampColumn` to identify `which column in Record` is providing the timestamp(milliseconds) for BanyanDB,
|
||||
since BanyanDB stream requires a timestamp in milliseconds.
|
||||
For SQL-Database: add new column `timestamp` for tables `profile_task_log/top_n_database_statement`,
|
||||
requires altering this column or removing these tables before OAP starts, if bump up from previous releases.
|
||||
* Fix Elasticsearch storage: In `No-Sharding Mode`, add specific analyzer to the template before index creation to avoid update index error.
|
||||
* Internal API: remove undocumented ElasticSearch API usage and use documented one.
|
||||
|
||||
#### UI
|
||||
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ public class ElasticSearchClient implements Client, HealthCheckable {
|
|||
indexIds.forEach((indexName, ids) -> {
|
||||
map.put(indexNameConverter.apply(indexName), ids);
|
||||
});
|
||||
return es.get().documents().mGet(TYPE, map);
|
||||
return es.get().documents().mget(TYPE, map);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public final class DocumentClient {
|
|||
}
|
||||
|
||||
@SneakyThrows
|
||||
public Optional<Documents> mGet(String type, Map<String, List<String>> indexIds) {
|
||||
public Optional<Documents> mget(String type, Map<String, List<String>> indexIds) {
|
||||
final CompletableFuture<Optional<Documents>> future =
|
||||
version.thenCompose(
|
||||
v -> client.execute(v.requestFactory().document().mget(type, indexIds))
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.linecorp.armeria.common.HttpRequest;
|
||||
import com.linecorp.armeria.common.HttpRequestBuilder;
|
||||
import com.linecorp.armeria.common.MediaType;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -106,11 +105,11 @@ final class V7DocumentFactory implements DocumentFactory {
|
|||
final Map<String, Iterable<Map<String, String>>> m = ImmutableMap.of("docs", indexIdList);
|
||||
final byte[] content = version.codec().encode(m);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("mget indexIds request: {}", new String(content, Charset.defaultCharset()));
|
||||
log.debug("mget indexIds request: {}", new String(content));
|
||||
}
|
||||
|
||||
return HttpRequest.builder()
|
||||
.get("/_doc/_mget")
|
||||
.get("/_mget")
|
||||
.content(MediaType.JSON, content)
|
||||
.build();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ public class ITElasticSearchTest {
|
|||
//test mGet
|
||||
Map<String, List<String>> indexIdsGroup = new HashMap<>();
|
||||
indexIdsGroup.put("test-index", Arrays.asList("id1", "id2"));
|
||||
Optional<Documents> documents = client.documents().mGet(type, indexIdsGroup);
|
||||
Optional<Documents> documents = client.documents().mget(type, indexIdsGroup);
|
||||
Map<String, Map<String, Object>> result = new HashMap<>();
|
||||
for (final Document document : documents.get()) {
|
||||
result.put(document.getId(), document.getSource());
|
||||
|
|
|
|||
Loading…
Reference in New Issue