Watchdog (Cloud Bigtable HBase Client for Java 1.12.0 API)

Class Watchdog

  • All Implemented Interfaces:

    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( clock,
                        long waitTimeoutMs)
      • Watchdog

        public Watchdog( 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()