Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Sep 9, 2024
1 parent e25ec82 commit ff5a99a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased 3.0]
### Dependencies
- Bumps `org.junit:junit-bom` from 5.10.2 to 5.11.0
- Bumps `org.owasp.dependencycheck` from 10.0.2 to 10.0.4
- Bumps `org.eclipse.parsson:parsson` from 1.1.6 to 1.1.7
- Bumps `org.hamcrest:hamcrest` from 2.2 to 3.0
Expand All @@ -21,6 +20,7 @@ This section is for maintaining a changelog for all breaking changes for the cli
- Changed SearchAfter of SearchRequest type to FieldValue instead of String ([#769](https://github.com/opensearch-project/opensearch-java/pull/769))
- Changed type of `DanglingIndex`'s `creationDateMillis` field from `String` to `long` ([#1124](https://github.com/opensearch-project/opensearch-java/pull/1124))
- Changed type of `ShardStatistics`'s `total`, `successful`, `failed` & `skipped` fields from `Number` to `int/Integer` ([#1158](https://github.com/opensearch-project/opensearch-java/pull/1158))
- Unified `tasks.Info` and `tasks.State` classes into `tasks.TaskInfo` ([#1187](https://github.com/opensearch-project/opensearch-java/pull/1187))

### Deprecated
- Deprecate RestClientTransport ([#536](https://github.com/opensearch-project/opensearch-java/pull/536))
Expand All @@ -29,7 +29,7 @@ This section is for maintaining a changelog for all breaking changes for the cli

### Fixed
- Fix version and build ([#254](https://github.com/opensearch-project/opensearch-java/pull/254))
- Fix queries not preserving boost and name when converted to builders ([#1181](https://github.com/opensearch-project/opensearch-java/pull/1181))
- Fixed deserializing `tasks.ListResponse` when using `GroupBy.None` ([#1187](https://github.com/opensearch-project/opensearch-java/pull/1187))

### Security

Expand All @@ -38,6 +38,7 @@ This section is for maintaining a changelog for all breaking changes for the cli
### Added

### Dependencies
- Bumps `org.junit:junit-bom` from 5.10.3 to 5.11.0

### Changed

Expand All @@ -46,6 +47,7 @@ This section is for maintaining a changelog for all breaking changes for the cli
### Removed

### Fixed
- Fix queries not preserving boost and name when converted to builders ([#1181](https://github.com/opensearch-project/opensearch-java/pull/1181))

### Security

Expand Down
1 change: 1 addition & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ After:
- The `tasks.Info` and `tasks.State` classes have been unified into `tasks.TaskInfo`, this affects:
- `TaskExecutingNode`'s `tasks` field.
- `GetTasksResponse`'s `task` field.
- `core.update_by_query_rethrottle.UpdateByQueryRethrottleNode`'s `tasks` field.
- The `headers` field is now a `Map<String, String>` instead of a `Map<String, List<String>>`.

### tasks.ListResponse properties lifted to tasks.TaskListResponseBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.opensearch._types.BaseNode;
import org.opensearch.client.opensearch.tasks.Info;
import org.opensearch.client.opensearch.tasks.TaskInfo;
import org.opensearch.client.util.ApiTypeHelper;
import org.opensearch.client.util.ObjectBuilder;

// typedef: _global.update_by_query_rethrottle.UpdateByQueryRethrottleNode

@JsonpDeserializable
public class UpdateByQueryRethrottleNode extends BaseNode {
private final Map<String, Info> tasks;
private final Map<String, TaskInfo> tasks;

// ---------------------------------------------------------------------------------------------

Expand All @@ -67,7 +67,7 @@ public static UpdateByQueryRethrottleNode of(Function<Builder, ObjectBuilder<Upd
/**
* Required - API name: {@code tasks}
*/
public final Map<String, Info> tasks() {
public final Map<String, TaskInfo> tasks() {
return this.tasks;
}

Expand All @@ -77,7 +77,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
if (ApiTypeHelper.isDefined(this.tasks)) {
generator.writeKey("tasks");
generator.writeStartObject();
for (Map.Entry<String, Info> item0 : this.tasks.entrySet()) {
for (Map.Entry<String, TaskInfo> item0 : this.tasks.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);

Expand All @@ -95,14 +95,14 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
*/

public static class Builder extends BaseNode.AbstractBuilder<Builder> implements ObjectBuilder<UpdateByQueryRethrottleNode> {
private Map<String, Info> tasks;
private Map<String, TaskInfo> tasks;

/**
* Required - API name: {@code tasks}
* <p>
* Adds all entries of <code>map</code> to <code>tasks</code>.
*/
public final Builder tasks(Map<String, Info> map) {
public final Builder tasks(Map<String, TaskInfo> map) {
this.tasks = _mapPutAll(this.tasks, map);
return this;
}
Expand All @@ -112,7 +112,7 @@ public final Builder tasks(Map<String, Info> map) {
* <p>
* Adds an entry to <code>tasks</code>.
*/
public final Builder tasks(String key, Info value) {
public final Builder tasks(String key, TaskInfo value) {
this.tasks = _mapPut(this.tasks, key, value);
return this;
}
Expand All @@ -122,8 +122,8 @@ public final Builder tasks(String key, Info value) {
* <p>
* Adds an entry to <code>tasks</code> using a builder lambda.
*/
public final Builder tasks(String key, Function<Info.Builder, ObjectBuilder<Info>> fn) {
return tasks(key, fn.apply(new Info.Builder()).build());
public final Builder tasks(String key, Function<TaskInfo.Builder, ObjectBuilder<TaskInfo>> fn) {
return tasks(key, fn.apply(new TaskInfo.Builder()).build());
}

@Override
Expand Down Expand Up @@ -156,7 +156,7 @@ public UpdateByQueryRethrottleNode build() {

protected static void setupUpdateByQueryRethrottleNodeDeserializer(ObjectDeserializer<UpdateByQueryRethrottleNode.Builder> op) {
BaseNode.setupBaseNodeDeserializer(op);
op.add(Builder::tasks, JsonpDeserializer.stringMapDeserializer(Info._DESERIALIZER), "tasks");
op.add(Builder::tasks, JsonpDeserializer.stringMapDeserializer(TaskInfo._DESERIALIZER), "tasks");

}

Expand Down

0 comments on commit ff5a99a

Please sign in to comment.