sundapeng opened a new pull request, #10308: URL: https://github.com/apache/paimon/pull/10308
### Purpose REST catalog requests from Java carry httpclient's default User-Agent, `Apache-HttpClient/5.5.1 (Java/<version>)`, so Paimon clients can't be told apart from other Java clients in the catalog server's request logs. Hadoop PVFS replaces it with a bare `HadoopPVFS`, which carries no version. REST requests now carry Paimon's unified User-Agent format, `<module>(<transport>[;<feature>...])[ <extended>]`, the one the OSS requests adopt as well: - `Paimon/<version>(Apache-HttpClient/<version>)` for every client built by `HttpClientUtils`, including the DLF ECS token loader. Both versions are written in at build time by the `templating-maven-plugin`, so no class loader lookup is involved. - A user-set `header.User-Agent` still takes precedence, so engines that set their own User-Agent are unaffected. - Hadoop PVFS adds itself as a feature. Examples, captured by the mock REST server: | Client | User-Agent | |---|---| | REST catalog | `Paimon/2.2-SNAPSHOT(Apache-HttpClient/5.5.1)` | | REST catalog with `header.User-Agent=starrocks/user` | `starrocks/user` | | Hadoop PVFS | `Paimon/2.2-SNAPSHOT(Apache-HttpClient/5.5.1;HadoopPVFS)` | Related: #10306 (Java OSS). The two only share the `templating-maven-plugin` entry in the root `pom.xml`. ### Tests `HttpClientUtilsTest`, `MockRESTCatalogTest` and `MockRestVirtualFileSystemTest`: 4 new cases, all passed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
