MCPcopy Create free account
hub / github.com/grpc/grpc-java / startLbRpc

Method startLbRpc

grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java:421–445  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

419 }
420
421 private void startLbRpc() {
422 checkState(lbStream == null, "previous lbStream has not been cleared yet");
423 LoadBalancerGrpc.LoadBalancerStub stub = LoadBalancerGrpc.newStub(lbCommChannel);
424 lbStream = new LbStream(stub);
425 Context prevContext = context.attach();
426 try {
427 lbStream.start();
428 } finally {
429 context.detach(prevContext);
430 }
431 stopwatch.reset().start();
432
433 LoadBalanceRequest initRequest = LoadBalanceRequest.newBuilder()
434 .setInitialRequest(InitialLoadBalanceRequest.newBuilder()
435 .setName(serviceName).build())
436 .build();
437 logger.log(
438 ChannelLogLevel.DEBUG,
439 "[grpclb-<{0}>] Sent initial grpclb request {1}", serviceName, initRequest);
440 try {
441 lbStream.lbRequestWriter.onNext(initRequest);
442 } catch (Exception e) {
443 lbStream.close(e);
444 }
445 }
446
447 private void cancelFallbackTimer() {
448 if (fallbackTimer != null) {

Callers 3

handleAddressesMethod · 0.95
runMethod · 0.80
handleStreamClosedMethod · 0.80

Calls 11

newStubMethod · 0.95
setNameMethod · 0.80
startMethod · 0.65
detachMethod · 0.65
resetMethod · 0.65
buildMethod · 0.65
onNextMethod · 0.65
closeMethod · 0.65
attachMethod · 0.45
newBuilderMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected