Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Remove InternalApi from Watchdog, and add InternalApi to FixedWatchdogProvider #881

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -31,12 +31,14 @@

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;

@BetaApi("The surface for streaming is not stable yet and may change in the future.")
@InternalApi
public class FixedWatchdogProvider implements WatchdogProvider {
@Nullable private final Watchdog watchdog;

Expand Down
2 changes: 0 additions & 2 deletions gax/src/main/java/com/google/api/gax/rpc/Watchdog.java
Expand Up @@ -30,7 +30,6 @@
package com.google.api.gax.rpc;

import com.google.api.core.ApiClock;
import com.google.api.core.InternalApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.common.base.Preconditions;
import java.util.Iterator;
Expand Down Expand Up @@ -59,7 +58,6 @@
* had no outstanding demand. Duration.ZERO disables the timeout.
* </ul>
*/
@InternalApi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EndUsers should really not be setting Watchdogs directly. However if you insist on continuing on with this PR, at least mark this as BetaApi, since its api was never reviewed for public consumption and please mark it as final so that users don't try to extend it

Copy link
Contributor Author

@yihanzhen yihanzhen Feb 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But isn't marking a class as @BetaApi considered breaking change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that since its marked InternalOnly, we are allowed to change this class in any way we see fit.

public class Watchdog implements Runnable, BackgroundResource {
// Dummy value to convert the ConcurrentHashMap into a Set
private static Object PRESENT = new Object();
Expand Down