1 | import { LoadBalancer, ChannelControlHelper, LoadBalancingConfig } from './load-balancer';
|
2 | import { SubchannelAddress } from './subchannel-address';
|
3 | export declare class PickFirstLoadBalancingConfig implements LoadBalancingConfig {
|
4 | private readonly shuffleAddressList;
|
5 | constructor(shuffleAddressList: boolean);
|
6 | getLoadBalancerName(): string;
|
7 | toJsonObject(): object;
|
8 | getShuffleAddressList(): boolean;
|
9 | static createFromJson(obj: any): PickFirstLoadBalancingConfig;
|
10 | }
|
11 | /**
|
12 | * Return a new array with the elements of the input array in a random order
|
13 | * @param list The input array
|
14 | * @returns A shuffled array of the elements of list
|
15 | */
|
16 | export declare function shuffled<T>(list: T[]): T[];
|
17 | export declare class PickFirstLoadBalancer implements LoadBalancer {
|
18 | private readonly channelControlHelper;
|
19 | |
20 |
|
21 |
|
22 |
|
23 | private children;
|
24 | |
25 |
|
26 |
|
27 | private currentState;
|
28 | |
29 |
|
30 |
|
31 |
|
32 | private currentSubchannelIndex;
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 | private currentPick;
|
39 | |
40 |
|
41 |
|
42 |
|
43 | private subchannelStateListener;
|
44 | |
45 |
|
46 |
|
47 | private connectionDelayTimeout;
|
48 | private triedAllSubchannels;
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | private stickyTransientFailureMode;
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | constructor(channelControlHelper: ChannelControlHelper);
|
64 | private allChildrenHaveReportedTF;
|
65 | private calculateAndReportNewState;
|
66 | private maybeEnterStickyTransientFailureMode;
|
67 | private removeCurrentPick;
|
68 | private onSubchannelStateUpdate;
|
69 | private startNextSubchannelConnecting;
|
70 | /**
|
71 | * Have a single subchannel in the `subchannels` list start connecting.
|
72 | * @param subchannelIndex The index into the `subchannels` list.
|
73 | */
|
74 | private startConnecting;
|
75 | private pickSubchannel;
|
76 | private updateState;
|
77 | private resetSubchannelList;
|
78 | updateAddressList(addressList: SubchannelAddress[], lbConfig: LoadBalancingConfig): void;
|
79 | exitIdle(): void;
|
80 | resetBackoff(): void;
|
81 | destroy(): void;
|
82 | getTypeName(): string;
|
83 | }
|
84 | export declare function setup(): void;
|