aistore.sdk.etl.webserver.utils
Module Contents
Classes
Functions
API
Wrap a requests.Response so close() releases the connection to the pool.
resp.raw.close() closes the socket but skips resp.close()‘s release_conn() call, which returns the socket to the keep-alive pool. Under early-close (mid-stream errors, client disconnects), that leaks connections. All reads are delegated to resp.raw; everything else falls through to resp.raw.
Close the response so requests releases the connection to the pool.
Read bytes from the underlying raw response stream.
Compose the final direct PUT URL by combining components from multiple URLs.
Scenarios:
- Pipeline stage: direct_put_url has no path → append object path.
- Offline transform: direct_put_url has a path → prepend host_target path (e.g. “/v1/etl/_object/<etl-name>/<etl-secret>/”) to validate request.
Returns: str: Complete direct PUT URL targeting the correct AIS node.
Parameters:
Destination node’s direct PUT URL, possibly with path/query.
Base AIS target URL used for scheme and base path.
Path of the object to PUT.
Parse ETL pipeline from header value with validation.
Parameters:
Comma-separated pipeline URLs
Returns: str
Tuple of (first_url, remaining_pipeline_header)
Raises:
InvalidPipelineError: If pipeline header is malformed
Pickle and base64-encode a user-provided ETLServer subclass for transmission.
Parameters:
A subclass of ETLServer to serialize.
The string encoding for the Base64 payload.
Returns: str
A Base64 string containing the pickled class.
Raises:
TypeError: Ifclsis not a subclass of ETLServer.