Package io.grpc.internal
Class PickFirstLeafLoadBalancer.Index
java.lang.Object
io.grpc.internal.PickFirstLeafLoadBalancer.Index
- Enclosing class:
PickFirstLeafLoadBalancer
Index as in 'i', the pointer to an entry. Not a "search index."
All updates should be done in a synchronization context.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List
<EquivalentAddressGroup> private int
private int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Move to next address in group.boolean
boolean
isValid()
void
reset()
boolean
seekTo
(SocketAddress needle) Returns false if the needle was not found and the current index was left unchanged.int
size()
void
updateGroups
(List<EquivalentAddressGroup> newGroups) Update to new groups, resetting the current index.
-
Field Details
-
addressGroups
-
size
private int size -
groupIndex
private int groupIndex -
addressIndex
private int addressIndex
-
-
Constructor Details
-
Index
-
-
Method Details
-
isValid
public boolean isValid() -
isAtBeginning
public boolean isAtBeginning() -
increment
public boolean increment()Move to next address in group. If last address in group move to first address of next group.- Returns:
- false if went off end of the list, otherwise true
-
reset
public void reset() -
getCurrentAddress
-
getCurrentEagAttributes
-
getCurrentEagAsList
-
updateGroups
Update to new groups, resetting the current index. -
seekTo
Returns false if the needle was not found and the current index was left unchanged. -
size
public int size()
-