Class KeyRangeCache (6.111.0)

public final class KeyRangeCache

Cache for routing information used by location-aware routing.

Inheritance

java.lang.Object > KeyRangeCache

Constructors

KeyRangeCache(ChannelEndpointCache endpointCache)

public KeyRangeCache(ChannelEndpointCache endpointCache)
Parameter
Name Description
endpointCache ChannelEndpointCache

Methods

addRanges(CacheUpdate cacheUpdate)

public void addRanges(CacheUpdate cacheUpdate)

Applies cache updates. Tablets are processed inside group updates.

Parameter
Name Description
cacheUpdate CacheUpdate

clear()

public void clear()

debugString()

public String debugString()
Returns
Type Description
String

fillRoutingHint(boolean preferLeader, KeyRangeCache.RangeMode rangeMode, DirectedReadOptions directedReadOptions, RoutingHint.Builder hintBuilder)

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.

Parameters
Name Description
preferLeader boolean
rangeMode KeyRangeCache.RangeMode
directedReadOptions DirectedReadOptions
hintBuilder RoutingHint.Builder
Returns
Type Description
ChannelEndpoint

shrinkTo(int newSize)

public void shrinkTo(int newSize)
Parameter
Name Description
newSize int

size()

public int size()
Returns
Type Description
int