Skip to content

Commit b824ae6

Browse files
committed
[codegen] update to latest spec
1 parent 3867037 commit b824ae6

File tree

107 files changed

+9783
-1739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+9783
-1739
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/DocStats.java

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3232
import jakarta.json.stream.JsonGenerator;
3333
import java.lang.Long;
34+
import java.lang.String;
3435
import java.util.Objects;
3536
import java.util.function.Function;
3637
import javax.annotation.Nullable;
@@ -64,12 +65,19 @@ public class DocStats implements JsonpSerializable {
6465
@Nullable
6566
private final Long deleted;
6667

68+
private final long totalSizeInBytes;
69+
70+
@Nullable
71+
private final String totalSize;
72+
6773
// ---------------------------------------------------------------------------------------------
6874

6975
private DocStats(Builder builder) {
7076

7177
this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count", 0);
7278
this.deleted = builder.deleted;
79+
this.totalSizeInBytes = ApiTypeHelper.requireNonNull(builder.totalSizeInBytes, this, "totalSizeInBytes", 0);
80+
this.totalSize = builder.totalSize;
7381

7482
}
7583

@@ -101,6 +109,27 @@ public final Long deleted() {
101109
return this.deleted;
102110
}
103111

112+
/**
113+
* Required - Returns the total size in bytes of all documents in this stats.
114+
* This value may be more reliable than store_stats.size_in_bytes in estimating
115+
* the index size.
116+
* <p>
117+
* API name: {@code total_size_in_bytes}
118+
*/
119+
public final long totalSizeInBytes() {
120+
return this.totalSizeInBytes;
121+
}
122+
123+
/**
124+
* Human readable total_size_in_bytes
125+
* <p>
126+
* API name: {@code total_size}
127+
*/
128+
@Nullable
129+
public final String totalSize() {
130+
return this.totalSize;
131+
}
132+
104133
/**
105134
* Serialize this object to JSON.
106135
*/
@@ -120,6 +149,14 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
120149
generator.write(this.deleted);
121150

122151
}
152+
generator.writeKey("total_size_in_bytes");
153+
generator.write(this.totalSizeInBytes);
154+
155+
if (this.totalSize != null) {
156+
generator.writeKey("total_size");
157+
generator.write(this.totalSize);
158+
159+
}
123160

124161
}
125162

@@ -140,6 +177,11 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
140177
@Nullable
141178
private Long deleted;
142179

180+
private Long totalSizeInBytes;
181+
182+
@Nullable
183+
private String totalSize;
184+
143185
/**
144186
* Required - Total number of non-deleted documents across all primary shards
145187
* assigned to selected nodes. This number is based on documents in Lucene
@@ -165,6 +207,28 @@ public final Builder deleted(@Nullable Long value) {
165207
return this;
166208
}
167209

210+
/**
211+
* Required - Returns the total size in bytes of all documents in this stats.
212+
* This value may be more reliable than store_stats.size_in_bytes in estimating
213+
* the index size.
214+
* <p>
215+
* API name: {@code total_size_in_bytes}
216+
*/
217+
public final Builder totalSizeInBytes(long value) {
218+
this.totalSizeInBytes = value;
219+
return this;
220+
}
221+
222+
/**
223+
* Human readable total_size_in_bytes
224+
* <p>
225+
* API name: {@code total_size}
226+
*/
227+
public final Builder totalSize(@Nullable String value) {
228+
this.totalSize = value;
229+
return this;
230+
}
231+
168232
@Override
169233
protected Builder self() {
170234
return this;
@@ -195,6 +259,8 @@ protected static void setupDocStatsDeserializer(ObjectDeserializer<DocStats.Buil
195259

196260
op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count");
197261
op.add(Builder::deleted, JsonpDeserializer.longDeserializer(), "deleted");
262+
op.add(Builder::totalSizeInBytes, JsonpDeserializer.longDeserializer(), "total_size_in_bytes");
263+
op.add(Builder::totalSize, JsonpDeserializer.stringDeserializer(), "total_size");
198264

199265
}
200266

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/FielddataStats.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public class FielddataStats implements JsonpSerializable {
7171

7272
private final Map<String, FieldMemoryUsage> fields;
7373

74+
private final GlobalOrdinalsStats globalOrdinals;
75+
7476
// ---------------------------------------------------------------------------------------------
7577

7678
private FielddataStats(Builder builder) {
@@ -79,6 +81,7 @@ private FielddataStats(Builder builder) {
7981
this.memorySize = builder.memorySize;
8082
this.memorySizeInBytes = ApiTypeHelper.requireNonNull(builder.memorySizeInBytes, this, "memorySizeInBytes", 0);
8183
this.fields = ApiTypeHelper.unmodifiable(builder.fields);
84+
this.globalOrdinals = ApiTypeHelper.requireNonNull(builder.globalOrdinals, this, "globalOrdinals");
8285

8386
}
8487

@@ -116,6 +119,13 @@ public final Map<String, FieldMemoryUsage> fields() {
116119
return this.fields;
117120
}
118121

122+
/**
123+
* Required - API name: {@code global_ordinals}
124+
*/
125+
public final GlobalOrdinalsStats globalOrdinals() {
126+
return this.globalOrdinals;
127+
}
128+
119129
/**
120130
* Serialize this object to JSON.
121131
*/
@@ -151,6 +161,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
151161
generator.writeEnd();
152162

153163
}
164+
generator.writeKey("global_ordinals");
165+
this.globalOrdinals.serialize(generator, mapper);
154166

155167
}
156168

@@ -177,6 +189,8 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
177189
@Nullable
178190
private Map<String, FieldMemoryUsage> fields;
179191

192+
private GlobalOrdinalsStats globalOrdinals;
193+
180194
/**
181195
* API name: {@code evictions}
182196
*/
@@ -231,6 +245,22 @@ public final Builder fields(String key,
231245
return fields(key, fn.apply(new FieldMemoryUsage.Builder()).build());
232246
}
233247

248+
/**
249+
* Required - API name: {@code global_ordinals}
250+
*/
251+
public final Builder globalOrdinals(GlobalOrdinalsStats value) {
252+
this.globalOrdinals = value;
253+
return this;
254+
}
255+
256+
/**
257+
* Required - API name: {@code global_ordinals}
258+
*/
259+
public final Builder globalOrdinals(
260+
Function<GlobalOrdinalsStats.Builder, ObjectBuilder<GlobalOrdinalsStats>> fn) {
261+
return this.globalOrdinals(fn.apply(new GlobalOrdinalsStats.Builder()).build());
262+
}
263+
234264
@Override
235265
protected Builder self() {
236266
return this;
@@ -263,6 +293,7 @@ protected static void setupFielddataStatsDeserializer(ObjectDeserializer<Fieldda
263293
op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size");
264294
op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes");
265295
op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(FieldMemoryUsage._DESERIALIZER), "fields");
296+
op.add(Builder::globalOrdinals, GlobalOrdinalsStats._DESERIALIZER, "global_ordinals");
266297

267298
}
268299

0 commit comments

Comments
 (0)