Package io.grpc.xds

Class 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.
    • Method Detail

      • 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.