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) booleanclosed(package private) java.util.List<java.lang.String>clusterNames(package private) booleaninitialResponseReceived(package private) longintervalNano(package private) io.grpc.SynchronizationContext.ScheduledHandleloadReportTimer(package private) booleanreportAllClusters
-
Constructor Summary
Constructors Constructor Description LrsStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ClusterStatsbuildClusterStats(Stats.ClusterStats stats)private voidcleanUp()private voidclose(java.lang.Exception error)(package private) voidhandleRpcResponse(java.util.List<java.lang.String> clusters, boolean sendAllClusters, long loadReportIntervalNano)private voidhandleStreamClosed(io.grpc.Status status)voidonReady()Called when the stream is ready to send additional messages.voidonRecvMessage(LoadStatsResponse response)Called when a message is received on the stream.voidonStatusReceived(io.grpc.Status status)Called when status is received on the stream.private voidscheduleNextLoadReport()private voidsendLoadReport()(package private) voidsendLoadStatsRequest(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.EventHandlerCalled 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:
onReadyin interfaceXdsTransportFactory.EventHandler<LoadStatsResponse>
-
onRecvMessage
public void onRecvMessage(LoadStatsResponse response)
Description copied from interface:XdsTransportFactory.EventHandlerCalled when a message is received on the stream.- Specified by:
onRecvMessagein interfaceXdsTransportFactory.EventHandler<LoadStatsResponse>
-
onStatusReceived
public void onStatusReceived(io.grpc.Status status)
Description copied from interface:XdsTransportFactory.EventHandlerCalled when status is received on the stream.- Specified by:
onStatusReceivedin 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)
-
-