Class BlobTransferGlobalTrafficShapingHandlerHolder
java.lang.Object
com.linkedin.davinci.blobtransfer.BlobTransferGlobalTrafficShapingHandlerHolder
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 Summary
Modifier and TypeMethodDescriptionstatic io.netty.handler.traffic.GlobalChannelTrafficShapingHandlergetGlobalChannelTrafficShapingHandlerInstance(long readLimit, long writeLimit) Gets the singleton instance of GlobalChannelTrafficShapingHandler.
-
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 secondwriteLimit- maximum number of bytes to write per second- Returns:
- the global traffic shaping handler
-