Skip to content

Commit 2db41bb

Browse files
committed
Changes
1 parent adeee35 commit 2db41bb

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/eson/ESONDeserializationBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public void writeJSONFromESON(Blackhole bh) throws IOException {
130130
@Benchmark
131131
public void writeJSONFromESONFlatten(Blackhole bh) throws IOException {
132132
XContentBuilder builder = XContentFactory.contentBuilder(JsonXContent.jsonXContent.type());
133-
ESONXContentSerializer.flattenedToXContent(esonObject, builder, ToXContent.EMPTY_PARAMS);
133+
ESONXContentSerializer.flattenToXContent(esonObject, builder, ToXContent.EMPTY_PARAMS);
134134
BytesReference bytes = BytesReference.bytes(builder);
135135
bh.consume(bytes);
136136
}

server/src/main/java/org/elasticsearch/action/bulk/TransportAbstractBulkAction.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,6 @@ private void applyPipelinesAndDoInternalExecute(
402402
) throws IOException {
403403
final long relativeStartTimeNanos = relativeTimeNanos();
404404
if (applyPipelines(task, bulkRequest, executor, listener) == false) {
405-
for (DocWriteRequest<?> docWriteRequest : bulkRequest.requests()) {
406-
if (docWriteRequest instanceof IndexRequest indexRequest) {
407-
indexRequest.flattenAndSerializeStructuredSource();
408-
}
409-
}
410405
doInternalExecute(task, bulkRequest, executor, listener, relativeStartTimeNanos);
411406
}
412407
}

server/src/main/java/org/elasticsearch/action/index/IndexRequest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,8 @@ public BytesReference source() {
425425
public void setStructuredSource(ESONSource.ESONObject esonSource) {
426426
this.useStructuredSource = true;
427427
this.structuredSource = esonSource;
428-
}
429-
430-
public void flattenAndSerializeStructuredSource() {
431-
this.structuredSource = ESONSource.flatten(this.structuredSource);
432428
try (XContentBuilder builder = XContentFactory.contentBuilder(contentType)) {
433-
ESONXContentSerializer.flattenedToXContent(this.structuredSource, builder, ToXContent.EMPTY_PARAMS);
429+
ESONXContentSerializer.flattenToXContent(esonSource, builder, ToXContent.EMPTY_PARAMS);
434430
source = BytesReference.bytes(builder);
435431
} catch (IOException e) {
436432
throw new UncheckedIOException(e);

server/src/main/java/org/elasticsearch/ingest/ESONXContentSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private static class ContainerState {
4444
* Efficient toXContent for flattened ESON structures.
4545
* Performs a single pass through the key array with a stack to track nesting.
4646
*/
47-
public static XContentBuilder flattenedToXContent(ESONSource.ESONObject rootObject, XContentBuilder builder, ToXContent.Params params)
47+
public static XContentBuilder flattenToXContent(ESONSource.ESONObject rootObject, XContentBuilder builder, ToXContent.Params params)
4848
throws IOException {
4949
List<ESONSource.KeyEntry> keyArray = rootObject.getKeyArray();
5050
ESONSource.Values values = rootObject.objectValues();

0 commit comments

Comments
 (0)