Skip to content

Commit

Permalink
MAINT: merging main and resolve conflict
Browse files Browse the repository at this point in the history
Signed-off-by: George Chen <[email protected]>
  • Loading branch information
chenqi0805 committed May 23, 2023
2 parents 5aa21a8 + 95969db commit c174387
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fix missing Highlight and SourceConfig in the MultisearchBody ([#442](https://github.com/opensearch-project/opensearch-java/pull/442))
- Fix parsing /_alias error response for not existing alias ([#476](https://github.com/opensearch-project/opensearch-java/pull/476))
- Fix missing cause message in missing permission to call Fine Grained Access Control Amazon OpenSearch domain ([#473](https://github.com/opensearch-project/opensearch-java/issues/473))
- Fix StoryStats numeric value out of range of int ([#489](https://github.com/opensearch-project/opensearch-java/pull/489))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ public class StoreStats implements JsonpSerializable {
@Nullable
private final String size;

private final int sizeInBytes;
private final long sizeInBytes;

@Nullable
private final String reserved;

private final int reservedInBytes;
private final long reservedInBytes;

@Nullable
private final String totalDataSetSize;

@Nullable
private final Integer totalDataSetSizeInBytes;
private final Long totalDataSetSizeInBytes;

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

Expand Down Expand Up @@ -98,7 +98,7 @@ public final String size() {
/**
* Required - API name: {@code size_in_bytes}
*/
public final int sizeInBytes() {
public final long sizeInBytes() {
return this.sizeInBytes;
}

Expand All @@ -113,7 +113,7 @@ public final String reserved() {
/**
* Required - API name: {@code reserved_in_bytes}
*/
public final int reservedInBytes() {
public final long reservedInBytes() {
return this.reservedInBytes;
}

Expand All @@ -129,7 +129,7 @@ public final String totalDataSetSize() {
* API name: {@code total_data_set_size_in_bytes}
*/
@Nullable
public final Integer totalDataSetSizeInBytes() {
public final Long totalDataSetSizeInBytes() {
return this.totalDataSetSizeInBytes;
}

Expand Down Expand Up @@ -183,18 +183,18 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder<S
@Nullable
private String size;

private Integer sizeInBytes;
private Long sizeInBytes;

@Nullable
private String reserved;

private Integer reservedInBytes;
private Long reservedInBytes;

@Nullable
private String totalDataSetSize;

@Nullable
private Integer totalDataSetSizeInBytes;
private Long totalDataSetSizeInBytes;

/**
* API name: {@code size}
Expand All @@ -207,7 +207,7 @@ public final Builder size(@Nullable String value) {
/**
* Required - API name: {@code size_in_bytes}
*/
public final Builder sizeInBytes(int value) {
public final Builder sizeInBytes(long value) {
this.sizeInBytes = value;
return this;
}
Expand All @@ -223,7 +223,7 @@ public final Builder reserved(@Nullable String value) {
/**
* Required - API name: {@code reserved_in_bytes}
*/
public final Builder reservedInBytes(int value) {
public final Builder reservedInBytes(long value) {
this.reservedInBytes = value;
return this;
}
Expand All @@ -239,7 +239,7 @@ public final Builder totalDataSetSize(@Nullable String value) {
/**
* API name: {@code total_data_set_size_in_bytes}
*/
public final Builder totalDataSetSizeInBytes(@Nullable Integer value) {
public final Builder totalDataSetSizeInBytes(@Nullable Long value) {
this.totalDataSetSizeInBytes = value;
return this;
}
Expand Down Expand Up @@ -268,11 +268,11 @@ public StoreStats build() {
protected static void setupStoreStatsDeserializer(ObjectDeserializer<StoreStats.Builder> op) {

op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size");
op.add(Builder::sizeInBytes, JsonpDeserializer.integerDeserializer(), "size_in_bytes");
op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes");
op.add(Builder::reserved, JsonpDeserializer.stringDeserializer(), "reserved");
op.add(Builder::reservedInBytes, JsonpDeserializer.integerDeserializer(), "reserved_in_bytes");
op.add(Builder::reservedInBytes, JsonpDeserializer.longDeserializer(), "reserved_in_bytes");
op.add(Builder::totalDataSetSize, JsonpDeserializer.stringDeserializer(), "total_data_set_size");
op.add(Builder::totalDataSetSizeInBytes, JsonpDeserializer.integerDeserializer(),
op.add(Builder::totalDataSetSizeInBytes, JsonpDeserializer.longDeserializer(),
"total_data_set_size_in_bytes");

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import javax.net.ssl.SSLEngine;

public abstract class OpenSearchJavaClientTestCase extends OpenSearchRestTestCase implements OpenSearchTransportSupport {
private static final List<String> systemIndices = List.of(".opensearch-observability", ".opendistro_security");
private static OpenSearchClient javaClient;
private static OpenSearchClient adminJavaClient;

Expand Down Expand Up @@ -161,7 +162,7 @@ protected void wipeAllOSIndices() throws IOException {
.indices(r -> r.headers("index,creation.date").expandWildcards(ExpandWildcard.All));

for (IndicesRecord index : response.valueBody()) {
if (index.index() != null && !".opendistro_security".equals(index.index())) {
if (index.index() != null && !systemIndices.contains(index.index())) {
adminJavaClient().indices().delete(new DeleteIndexRequest.Builder().index(index.index()).build());
}
}
Expand Down

0 comments on commit c174387

Please sign in to comment.