Class FlightGrpcShadowChannelStateReader

java.lang.Object
io.deephaven.barrage.util.FlightGrpcShadowChannelStateReader
All Implemented Interfaces:
FailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState>

public class FlightGrpcShadowChannelStateReader extends Object implements FailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState>
Implementation of ChannelStateReader for Barrage shadowed gRPC
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.deephaven.shadow.client.flight.io.grpc.ConnectivityState
    getState(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel, boolean requestReconnection)
    Should implement io.grpc.ManagedChannel.getState
    boolean
    isDown(io.deephaven.shadow.client.flight.io.grpc.ConnectivityState state)
    Check if the channel is down
    boolean
    isShutdown(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel)
    True if the channel is shutdown.
    boolean
    isTerminated(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel)
    True if the channel is terminated.
    void
    notifyWhenStateChanged(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel, io.deephaven.shadow.client.flight.io.grpc.ConnectivityState state, Runnable callback)
    Request a notification the next time the channel changes state, should implement ManagedChannel.notifyWhenStateChanged

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FlightGrpcShadowChannelStateReader

      public FlightGrpcShadowChannelStateReader()
  • Method Details

    • getState

      public io.deephaven.shadow.client.flight.io.grpc.ConnectivityState getState(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel, boolean requestReconnection)
      Description copied from interface: FailedChannelDetector.ChannelStateReader
      Should implement io.grpc.ManagedChannel.getState
      Specified by:
      getState in interface FailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState>
      Parameters:
      channel - the channel
      requestReconnection - true to reconnect IDLE channels
      Returns:
      channel.getState(reconnect)
    • isDown

      public boolean isDown(io.deephaven.shadow.client.flight.io.grpc.ConnectivityState state)
      Description copied from interface: FailedChannelDetector.ChannelStateReader
      Check if the channel is down
      Specified by:
      isDown in interface FailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState>
      Parameters:
      state - a value returned by getState
      Returns:
      true if the state represents a state that is not READY for the channel
    • notifyWhenStateChanged

      public void notifyWhenStateChanged(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel, io.deephaven.shadow.client.flight.io.grpc.ConnectivityState state, Runnable callback)
      Description copied from interface: FailedChannelDetector.ChannelStateReader
      Request a notification the next time the channel changes state, should implement ManagedChannel.notifyWhenStateChanged
      Specified by:
      notifyWhenStateChanged in interface FailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState>
      Parameters:
      channel - the channel
      state - a state as returned by getState
      callback - a callback to invoke on the next change of state.
    • isShutdown

      public boolean isShutdown(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel)
      Description copied from interface: FailedChannelDetector.ChannelStateReader
      True if the channel is shutdown. Should implement ManagedChannel.isShutdown()
      Specified by:
      isShutdown in interface FailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState>
      Parameters:
      channel - the channel
      Returns:
      true if the channel is shutdown.
    • isTerminated

      public boolean isTerminated(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel)
      Description copied from interface: FailedChannelDetector.ChannelStateReader
      True if the channel is terminated. Should implement ManagedChannel.isTerminated()
      Specified by:
      isTerminated in interface FailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState>
      Parameters:
      channel - the channel
      Returns:
      true if the channel is terminated.