Package com.google.cloud.spanner.spi.v1
Class KeyRangeCache
java.lang.Object
com.google.cloud.spanner.spi.v1.KeyRangeCache
Cache for routing information used by location-aware routing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDetermines how to handle ranges that span multiple splits. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRanges(CacheUpdate cacheUpdate) Applies cache updates.voidclear()fillRoutingHint(boolean preferLeader, KeyRangeCache.RangeMode rangeMode, DirectedReadOptions directedReadOptions, RoutingHint.Builder hintBuilder) Fills routing hint and returns the server to use, or null if no routing decision can be made.voidshrinkTo(int newSize) intsize()
-
Constructor Details
-
KeyRangeCache
-
-
Method Details
-
addRanges
Applies cache updates. Tablets are processed inside group updates. -
fillRoutingHint
public ChannelEndpoint fillRoutingHint(boolean preferLeader, KeyRangeCache.RangeMode rangeMode, DirectedReadOptions directedReadOptions, RoutingHint.Builder hintBuilder) Fills routing hint and returns the server to use, or null if no routing decision can be made. -
clear
public void clear() -
size
public int size() -
shrinkTo
public void shrinkTo(int newSize) -
debugString
-