Watchdog (Cloud Bigtable HBase Client for Java 1.12.0 API)

com.google.cloud.bigtable.grpc.io

Class Watchdog

  • All Implemented Interfaces:
    Runnable


    @InternalApi
    public class Watchdog
    extends Object
    implements Runnable
    Prevents the streams from hanging indefinitely. This middleware garbage collects idle streams in case the user forgot to close a ClientCall or if a connection is reset and GRPC does not get notified.

    Periodically this class checks two thresholds:

    • waitingTimeout: the amount of time to wait for a response (after the caller signaled demand) before forcefully closing the stream.
    • idleTimeout: the amount of time to wait before assuming that the caller forgot to close the stream and forcefully closing the stream. This is measured from the last time the caller had no outstanding demand.

    • Constructor Detail

      • Watchdog

        public Watchdog(com.google.api.client.util.Clock clock,
                        long waitTimeoutMs)
      • Watchdog

        public Watchdog(com.google.api.client.util.Clock clock,
                        long waitTimeoutMs,
                        long idleTimeoutMs)
    • Method Detail

      • watch

        public <ReqT,RespT> io.grpc.ClientCall<ReqT,RespT> watch(io.grpc.ClientCall<ReqT,RespT> innerCall)
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • stop

        public void stop()