@ThreadSafe public abstract static class LoadBalancer2.Subchannel extends Object
EquivalentAddressGroup
.
It maintains at most one physical connection (aka transport) for sending new RPCs, while also keeps track of previous transports that has been shut down but not terminated yet.
If there isn't an active transport yet, and an RPC is assigned to the Subchannel, it will
create a new transport. It won't actively create transports otherwise. requestConnection()
can be used to ask Subchannel to create a transport if
there isn't any.
Constructor and Description |
---|
Subchannel() |
Modifier and Type | Method and Description |
---|---|
abstract EquivalentAddressGroup |
getAddresses()
Returns the addresses that this Subchannel is bound to.
|
abstract Attributes |
getAttributes()
The same attributes passed to
Helper.createSubchannel() . |
abstract void |
requestConnection()
Asks the Subchannel to create a connection (aka transport), if there isn't an active one.
|
abstract void |
shutdown()
Shuts down the Subchannel.
|
public abstract void shutdown()
picker
, and can be safely discarded.public abstract void requestConnection()
public abstract EquivalentAddressGroup getAddresses()
public abstract Attributes getAttributes()
Helper.createSubchannel()
.
LoadBalancer can use it to attach additional information here, e.g., the shard this
Subchannel belongs to.