diff --git a/gax-grpc/BUILD.bazel b/gax-grpc/BUILD.bazel index 29fac3b41..53b09f14f 100644 --- a/gax-grpc/BUILD.bazel +++ b/gax-grpc/BUILD.bazel @@ -24,6 +24,7 @@ _COMPILE_DEPS = [ "@com_google_http_client_google_http_client//jar", "@io_grpc_grpc_java//context:context", "@io_grpc_grpc_netty_shaded//jar", + "@io_grpc_grpc_grpclb//jar", "@io_grpc_grpc_java//alts:alts", "@io_netty_netty_tcnative_boringssl_static//jar", "@javax_annotation_javax_annotation_api//jar", diff --git a/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java b/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java index e22f14122..c958c66f6 100644 --- a/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java +++ b/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java @@ -31,13 +31,22 @@ import com.google.api.core.ApiClock; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.threeten.bp.Duration; +/** + * A watchdog provider which always returns the same watchdog instance provided to the provider + * during construction. + * + *
This is the internal class and is public only for technical reasons. It may change any time + * without notice, please do not depend on it explicitly. + */ @BetaApi("The surface for streaming is not stable yet and may change in the future.") -public class FixedWatchdogProvider implements WatchdogProvider { +@InternalApi +public final class FixedWatchdogProvider implements WatchdogProvider { @Nullable private final Watchdog watchdog; public static WatchdogProvider create(Watchdog watchdog) { diff --git a/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java b/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java index b33c57048..b63d0ca99 100644 --- a/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java +++ b/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java @@ -31,13 +31,21 @@ import com.google.api.core.ApiClock; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; import com.google.common.base.Preconditions; import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.threeten.bp.Duration; +/** + * A watchdog provider which instantiates a new provider on every request. + * + *
This is the internal class and is public only for technical reasons. It may change any time
+ * without notice, please do not depend on it explicitly.
+ */
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
+@InternalApi
public final class InstantiatingWatchdogProvider implements WatchdogProvider {
@Nullable private final ApiClock clock;
@Nullable private final ScheduledExecutorService executor;
diff --git a/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java b/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java
index 038bb1f3e..62ff8c4ae 100644
--- a/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java
+++ b/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java
@@ -30,7 +30,7 @@
package com.google.api.gax.rpc;
import com.google.api.core.ApiClock;
-import com.google.api.core.InternalApi;
+import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.common.base.Preconditions;
import java.util.Iterator;
@@ -59,8 +59,8 @@
* had no outstanding demand. Duration.ZERO disables the timeout.
*
*/
-@InternalApi
-public class Watchdog implements Runnable, BackgroundResource {
+@BetaApi
+public final class Watchdog implements Runnable, BackgroundResource {
// Dummy value to convert the ConcurrentHashMap into a Set
private static Object PRESENT = new Object();
private final ConcurrentHashMap