Package io.grpc.xds

Class RingHashOptions


  • @ExperimentalApi("https://github.com/grpc/grpc-java/issues/9718")
    public final class RingHashOptions
    extends java.lang.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.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RingHashOptions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long getRingSizeCap()
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ringSizeCap

        private static volatile long ringSizeCap
    • Constructor Detail

      • RingHashOptions

        private RingHashOptions()
    • 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.