Class BlobTransferGlobalTrafficShapingHandlerHolder

java.lang.Object
com.linkedin.davinci.blobtransfer.BlobTransferGlobalTrafficShapingHandlerHolder

public class BlobTransferGlobalTrafficShapingHandlerHolder extends Object
Singleton holder for the GlobalChannelTrafficShapingHandler. This class provides a thread-safe way to access a single instance of the global traffic shaping handler that can be shared across all network channels of blob transfer in both server and client side to enforce global rate limits. Because this is a JVM-wide singleton shared by both server and DaVinci client components, no explicit LogContext is set on the traffic-shaper thread. The thread may inherit context from its creating thread when log4j2.isThreadContextMapInheritable=true.
  • Method Details

    • getGlobalChannelTrafficShapingHandlerInstance

      public static io.netty.handler.traffic.GlobalChannelTrafficShapingHandler getGlobalChannelTrafficShapingHandlerInstance(long readLimit, long writeLimit)
      Gets the singleton instance of GlobalChannelTrafficShapingHandler. Handler is lazily created on first access.
      Parameters:
      readLimit - maximum number of bytes to read per second
      writeLimit - maximum number of bytes to write per second
      Returns:
      the global traffic shaping handler