/external/grpc-grpc-java/grpclb/src/main/java/io/grpc/grpclb/ |
CachedSubchannelPool.java | 26 import io.grpc.LoadBalancer.Subchannel; 33 * A {@link SubchannelPool} that keeps returned {@link Subchannel}s for a given time before it's 53 public Subchannel takeOrCreateSubchannel( 56 Subchannel subchannel; local 58 subchannel = helper.createSubchannel(eag, defaultAttributes); 60 subchannel = entry.subchannel; 63 return subchannel; 67 public void returnSubchannel(Subchannel subchannel) 113 private final Subchannel subchannel; field in class:CachedSubchannelPool.ShutdownSubchannelTask 134 final Subchannel subchannel; field in class:CachedSubchannelPool.CacheEntry [all...] |
SubchannelPool.java | 22 import io.grpc.LoadBalancer.Subchannel; 39 * Takes a {@link Subchannel} from the pool for the given {@code eag} if there is one available. 40 * Otherwise, creates and returns a new {@code Subchannel} with the given {@code eag} and {@code 43 Subchannel takeOrCreateSubchannel(EquivalentAddressGroup eag, Attributes defaultAttributes); 46 * Puts a {@link Subchannel} back to the pool. From this point the Subchannel is owned by the 49 void returnSubchannel(Subchannel subchannel);
|
GrpclbState.java | 40 import io.grpc.LoadBalancer.Subchannel; 138 private Map<EquivalentAddressGroup, Subchannel> subchannels = Collections.emptyMap(); 165 void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo newState) { 166 if (newState.getState() == SHUTDOWN || !(subchannels.values().contains(subchannel))) { 170 subchannel.requestConnection(); 172 subchannel.getAttributes().get(STATE_INFO).set(newState); 222 for (Subchannel subchannel : subchannels.values()) { 223 if (subchannel.getAttributes().get(STATE_INFO).get().getState() == READY) 355 Subchannel subchannel = newSubchannelMap.get(eag); local 680 Subchannel subchannel = entry.result.getSubchannel(); local [all...] |
GrpclbLoadBalancer.java | 80 public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo newState) { 83 grpclbState.handleSubchannelState(subchannel, newState);
|
/external/grpc-grpc-java/core/src/main/java/io/grpc/ |
PickFirstBalancerFactory.java | 27 import io.grpc.LoadBalancer.Subchannel; 59 private Subchannel subchannel; field in class:PickFirstBalancerFactory.PickFirstBalancer 68 if (subchannel == null) { 69 subchannel = helper.createSubchannel(servers, Attributes.EMPTY); 72 // let LB report CONNECTION and call subchannel.requestConnection() immediately. 73 helper.updateBalancingState(CONNECTING, new Picker(PickResult.withSubchannel(subchannel))); 74 subchannel.requestConnection(); 76 helper.updateSubchannelAddresses(subchannel, servers); 82 if (subchannel != null) 148 private final Subchannel subchannel; field in class:PickFirstBalancerFactory.RequestConnectionPicker [all...] |
LoadBalancer.java | 32 * channel a usable subchannel when asked. 43 * a {@link Subchannel Subchannel} for each new RPC.</li> 79 * Subchannel(s) and their latest connectivity states. These states are mutated within the Channel 84 * next Subchannel, which are typically mutated by multiple threads. The picker should only mutate 90 * a new picker, which holds a snapshot of the latest Subchannel list. Refer to the javadoc of 125 * Handles a state change on a Subchannel. 127 * <p>The initial state of a Subchannel is IDLE. You won't get a notification for the initial IDLE 136 * Subchannel#shutdown} earlier, thus it should have already discarded this Subchannel. The othe 237 @Nullable private final Subchannel subchannel; field in class:LoadBalancer.PickResult [all...] |
/external/grpc-grpc-java/core/src/main/java/io/grpc/util/ |
RoundRobinLoadBalancerFactory.java | 38 import io.grpc.LoadBalancer.Subchannel; 108 static final Attributes.Key<Ref<Subchannel>> STICKY_REF = Attributes.Key.create("sticky-ref"); 113 private final Map<EquivalentAddressGroup, Subchannel> subchannels = 114 new HashMap<EquivalentAddressGroup, Subchannel>(); 156 // NB(lukaszx0): we don't merge `attributes` with `subchannelAttr` because subchannel 166 Ref<Subchannel> stickyRef = null; 168 subchannelAttrs.set(STICKY_REF, stickyRef = new Ref<Subchannel>(null)); 171 Subchannel subchannel = checkNotNull( local 172 helper.createSubchannel(addressGroup, subchannelAttrs.build()), "subchannel"); 182 Subchannel subchannel = subchannels.remove(addressGroup); local 429 Subchannel subchannel = null; local [all...] |
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/ |
OobChannel.java | 42 import io.grpc.LoadBalancer.Subchannel; 69 private InternalSubchannel subchannel; field in class:OobChannel 142 void setSubchannel(final InternalSubchannel subchannel) { 143 log.log(Level.FINE, "[{0}] Created with [{1}]", new Object[] {this, subchannel}); 144 this.subchannel = subchannel; 148 subchannel.shutdown(Status.UNAVAILABLE.withDescription("OobChannel is shutdown")); 153 return subchannel.obtainActiveTransport(); 158 return subchannel; 163 subchannel.obtainActiveTransport() [all...] |
ManagedChannelImpl.java | 114 Status.UNAVAILABLE.withDescription("Subchannel shutdown invoked"); 271 for (InternalSubchannel subchannel : subchannels) { 272 subchannel.shutdownNow(SHUTDOWN_NOW_STATUS); 488 // which calls Subchannel.shutdown(), the InternalSubchannel will be actually shutdown after 1031 final SubchannelImpl subchannel = new SubchannelImpl(attrs); local 1374 InternalSubchannel subchannel; field in class:ManagedChannelImpl.SubchannelImpl [all...] |
AutoConfiguredLoadBalancerFactory.java | 62 public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) {} 115 public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) { 116 getDelegate().handleSubchannelState(subchannel, stateInfo);
|
/external/grpc-grpc-java/core/src/test/java/io/grpc/ |
LoadBalancerTest.java | 24 import io.grpc.LoadBalancer.Subchannel; 36 private final Subchannel subchannel = mock(Subchannel.class); field in class:LoadBalancerTest 37 private final Subchannel subchannel2 = mock(Subchannel.class); 45 private final Subchannel emptySubchannel = new EmptySubchannel(); 49 PickResult result = PickResult.withSubchannel(subchannel); 50 assertThat(result.getSubchannel()).isSameAs(subchannel); 58 PickResult result = PickResult.withSubchannel(subchannel, tracerFactory) 184 OverrideGetAllAddresses subchannel = new OverrideGetAllAddresses(); local [all...] |
/external/grpc-grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/ |
round_robin.cc | 22 * returns the p->subchannel_list->subchannels index for next subchannel, 35 #include "src/core/ext/filters/client_channel/subchannel.h" 82 // Data for a particular subchannel in a subchannel list. 85 // returned along with picks that select the subchannel. 86 // - Tracks the previous connectivity state of the subchannel, so that 96 const grpc_lb_address& address, grpc_subchannel* subchannel, 98 : SubchannelData(subchannel_list, user_data_vtable, address, subchannel, 161 // subchannel transitions from old_state to new_state. 168 // If this subchannel list is the RR policy's current subchanne [all...] |
/external/grpc-grpc/src/core/ext/filters/client_channel/lb_policy/ |
subchannel_list.h | 29 #include "src/core/ext/filters/client_channel/subchannel.h" 72 // Stores data for a particular subchannel in a subchannel list. 78 // Returns a pointer to the subchannel list containing this object. 83 // Returns the index into the subchannel list of this object. 86 subchannel_list_->subchannel(0)); 89 // Returns a pointer to the subchannel. 90 grpc_subchannel* subchannel() const { return subchannel_; } function in class:grpc_core::SubchannelData 92 // Returns the connected subchannel. Will be null if the subchannel 198 SubchannelDataType* subchannel(size_t index) { return &subchannels_[index]; } function in class:grpc_core::SubchannelList 516 grpc_subchannel* subchannel = grpc_client_channel_factory_create_subchannel( local [all...] |
/external/grpc-grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/ |
pick_first.cc | 27 #include "src/core/ext/filters/client_channel/subchannel.h" 78 const grpc_lb_address& address, grpc_subchannel* subchannel, 80 : SubchannelData(subchannel_list, user_data_vtable, address, subchannel, 86 // Processes the connectivity change to READY for an unselected subchannel. 134 // Latest pending subchannel list. 136 // Selected subchannel in \a subchannel_list_. 254 subchannel_list_->subchannel(0) 273 // If we have a selected subchannel already, return synchronously. 278 // No subchannel selected yet, so handle asynchronously. 340 // If we don't have a current subchannel list, go into TRANSIENT FAILURE [all...] |
/external/grpc-grpc-java/core/src/test/java/io/grpc/util/ |
RoundRobinLoadBalancerTest.java | 57 import io.grpc.LoadBalancer.Subchannel; 94 private Map<EquivalentAddressGroup, Subchannel> subchannels = Maps.newLinkedHashMap(); 118 Subchannel sc = mock(Subchannel.class); 124 .then(new Answer<Subchannel>() { 126 public Subchannel answer(InvocationOnMock invocation) throws Throwable { 128 Subchannel subchannel = subchannels.get(args[0]); 129 when(subchannel.getAttributes()).thenReturn((Attributes) args[1]); 130 return subchannel; 257 Subchannel subchannel = loadBalancer.getSubchannels().iterator().next(); local 296 Subchannel subchannel = mock(Subchannel.class); local [all...] |
/external/grpc-grpc/src/core/ext/filters/client_channel/ |
subchannel.cc | 21 #include "src/core/ext/filters/client_channel/subchannel.h" 65 grpc_subchannel* subchannel; member in struct:__anon22989::state_watcher 71 grpc_subchannel* subchannel; member in struct:external_state_watcher 84 these do not keep the subchannel open. 86 keep the subchannel open */ 157 static void on_subchannel_connected(void* subchannel, grpc_error* error); 189 grpc_slice_from_static_string("Subchannel destroyed")); 210 "SUBCHANNEL: %p %12s 0x%" PRIxPTR " -> 0x%" PRIxPTR " [%s]", c, 256 "Subchannel disconnected")); 382 "subchannel"); [all...] |
subchannel.h | 104 // backpointer to the channelz node in this connected subchannel's 105 // owning subchannel. 127 grpc_subchannel* subchannel); 151 /** return the subchannel index key for \a subchannel */ 153 const grpc_subchannel* subchannel); 155 // Resets the connection backoff of the subchannel. 160 void grpc_subchannel_reset_backoff(grpc_subchannel* subchannel); 186 /** create a subchannel given a connector */ 194 const char* grpc_subchannel_get_target(grpc_subchannel* subchannel); [all...] |
client_channel_channelz.h | 42 // functionality like querying for connectivity_state and subchannel data. 69 SubchannelNode(grpc_subchannel* subchannel, size_t channel_tracer_max_nodes);
|
client_channel_channelz.cc | 115 SubchannelNode::SubchannelNode(grpc_subchannel* subchannel, 118 subchannel_(subchannel),
|
/external/grpc-grpc-java/grpclb/src/test/java/io/grpc/grpclb/ |
CachedSubchannelPoolTest.java | 36 import io.grpc.LoadBalancer.Subchannel; 73 private final ArrayList<Subchannel> mockSubchannels = new ArrayList<>(); 77 doAnswer(new Answer<Subchannel>() { 79 public Subchannel answer(InvocationOnMock invocation) throws Throwable { 80 Subchannel subchannel = mock(Subchannel.class); 83 when(subchannel.getAddresses()).thenReturn(eag); 84 when(subchannel.getAttributes()).thenReturn(attrs); 85 mockSubchannels.add(subchannel); [all...] |
/external/grpc-grpc-java/services/src/test/java/io/grpc/services/ |
ChannelzServiceTest.java | 94 TestChannel subchannel = new TestChannel(); local 95 assertSubchannelNotFound(subchannel.getLogId().getId()); 97 channelz.addSubchannel(subchannel); 101 .setSubchannel(ChannelzProtoUtil.toSubchannel(subchannel)) 103 getSubchannelHelper(subchannel.getLogId().getId())); 105 channelz.removeSubchannel(subchannel); 106 assertSubchannelNotFound(subchannel.getLogId().getId());
|
ChannelzProtoUtilTest.java | 75 import io.grpc.channelz.v1.Subchannel; 117 private final TestChannel subchannel = new TestChannel(); field in class:ChannelzProtoUtilTest 120 .setName(subchannel.toString()) 121 .setSubchannelId(subchannel.getLogId().getId()) 132 private final Subchannel subchannelProto = Subchannel 331 assertEquals(subchannelRef, ChannelzProtoUtil.toSubchannelRef(subchannel)); 576 .setSubchannels(ImmutableList.<InternalWithLogId>of(subchannel)) 588 .setSubchannels(ImmutableList.<InternalWithLogId>of(subchannel, otherSubchannel)) 608 ChannelzProtoUtil.toSubchannel(subchannel)); [all...] |
/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/ |
ManagedChannelImplTest.java | 80 import io.grpc.LoadBalancer.Subchannel; 146 Attributes.Key.create("subchannel-attr-key"); 345 AbstractSubchannel subchannel = local 348 assertNull(channelz.getRootChannel(subchannel.getInternalSubchannel().getLogId().getId())); 349 assertTrue(channelz.containsSubchannel(subchannel.getInternalSubchannel().getLogId())); 351 .containsExactly(subchannel.getInternalSubchannel()); 353 subchannel.requestConnection(); 362 // terminate subchannel 363 assertTrue(channelz.containsSubchannel(subchannel.getInternalSubchannel().getLogId())); 364 subchannel.shutdown() 384 AbstractSubchannel subchannel = (AbstractSubchannel) oob.getSubchannel(); local 438 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 637 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 853 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 998 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 1352 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 1420 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 1495 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 1533 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 1896 Subchannel subchannel = helper2.createSubchannel(addressGroup, Attributes.EMPTY); local 1964 Subchannel subchannel = helper2.createSubchannel(addressGroup, Attributes.EMPTY); local 2120 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 2142 AbstractSubchannel subchannel = local 2294 AbstractSubchannel subchannel = local 2357 AbstractSubchannel subchannel = local 2411 AbstractSubchannel subchannel = local 2646 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local [all...] |
ManagedChannelImplIdlenessTest.java | 45 import io.grpc.LoadBalancer.Subchannel; 264 // Assume LoadBalancer has received an address, then create a subchannel. 265 Subchannel subchannel = helper.createSubchannel(addressGroup, Attributes.EMPTY); local 266 subchannel.requestConnection(); 272 .thenReturn(PickResult.withSubchannel(subchannel)); 304 Subchannel subchannel = helper.createSubchannel(servers.get(0), Attributes.EMPTY); local 306 subchannel.requestConnection(); 310 helper.updateSubchannelAddresses(subchannel, servers.get(1)) 324 Subchannel subchannel = helper.createSubchannel(servers.get(0), Attributes.EMPTY); local [all...] |
AutoConfiguredLoadBalancerFactoryTest.java | 29 import io.grpc.LoadBalancer.Subchannel; 87 public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) { 116 public Subchannel createSubchannel(List<EquivalentAddressGroup> addrs, Attributes attrs) { 150 public Subchannel createSubchannel(List<EquivalentAddressGroup> addrs, Attributes attrs) { 171 public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) { 284 public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) { 285 delegate().handleSubchannelState(subchannel, stateInfo) [all...] |