Home | History | Annotate | Download | only in grpc

Lines Matching refs:subchannel

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 other
141 * @param subchannel the involved Subchannel
146 Subchannel subchannel, ConnectivityStateInfo stateInfo);
220 * <li>Proceed: if a Subchannel is provided via {@link #withSubchannel withSubchannel()}, and is
222 * Subchannel.</li>
237 @Nullable private final Subchannel subchannel;
239 // An error to be propagated to the application if subchannel == null
241 // subchannel being null and error being OK means RPC needs to wait
247 @Nullable Subchannel subchannel, @Nullable ClientStreamTracer.Factory streamTracerFactory,
249 this.subchannel = subchannel;
256 * A decision to proceed the RPC on a Subchannel.
261 * <p>When the RPC tries to use the return Subchannel, which is briefly after this method
262 * returns, the state of the Subchannel will decide where the RPC would go:
265 * <li>READY: the RPC will proceed on this Subchannel.</li>
266 * <li>IDLE: the RPC will be buffered. Subchannel will attempt to create connection.</li>
274 * <p>Note that Subchannel's state may change at the same time the picker is making the
276 * example, a picker may return a Subchannel known to be READY, but it has become IDLE when is
292 * in response to the CONNECTING state to exclude that Subchannel, 50% of RPCs will hit it
293 * and be buffered even though the other Subchannel is READY.</li>
303 * because when an RPC tries to use an IDLE Subchannel, the Subchannel will try to
306 * would call {@link Subchannel#requestConnection Subchannel.requestConnection()}
307 * whenever the Subchannel has transitioned to IDLE, then you don't need to include
316 * @param subchannel the picked Subchannel
323 Subchannel subchannel, @Nullable ClientStreamTracer.Factory streamTracerFactory) {
325 Preconditions.checkNotNull(subchannel, "subchannel"), streamTracerFactory, Status.OK,
330 * Equivalent to {@code withSubchannel(subchannel, null)}.
334 public static PickResult withSubchannel(Subchannel subchannel) {
335 return withSubchannel(subchannel, null);
373 * The Subchannel
379 public Subchannel getSubchannel() {
380 return subchannel;
415 .add("subchannel", subchannel)
424 return Objects.hashCode(subchannel, status, streamTracerFactory, drop);
428 * Returns true if the {@link Subchannel}, {@link Status}, and
437 return Objects.equal(subchannel, that.subchannel) && Objects.equal(status, that.status)
451 * Creates a Subchannel, which is a logical connection to the given group of addresses which are
453 * Subchannel, and can be accessed later through {@link Subchannel#getAttributes
454 * Subchannel.getAttributes()}.
464 public Subchannel createSubchannel(EquivalentAddressGroup addrs, Attributes attrs) {
470 * Creates a Subchannel, which is a logical connection to the given group of addresses which are
472 * Subchannel, and can be accessed later through {@link Subchannel#getAttributes
473 * Subchannel.getAttributes()}.
481 public Subchannel createSubchannel(List<EquivalentAddressGroup> addrs, Attributes attrs) {
486 * Replaces the existing addresses used with {@code subchannel}. This method is superior to
487 * {@link #createSubchannel} when the new and old addresses overlap, since the subchannel can
491 * LoadBalancer.Subchannel, List)}. Implementations should not override this method.
493 * @throws IllegalArgumentException if {@code subchannel} was not returned from {@link
498 Subchannel subchannel, EquivalentAddressGroup addrs) {
500 updateSubchannelAddresses(subchannel, Collections.singletonList(addrs));
504 * Replaces the existing addresses used with {@code subchannel}. This method is superior to
505 * {@link #createSubchannel} when the new and old addresses overlap, since the subchannel can
508 * @throws IllegalArgumentException if {@code subchannel} was not returned from {@link
513 Subchannel subchannel, List<EquivalentAddressGroup> addrs) {
594 * <p>If there isn't an active transport yet, and an RPC is assigned to the Subchannel, it will
596 * #requestConnection requestConnection()} can be used to ask Subchannel to create a transport if
602 public abstract static class Subchannel {
604 * Shuts down the Subchannel. After this method is called, this Subchannel should no longer
612 * Asks the Subchannel to create a connection (aka transport), if there isn't an active one.
619 * Returns the addresses that this Subchannel is bound to. The default implementation calls
625 * @throws IllegalStateException if this subchannel has more than one EquivalentAddressGroup.
636 * Returns the addresses that this Subchannel is bound to. The returned list will not be empty.
647 * Subchannel belongs to.