Package io.deephaven.barrage.util
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 -
Method Summary
Modifier and TypeMethodDescriptionio.deephaven.shadow.client.flight.io.grpc.ConnectivityStategetState(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel, boolean requestReconnection) Should implement io.grpc.ManagedChannel.getStatebooleanisDown(io.deephaven.shadow.client.flight.io.grpc.ConnectivityState state) Check if the channel is downbooleanisShutdown(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel) True if the channel is shutdown.booleanisTerminated(io.deephaven.shadow.client.flight.io.grpc.ManagedChannel channel) True if the channel is terminated.voidnotifyWhenStateChanged(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 implementManagedChannel.notifyWhenStateChanged
-
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.ChannelStateReaderShould implement io.grpc.ManagedChannel.getState- Specified by:
getStatein interfaceFailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState> - Parameters:
channel- the channelrequestReconnection- 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.ChannelStateReaderCheck if the channel is down- Specified by:
isDownin interfaceFailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState> - Parameters:
state- a value returned bygetState- 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.ChannelStateReaderRequest a notification the next time the channel changes state, should implementManagedChannel.notifyWhenStateChanged- Specified by:
notifyWhenStateChangedin interfaceFailedChannelDetector.ChannelStateReader<io.deephaven.shadow.client.flight.io.grpc.ManagedChannel,io.deephaven.shadow.client.flight.io.grpc.ConnectivityState> - Parameters:
channel- the channelstate- a state as returned bygetStatecallback- 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.ChannelStateReaderTrue if the channel is shutdown. Should implementManagedChannel.isShutdown()- Specified by:
isShutdownin interfaceFailedChannelDetector.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.ChannelStateReaderTrue if the channel is terminated. Should implementManagedChannel.isTerminated()- Specified by:
isTerminatedin interfaceFailedChannelDetector.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.
-