From 582e011bb69d28383a786a2a90e310bd8f976f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D1=82=D1=8B=D0=BD=D0=BE=D0=B2=20=D0=9C?= =?UTF-8?q?=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A1=D0=B5=D1=80=D0=B3=D0=B5?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Mon, 15 Apr 2024 12:25:49 +0300 Subject: [PATCH] Add compression option to HttpTtansport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Мартынов Максим Сергеевич --- docs/client/java/partials/java_transport.md | 5 +++++ docs/client/python.md | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/client/java/partials/java_transport.md b/docs/client/java/partials/java_transport.md index fc260be097..aa65b707e3 100644 --- a/docs/client/java/partials/java_transport.md +++ b/docs/client/java/partials/java_transport.md @@ -18,6 +18,7 @@ Allows sending events to HTTP endpoint, using [ApacheHTTPClient](https://hc.apac - `type` - string specifying the "api_key" or the fully qualified class name of your TokenProvider. Required if `auth` is provided. - `apiKey` - string setting the Authentication HTTP header as the Bearer. Required if `type` is `api_key`. - `headers` - dictionary specifying HTTP request headers. Optional. +- `compression` - string, name of algorithm used by HTTP client to compress request body. Optional, default value `null`, allowed values: `gzip`. Added in v1.13.0. #### Behavior @@ -63,6 +64,7 @@ transport: api_key: f38d2189-c603-4b46-bdea-e573a3b5a7d5 headers: X-Some-Extra-Header: abc + compression: gzip ``` @@ -96,6 +98,7 @@ spark.openlineage.transport.timeoutInMillis=5000 spark.openlineage.transport.auth.type=api_key spark.openlineage.transport.auth.apiKey=f38d2189-c603-4b46-bdea-e573a3b5a7d5 spark.openlineage.transport.headers.X-Some-Extra-Header=abc +spark.openlineage.transport.compression=gzip ```
URL parsing within Spark integration @@ -143,6 +146,7 @@ openlineage.transport.timeoutInMillis=5000 openlineage.transport.auth.type=api_key openlineage.transport.auth.apiKey=f38d2189-c603-4b46-bdea-e573a3b5a7d5 openlineage.transport.headers.X-Some-Extra-Header=abc +openlineage.transport.compression=gzip ``` @@ -214,6 +218,7 @@ httpConfig.setUrlParams(queryParams); httpConfig.setAuth(apiKeyTokenProvider); httpConfig.setTimeoutInMillis(headers); httpConfig.setHeaders(5000); +httpConfig.setCompression(HttpConfig.Compression.GZIP); OpenLineageClient client = OpenLineageClient.builder() .transport( diff --git a/docs/client/python.md b/docs/client/python.md index 366e1deb72..289e161267 100644 --- a/docs/client/python.md +++ b/docs/client/python.md @@ -86,6 +86,7 @@ Allows sending events to HTTP endpoint, using [requests](https://requests.readth - `auth` - dictionary specifying authentication options. Optional, by default no authorization is used. If set, requires the `type` property. - `type` - string specifying the "api_key" or the fully qualified class name of your TokenProvider. Required if `auth` is provided. - `apiKey` - string setting the Authentication HTTP header as the Bearer. Required if `type` is `api_key`. +- `compression` - string, name of algorithm used by HTTP client to compress request body. Optional, default value `null`, allowed values: `gzip`. Added in v1.13.0. #### Behavior @@ -106,6 +107,7 @@ transport: auth: type: api_key apiKey: f048521b-dfe8-47cd-9c65-0cb07d57591e + compression: gzip ``` @@ -113,7 +115,7 @@ transport: ```python from openlineage.client import OpenLineageClient -from openlineage.client.transport.http import ApiKeyTokenProvider, HttpConfig, HttpTransport +from openlineage.client.transport.http import ApiKeyTokenProvider, HttpConfig, HttpCompression, HttpTransport http_config = HttpConfig( url="https://backend:5000", @@ -121,6 +123,7 @@ http_config = HttpConfig( timeout=5, verify=False, auth=ApiKeyTokenProvider({"apiKey": "f048521b-dfe8-47cd-9c65-0cb07d57591e"}), + compression=HttpCompression.GZIP, ) client = OpenLineageClient(transport=HttpTransport(http_config))