Skip to content

[pos][native] Use okhttp instead of airlift.http in pos native#25797

Merged
shrinidhijoshi merged 1 commit into
prestodb:masterfrom
shrinidhijoshi:pos-native-j17-changes-v2
Aug 18, 2025
Merged

[pos][native] Use okhttp instead of airlift.http in pos native#25797
shrinidhijoshi merged 1 commit into
prestodb:masterfrom
shrinidhijoshi:pos-native-j17-changes-v2

Conversation

@shrinidhijoshi

@shrinidhijoshi shrinidhijoshi commented Aug 15, 2025

Copy link
Copy Markdown
Collaborator

Description

After the Jetty upgrade, we can no longer run presto-on-spark native on JDK8/11. This is because presto-on-spark (pos) native relies on airlift.http-client to communicate between the JVM code and the Cpp sidecar.
But, with jetty upgrade, min JDK version is 17.

This PR replaces the jetty http client with okhttp in the presto-on-spark native codepath.

To do this it does 2 things

  1. Replace direct usages of http-client , http-server from the pos native codepath
  2. Remove dependency on drift-client and drift-transport-api which were added previously.

Below are exhaustive list of changes to achieve this

  1. Remove http-client, http-server dependency
  • We add new classes that replace the HttpClient functionality - OkHttpResponseHandler, OkHttpBaseResponse, (dto) OkHttpHeaderName.
  • We also update other classes in com.facebook.presto.spark.execution.http which relied on http client metadata classes (headers, http status , header string constants) with either okhttp alternatives where available, or google/apache commons libs where okhttp alternative is not available.
  1. Remove drift dependency

    • Add new inline class for handling http responses PagesResponseHandler.
      This enables deletion/cleanup of the
      • HttpRpcShuffleClient
      • HttpAndThriftRpcShuffleClientProvider,
      • HttpShuffleClientProvider
      • ThriftRpcShuffleClient
      • ThriftShuffleClientProvider
  2. Finally we have also updated the pom Remove pom dependency on http-client, http-server, drift-client , drift-transport-api

Test Plan

CI tests

== NO RELEASE NOTE ==

@shrinidhijoshi shrinidhijoshi requested a review from a team as a code owner August 15, 2025 05:11
@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Aug 15, 2025
@shrinidhijoshi shrinidhijoshi force-pushed the pos-native-j17-changes-v2 branch 2 times, most recently from ea5165f to 2090bc2 Compare August 15, 2025 16:18
@shrinidhijoshi shrinidhijoshi changed the title [WIP][do-not-review][pos][native] Use okhttp instead of airlift.http in pos native [pos][native] Use okhttp instead of airlift.http in pos native Aug 15, 2025
rschlussel
rschlussel previously approved these changes Aug 15, 2025
}

@Test
@Ignore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you disable this test? Add ac comment and link to an issue. Also, use @Test(enabled=false) instead of @ignore

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a github issue with details and updated disablement

@shrinidhijoshi shrinidhijoshi force-pushed the pos-native-j17-changes-v2 branch from d0d2620 to a77ed8d Compare August 18, 2025 06:19
@shrinidhijoshi

Copy link
Copy Markdown
Collaborator Author

@rschlussel Addressed comments. Please check. Thanks!

@shrinidhijoshi shrinidhijoshi merged commit f5f0bb7 into prestodb:master Aug 18, 2025
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:Meta PR from Meta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants