Package io.grpc.xds
Class RingHashOptions
java.lang.Object
io.grpc.xds.RingHashOptions
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/9718")
public final class RingHashOptions
extends Object
Utility class that provides a way to configure ring hash size limits. This is applicable
for clients that use the ring hash load balancing policy. Note that size limits involve
a tradeoff between client memory consumption and accuracy of load balancing weight
representations. Also see https://github.com/grpc/proposal/pull/338.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final long
(package private) static final long
private static long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic long
Get the global limit for min and max ring hash sizes.static void
setRingSizeCap
(long ringSizeCap) Set the global limit for the min and max number of ring hash entries per ring.
-
Field Details
-
MAX_RING_SIZE_CAP
static final long MAX_RING_SIZE_CAP- See Also:
-
DEFAULT_RING_SIZE_CAP
static final long DEFAULT_RING_SIZE_CAP- See Also:
-
ringSizeCap
private static volatile long ringSizeCap
-
-
Constructor Details
-
RingHashOptions
private RingHashOptions()
-
-
Method Details
-
setRingSizeCap
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/9718") public static void setRingSizeCap(long ringSizeCap) Set the global limit for the min and max number of ring hash entries per ring. Note that this limit is clamped between 1 entry and 8,388,608 entries, and new limits lying outside that range will be silently moved to the nearest number within that range. Defaults initially to 4096 entries. -
getRingSizeCap
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/9718") public static long getRingSizeCap()Get the global limit for min and max ring hash sizes.
-