Package io.grpc.internal
Class InternalSubchannel.Index
- java.lang.Object
-
- io.grpc.internal.InternalSubchannel.Index
-
- Enclosing class:
- InternalSubchannel
static final class InternalSubchannel.Index extends java.lang.Object
Index as in 'i', the pointer to an entry. Not a "search index."
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<EquivalentAddressGroup>
addressGroups
private int
addressIndex
private int
groupIndex
-
Constructor Summary
Constructors Constructor Description Index(java.util.List<EquivalentAddressGroup> groups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.SocketAddress
getCurrentAddress()
Attributes
getCurrentEagAttributes()
java.util.List<EquivalentAddressGroup>
getGroups()
void
increment()
boolean
isAtBeginning()
boolean
isValid()
void
reset()
boolean
seekTo(java.net.SocketAddress needle)
Returns false if the needle was not found and the current index was left unchanged.void
updateGroups(java.util.List<EquivalentAddressGroup> newGroups)
Update to new groups, resetting the current index.
-
-
-
Field Detail
-
addressGroups
private java.util.List<EquivalentAddressGroup> addressGroups
-
groupIndex
private int groupIndex
-
addressIndex
private int addressIndex
-
-
Constructor Detail
-
Index
public Index(java.util.List<EquivalentAddressGroup> groups)
-
-
Method Detail
-
isValid
public boolean isValid()
-
isAtBeginning
public boolean isAtBeginning()
-
increment
public void increment()
-
reset
public void reset()
-
getCurrentAddress
public java.net.SocketAddress getCurrentAddress()
-
getCurrentEagAttributes
public Attributes getCurrentEagAttributes()
-
getGroups
public java.util.List<EquivalentAddressGroup> getGroups()
-
updateGroups
public void updateGroups(java.util.List<EquivalentAddressGroup> newGroups)
Update to new groups, resetting the current index.
-
seekTo
public boolean seekTo(java.net.SocketAddress needle)
Returns false if the needle was not found and the current index was left unchanged.
-
-