Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import co.elastic.clients.util.BinaryData;

import javax.annotation.Nullable;
import java.util.List;

/**
* A bulk operation whose size has been calculated and content turned to a binary blob (to compute its size).
Expand Down Expand Up @@ -212,6 +213,23 @@ private static int size(String name, @Nullable JsonEnum value) {
}
}

private static int size(String name, @Nullable List<String> value) {
if (value != null) {
if (value.isEmpty()) {
return name.length() + 6; // 6 added chars for empty array "name":[],
}
int listSize = 0;
for (String item : value) {
listSize += item.length();
listSize += 2; // +2 quotes each item
}
listSize += value.size()-1 ; // +1 comma between each item
return name.length() + listSize + 6; // "name":["item1","item2","item3"],
} else {
return 0;
}
}

private static int basePropertiesSize(BulkOperationBase op) {
return
size("id", op.id()) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>

private Integer status;

public Builder() {
}
private Builder(BulkIndexByScrollFailure instance) {
this.cause = instance.cause;
this.id = instance.id;
this.index = instance.index;
this.status = instance.status;

}
/**
* Required - API name: {@code cause}
*/
Expand Down Expand Up @@ -215,6 +224,12 @@ public BulkIndexByScrollFailure build() {
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement

private Long avgSizeInBytes;

public Builder() {
}
private Builder(BulkStats instance) {
this.totalOperations = instance.totalOperations;
this.totalTime = instance.totalTime;
this.totalTimeInMillis = instance.totalTimeInMillis;
this.totalSize = instance.totalSize;
this.totalSizeInBytes = instance.totalSizeInBytes;
this.avgTime = instance.avgTime;
this.avgTimeInMillis = instance.avgTimeInMillis;
this.avgSize = instance.avgSize;
this.avgSizeInBytes = instance.avgSizeInBytes;

}
/**
* Required - API name: {@code total_operations}
*/
Expand Down Expand Up @@ -355,6 +369,12 @@ public BulkStats build() {
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement

private Double y;

public Builder() {
}
private Builder(CartesianPoint instance) {
this.x = instance.x;
this.y = instance.y;

}
/**
* Required - API name: {@code x}
*/
Expand Down Expand Up @@ -158,6 +165,12 @@ public CartesianPoint build() {
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private ChunkRescorerChunkingSettings chunkingSettings;

public Builder() {
}
private Builder(ChunkRescorer instance) {
this.size = instance.size;
this.chunkingSettings = instance.chunkingSettings;

}
/**
* The number of chunks per document to evaluate for reranking.
* <p>
Expand Down Expand Up @@ -188,6 +195,12 @@ public ChunkRescorer build() {
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private List<ShardFailure> failures;

public Builder() {
}
private Builder(ClusterDetails instance) {
this.status = instance.status;
this.indices = instance.indices;
this.took = instance.took;
this.timedOut = instance.timedOut;
this.shards = instance.shards;
this.failures = instance.failures;

}
/**
* Required - API name: {@code status}
*/
Expand Down Expand Up @@ -300,6 +311,12 @@ public ClusterDetails build() {
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private Map<String, ClusterDetails> details;

public Builder() {
}
private Builder(ClusterStatistics instance) {
this.skipped = instance.skipped;
this.successful = instance.successful;
this.total = instance.total;
this.running = instance.running;
this.partial = instance.partial;
this.failed = instance.failed;
this.details = instance.details;

}
/**
* Required - API name: {@code skipped}
*/
Expand Down Expand Up @@ -307,6 +319,12 @@ public ClusterStatistics build() {
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package co.elastic.clients.elasticsearch._types;

import co.elastic.clients.json.JsonEnum;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;

//----------------------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------

/**
*
* @see <a href="../doc-files/api-spec.html#_types.CommonStatsFlag">API
* specification</a>
*/
@JsonpDeserializable
public enum CommonStatsFlag implements JsonEnum {
All("_all"),

Store("store"),

Indexing("indexing"),

Get("get"),

Search("search"),

Merge("merge"),

Flush("flush"),

Refresh("refresh"),

QueryCache("query_cache"),

Fielddata("fielddata"),

Docs("docs"),

Warmer("warmer"),

Completion("completion"),

Segments("segments"),

Translog("translog"),

RequestCache("request_cache"),

Recovery("recovery"),

Bulk("bulk"),

ShardStats("shard_stats"),

Mappings("mappings"),

DenseVector("dense_vector"),

SparseVector("sparse_vector"),

;

private final String jsonValue;

CommonStatsFlag(String jsonValue) {
this.jsonValue = jsonValue;
}

public String jsonValue() {
return this.jsonValue;
}

public static final JsonEnum.Deserializer<CommonStatsFlag> _DESERIALIZER = new JsonEnum.Deserializer<>(
CommonStatsFlag.values());
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private Map<String, FieldSizeUsage> fields;

public Builder() {
}
private Builder(CompletionStats instance) {
this.sizeInBytes = instance.sizeInBytes;
this.size = instance.size;
this.fields = instance.fields;

}
/**
* Required - Total amount, in bytes, of memory used for completion across all
* shards assigned to selected nodes.
Expand Down Expand Up @@ -232,6 +240,12 @@ public CompletionStats build() {
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement

private Double right;

public Builder() {
}
private Builder(CoordsGeoBounds instance) {
this.top = instance.top;
this.bottom = instance.bottom;
this.left = instance.left;
this.right = instance.right;

}
/**
* Required - API name: {@code top}
*/
Expand Down Expand Up @@ -204,6 +213,12 @@ public CoordsGeoBounds build() {
}
}

/**
* @return New {@link Builder} initialized with field values of this instance
*/
public Builder rebuild() {
return new Builder(this);
}
// ---------------------------------------------------------------------------------------------

/**
Expand Down
Loading