You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The es6 and es7 clients still process every scroll / search_after page in three passes: the client library parses the HTTP response into its typed form, the bridge re-serializes that typed form to a JSON string, and core parseResponse re-parses the string into the Jackson tree the row parser actually consumes. PR #227 removed this triple pass for es8/es9 (document type ObjectNode + TokenBuffer, single parse), where it was measured at ~19% of Flight sidecar CPU during JOIN leg extraction (softclient4es-arrow#160) — a cost that scales with the number and width of the selected columns, string columns worst.
Evidence
es7 REST — es7/rest/src/main/scala/app/softnetwork/elastic/client/rest/RestHighLevelClientApi.scala:1672 and :1810: extractHitsOnly(response.toString, …). The RHLC parsed the HTTP response into its typed SearchResponse (pass 1); response.toString re-serializes it via XContent (pass 2); core parseResponse re-parses with Jackson (pass 3).
es6 REST — es6/rest/src/main/scala/app/softnetwork/elastic/client/rest/RestHighLevelClientApi.scala:1639 plus extractAllResults at :1493/:1528: same shape.
es6 Jest — es6/jest/src/main/scala/app/softnetwork/elastic/client/jest/JestScrollApi.scala:218 (and the extractAllResults call sites at :83/:112): result.getJsonObject.toString — Gson already parsed the response (pass 1), .toString re-serializes it (pass 2), Jackson re-parses (pass 3).
Why the #227 technique does not transplant directly
The es8/es9 fix re-parents already-parsed Jackson_source trees into the envelope. RHLC holds XContent objects and Jest holds a Gson tree — there is no Jackson node to re-parent. Candidate approaches, per client:
es7 / es6 REST: issue the paging search/scroll over the RHLC's low-level RestClient and Jackson-parse the raw response entity bytes once → parseSingleSearchResponse (the node-level core entry perf(client): parse each Elasticsearch page once on the scroll hits path (softclient4es-arrow#160) #227 already uses). This removes even the typed parse — one pass total. The typed request builders can still build the request body; only the response side changes. Care: shard-failure checks and _scroll_id/sort cursor extraction currently read the typed response and would need to read the tree instead.
es6 Jest: check whether JestResult.getJsonString retains the raw response body — if so, getJsonString → Jackson readTree drops the Gson re-serialization for a one-line win (two parses instead of three). The full fix is a direct Gson→Jackson tree walk (no string at all), or bypassing Jest's Gson parse for the scroll action.
The core node-level entry (parseSingleSearchResponse) and the envelope contract pinned by JavaClientConversionSpec (es8/es9) are reusable; a port of that spec should accompany each client's migration.
The es6 and es7 clients still process every scroll / search_after page in three passes: the client library parses the HTTP response into its typed form, the bridge re-serializes that typed form to a JSON string, and core
parseResponsere-parses the string into the Jackson tree the row parser actually consumes. PR #227 removed this triple pass for es8/es9 (document typeObjectNode+TokenBuffer, single parse), where it was measured at ~19% of Flight sidecar CPU during JOIN leg extraction (softclient4es-arrow#160) — a cost that scales with the number and width of the selected columns, string columns worst.Evidence
es7/rest/src/main/scala/app/softnetwork/elastic/client/rest/RestHighLevelClientApi.scala:1672and:1810:extractHitsOnly(response.toString, …). The RHLC parsed the HTTP response into its typedSearchResponse(pass 1);response.toStringre-serializes it via XContent (pass 2); coreparseResponsere-parses with Jackson (pass 3).es6/rest/src/main/scala/app/softnetwork/elastic/client/rest/RestHighLevelClientApi.scala:1639plusextractAllResultsat:1493/:1528: same shape.es6/jest/src/main/scala/app/softnetwork/elastic/client/jest/JestScrollApi.scala:218(and theextractAllResultscall sites at:83/:112):result.getJsonObject.toString— Gson already parsed the response (pass 1),.toStringre-serializes it (pass 2), Jackson re-parses (pass 3).Why the #227 technique does not transplant directly
The es8/es9 fix re-parents already-parsed Jackson
_sourcetrees into the envelope. RHLC holds XContent objects and Jest holds a Gson tree — there is no Jackson node to re-parent. Candidate approaches, per client:RestClientand Jackson-parse the raw response entity bytes once →parseSingleSearchResponse(the node-level core entry perf(client): parse each Elasticsearch page once on the scroll hits path (softclient4es-arrow#160) #227 already uses). This removes even the typed parse — one pass total. The typed request builders can still build the request body; only the response side changes. Care: shard-failure checks and_scroll_id/sortcursor extraction currently read the typed response and would need to read the tree instead.JestResult.getJsonStringretains the raw response body — if so,getJsonString→ JacksonreadTreedrops the Gson re-serialization for a one-line win (two parses instead of three). The full fix is a direct Gson→Jackson tree walk (no string at all), or bypassing Jest's Gson parse for the scroll action.Notes
Include.NON_NULLdropping null-valued_sourceentries on re-serialization) applies here too and currently makes es6/es7 row key-sets differ from es8/es9's scroll paths forSELECT *-shaped queries.parseSingleSearchResponse) and the envelope contract pinned byJavaClientConversionSpec(es8/es9) are reusable; a port of that spec should accompany each client's migration.