Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import static org.elasticsearch.core.Strings.format;

Expand Down Expand Up @@ -112,13 +111,10 @@ protected void put(String inferenceId, String modelConfig, TaskType taskType) th
@SuppressWarnings("unchecked")
// in version 8.15, there was a breaking change where "models" was renamed to "endpoints"
LinkedList<Map<String, Object>> getConfigsWithBreakingChangeHandling(TaskType testTaskType, String oldClusterId) throws IOException {

var response = get(testTaskType, oldClusterId);
LinkedList<Map<String, Object>> configs;
configs = new LinkedList<>(
(List<Map<String, Object>>) Objects.requireNonNullElse((get(testTaskType, oldClusterId).get("endpoints")), List.of())
);
configs.addAll(Objects.requireNonNullElse((List<Map<String, Object>>) get(testTaskType, oldClusterId).get("models"), List.of()));

configs = new LinkedList<>((List<Map<String, Object>>) response.getOrDefault("endpoints", List.of()));
configs.addAll((List<Map<String, Object>>) response.getOrDefault("models", List.of()));
return configs;
}
}