Class Transport

java.lang.Object
org.apache.beam.sdk.extensions.gcp.util.Transport

public class Transport extends Object
Helpers for cloud communication.
  • 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

      public static Storage.Builder newStorageClient(GcsOptions options)
      Returns a Cloud Storage client builder using the specified GcsOptions.
    • withMetricsContainer

      public static com.google.api.client.http.HttpRequestInitializer withMetricsContainer(com.google.api.client.http.HttpRequestInitializer base, @Nullable MetricsContainer container, boolean isWrite)
      Wraps an HttpRequestInitializer so that HTTP execute and response interceptors increment Counter instances pre-bound to the given MetricsContainer. 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_count counts every attempt, retries included, because the request interceptor runs once per attempt.
      • status_2xx, status_3xx, status_4xx, status_5xx, status_other (1xx) and request_no_response add up to request_count when no retries occur. If their sum is smaller than request_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) or request_count_other (anything that is not a GET, e.g. a batched metadata POST). Their sum equals request_count. Writes are not classified this way, as they are POSTs and PUTs by construction.

      Note that request_count_unbounded counts metadata GETs as well as full object reads, since neither carries a Range header.