diff --git a/joylive-plugin/joylive-router/joylive-router-grpc/src/main/java/com/jd/live/agent/plugin/router/gprc/loadbalance/LivePickerAdvice.java b/joylive-plugin/joylive-router/joylive-router-grpc/src/main/java/com/jd/live/agent/plugin/router/gprc/loadbalance/LivePickerAdvice.java index 48d1d07c..e4b0c17a 100644 --- a/joylive-plugin/joylive-router/joylive-router-grpc/src/main/java/com/jd/live/agent/plugin/router/gprc/loadbalance/LivePickerAdvice.java +++ b/joylive-plugin/joylive-router/joylive-router-grpc/src/main/java/com/jd/live/agent/plugin/router/gprc/loadbalance/LivePickerAdvice.java @@ -20,11 +20,14 @@ import java.util.List; import java.util.function.Function; +/** + * Represents advice for live picker, which includes a subchannel and an election function to determine the active subchannel. + */ public class LivePickerAdvice { public static final CallOptions.Key KEY_PICKER_ADVICE = CallOptions.Key.create("x-picker-advice"); - private final LiveSubchannel subchannel; + private LiveSubchannel subchannel; private final Function, LiveSubchannel> election; @@ -45,6 +48,10 @@ public LiveSubchannel getSubchannel() { return subchannel; } + public void setSubchannel(LiveSubchannel subchannel) { + this.subchannel = subchannel; + } + public Function, LiveSubchannel> getElection() { return election; }