Package io.grpc.xds.client
Class LoadReportClient.LrsStream
- java.lang.Object
-
- io.grpc.xds.client.LoadReportClient.LrsStream
-
- All Implemented Interfaces:
XdsTransportFactory.EventHandler<LoadStatsResponse>
- Enclosing class:
- LoadReportClient
private final class LoadReportClient.LrsStream extends java.lang.Object implements XdsTransportFactory.EventHandler<LoadStatsResponse>
-
-
Field Summary
Fields Modifier and Type Field Description private XdsTransportFactory.StreamingCall<LoadStatsRequest,LoadStatsResponse>
call
(package private) boolean
closed
(package private) java.util.List<java.lang.String>
clusterNames
(package private) boolean
initialResponseReceived
(package private) long
intervalNano
(package private) io.grpc.SynchronizationContext.ScheduledHandle
loadReportTimer
(package private) boolean
reportAllClusters
-
Constructor Summary
Constructors Constructor Description LrsStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ClusterStats
buildClusterStats(Stats.ClusterStats stats)
private void
cleanUp()
private void
close(java.lang.Exception error)
(package private) void
handleRpcResponse(java.util.List<java.lang.String> clusters, boolean sendAllClusters, long loadReportIntervalNano)
private void
handleStreamClosed(io.grpc.Status status)
void
onReady()
Called when the stream is ready to send additional messages.void
onRecvMessage(LoadStatsResponse response)
Called when a message is received on the stream.void
onStatusReceived(io.grpc.Status status)
Called when status is received on the stream.private void
scheduleNextLoadReport()
private void
sendLoadReport()
(package private) void
sendLoadStatsRequest(java.util.List<Stats.ClusterStats> clusterStatsList)
-
-
-
Field Detail
-
initialResponseReceived
boolean initialResponseReceived
-
closed
boolean closed
-
intervalNano
long intervalNano
-
reportAllClusters
boolean reportAllClusters
-
clusterNames
java.util.List<java.lang.String> clusterNames
-
loadReportTimer
io.grpc.SynchronizationContext.ScheduledHandle loadReportTimer
-
call
private final XdsTransportFactory.StreamingCall<LoadStatsRequest,LoadStatsResponse> call
-
-
Method Detail
-
onReady
public void onReady()
Description copied from interface:XdsTransportFactory.EventHandler
Called when the stream is ready to send additional messages. If called the library use this handler to trigger resource arrival timeout, also seeXdsTransportFactory.StreamingCall.isReady()
. Application is free to ignore it.- Specified by:
onReady
in interfaceXdsTransportFactory.EventHandler<LoadStatsResponse>
-
onRecvMessage
public void onRecvMessage(LoadStatsResponse response)
Description copied from interface:XdsTransportFactory.EventHandler
Called when a message is received on the stream.- Specified by:
onRecvMessage
in interfaceXdsTransportFactory.EventHandler<LoadStatsResponse>
-
onStatusReceived
public void onStatusReceived(io.grpc.Status status)
Description copied from interface:XdsTransportFactory.EventHandler
Called when status is received on the stream.- Specified by:
onStatusReceived
in interfaceXdsTransportFactory.EventHandler<LoadStatsResponse>
-
sendLoadStatsRequest
void sendLoadStatsRequest(java.util.List<Stats.ClusterStats> clusterStatsList)
-
handleRpcResponse
void handleRpcResponse(java.util.List<java.lang.String> clusters, boolean sendAllClusters, long loadReportIntervalNano)
-
sendLoadReport
private void sendLoadReport()
-
scheduleNextLoadReport
private void scheduleNextLoadReport()
-
handleStreamClosed
private void handleStreamClosed(io.grpc.Status status)
-
close
private void close(java.lang.Exception error)
-
cleanUp
private void cleanUp()
-
buildClusterStats
private ClusterStats buildClusterStats(Stats.ClusterStats stats)
-
-