Class Transport
java.lang.Object
org.apache.beam.sdk.extensions.gcp.util.Transport
Helpers for cloud communication.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.api.client.json.JsonFactorystatic com.google.api.client.http.HttpTransportstatic Storage.BuildernewStorageClient(GcsOptions options) Returns a Cloud Storage client builder using the specifiedGcsOptions.static com.google.api.client.http.HttpRequestInitializerwithMetricsContainer(com.google.api.client.http.HttpRequestInitializer base, MetricsContainer container, boolean isWrite) Wraps anHttpRequestInitializerso that HTTP execute and response interceptors incrementCounterinstances pre-bound to the givenMetricsContainer.
-
Constructor Details
-
Transport
public Transport()
-
-
Method Details
-
getTransport
public static com.google.api.client.http.HttpTransport getTransport() -
getJsonFactory
public static com.google.api.client.json.JsonFactory getJsonFactory() -
newStorageClient
Returns a Cloud Storage client builder using the specifiedGcsOptions. -
withMetricsContainer
public static com.google.api.client.http.HttpRequestInitializer withMetricsContainer(com.google.api.client.http.HttpRequestInitializer base, @Nullable MetricsContainer container, boolean isWrite) Wraps anHttpRequestInitializerso that HTTP execute and response interceptors incrementCounterinstances pre-bound to the givenMetricsContainer. This guarantees that GCS HTTP metrics are attributed directly to the step that created the channel, even when requests execute on background worker threads.request_countcounts every attempt, retries included, because the request interceptor runs once per attempt.status_2xx,status_3xx,status_4xx,status_5xx,status_other(1xx) andrequest_no_responseadd up torequest_countwhen no retries occur. If their sum is smaller thanrequest_count, it indicates that retries happened, as only the final response is recorded while multiple requests are counted.- For reads, every attempt is also classified by shape into
request_count_ranged(a GET with a Range header),request_count_unbounded(a GET without one) orrequest_count_other(anything that is not a GET, e.g. a batched metadata POST). Their sum equalsrequest_count. Writes are not classified this way, as they are POSTs and PUTs by construction.
Note that
request_count_unboundedcounts metadata GETs as well as full object reads, since neither carries a Range header.
-