io.netty.handler.traffic.GlobalChannelTrafficShapingHandler.class Maven / Gradle / Ivy
???? 2W ;io/netty/handler/traffic/GlobalChannelTrafficShapingHandler 6io/netty/handler/traffic/AbstractTrafficShapingHandler 'GlobalChannelTrafficShapingHandler.java *Lio/netty/channel/ChannelHandler$Sharable; Bio/netty/handler/traffic/GlobalChannelTrafficShapingHandler$ToSend ToSend Fio/netty/handler/traffic/GlobalChannelTrafficShapingHandler$PerChannel
PerChannel =io/netty/handler/traffic/GlobalChannelTrafficShapingHandler$2
=io/netty/handler/traffic/GlobalChannelTrafficShapingHandler$1 (io/netty/channel/ChannelHandler$Sharable io/netty/channel/ChannelHandler Sharable Jio/netty/handler/traffic/AbstractTrafficShapingHandler$ReopenReadTimerTask ReopenReadTimerTask logger /Lio/netty/util/internal/logging/InternalLogger;
channelQueues $Ljava/util/concurrent/ConcurrentMap; ?Ljava/util/concurrent/ConcurrentMap;
queuesSize (Ljava/util/concurrent/atomic/AtomicLong; cumulativeWrittenBytes cumulativeReadBytes maxGlobalWriteSize J writeChannelLimit readChannelLimit DEFAULT_DEVIATION F=???
MAX_DEVIATION>??? DEFAULT_SLOWDOWN DEFAULT_ACCELERATION???? maxDeviation accelerationFactor slowDownFactor readDeviationActive Z writeDeviationActive createGlobalTrafficCounter 2(Ljava/util/concurrent/ScheduledExecutorService;)V setMaxDeviation (FFF)V 6 7
8 "java/lang/IllegalArgumentException : Executor must not be null < (Ljava/lang/String;)V > ?
; @ 4io/netty/handler/traffic/GlobalChannelTrafficCounter B GlobalChannelTC D
checkInterval F # G ?(Lio/netty/handler/traffic/GlobalChannelTrafficShapingHandler;Ljava/util/concurrent/ScheduledExecutorService;Ljava/lang/String;J)V > I
C J setTrafficCounter ,(Lio/netty/handler/traffic/TrafficCounter;)V L M
N 'io/netty/handler/traffic/TrafficCounter P start ()V R S
Q T this =Lio/netty/handler/traffic/GlobalChannelTrafficShapingHandler; executor /Ljava/util/concurrent/ScheduledExecutorService; tc )Lio/netty/handler/traffic/TrafficCounter; userDefinedWritabilityIndex ()I 8(Ljava/util/concurrent/ScheduledExecutorService;JJJJJJ)V (JJJJ)V > _
` (io/netty/util/internal/PlatformDependent b newConcurrentHashMap &()Ljava/util/concurrent/ConcurrentMap; d e
c f h &java/util/concurrent/atomic/AtomicLong j > S
k l n p ! r " # v 4 5
x $ # z % # | writeGlobalLimit readGlobalLimit maxTime 7(Ljava/util/concurrent/ScheduledExecutorService;JJJJJ)V (JJJ)V > ?
? 6(Ljava/util/concurrent/ScheduledExecutorService;JJJJ)V (JJ)V > ?
? 3(Ljava/util/concurrent/ScheduledExecutorService;J)V (J)V > ?
?
l ()F . ' ? / ' ? 0 ' ? maxDeviation must be <= 0.4 ? slowDownFactor must be >= 0 ? accelerationFactor must be <= 0 ? computeDeviationCumulativeBytes??????? "java/util/concurrent/ConcurrentMap ? values ()Ljava/util/Collection; ? ? ? ? java/util/Collection ? iterator ()Ljava/util/Iterator; ? ? ? ? java/util/Iterator ? hasNext ()Z ? ? ? ? next ()Ljava/lang/Object; ? ? ? ? channelTrafficCounter ? [ ? ()J ?
Q ? ! ?
Q ? size ? ] ? ? 1 2 ? 3 2 ? set ? ?
k ? value
perChannel HLio/netty/handler/traffic/GlobalChannelTrafficShapingHandler$PerChannel; maxWrittenBytes maxReadBytes minWrittenBytes minReadBytes multiple doAccounting ? S
? ? M
? counter computeBalancedWait (FFJ)J
maxLocal maxGlobal wait ratio getMaxGlobalWriteSize setMaxGlobalWriteSize #maxGlobalWriteSize must be positive ? get ? ?
k ? configureChannel milliSecondFromNano ? ?
Q ? resetAccounting ? ?
Q ?
newWriteLimit newReadLimit now getWriteChannelLimit setWriteChannelLimit
writeLimit getReadChannelLimit setReadChannelLimit readLimit release trafficCounter ? [ ? stop ? S
Q ? getOrSetPerChannel r(Lio/netty/channel/ChannelHandlerContext;)Lio/netty/handler/traffic/GlobalChannelTrafficShapingHandler$PerChannel; &io/netty/channel/ChannelHandlerContext ? channel ()Lio/netty/channel/Channel; ? java/lang/Object hashCode ]
java/lang/Integer valueOf (I)Ljava/lang/Integer;
&(Ljava/lang/Object;)Ljava/lang/Object; ? ?
l java/util/ArrayDeque
l
messagesQueue Ljava/util/ArrayDeque; java/lang/StringBuilder
l ChannelTC append -(Ljava/lang/String;)Ljava/lang/StringBuilder;
! (I)Ljava/lang/StringBuilder;#
$ toString ()Ljava/lang/String;&'
( }(Lio/netty/handler/traffic/AbstractTrafficShapingHandler;Ljava/util/concurrent/ScheduledExecutorService;Ljava/lang/String;J)V >*
Q+ queueSize- # . lastReadTimestamp0 # 1 lastWriteTimestamp3 # 4 put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;67 ?8 io/netty/channel/Channel: ctx (Lio/netty/channel/ChannelHandlerContext; Lio/netty/channel/Channel; key Ljava/lang/Integer; handlerAdded +(Lio/netty/channel/ChannelHandlerContext;)V java/lang/ExceptionC ? ?
E resetCumulativeTimeG S
QHAB
J handlerRemoved removeM ?N isActiveP ?;Q
? toSend Ljava/lang/Object;TU V
calculateSize (Ljava/lang/Object;)JXY
Z bytesRealWriteFlowControl\ ?
Q] addAndGet (J)J_`
ka promise !Lio/netty/channel/ChannelPromise;cd e write U(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;gh ?i io/netty/buffer/ByteBufk ? ?
lm clearo S
p java/lang/Throwabler releaseWriteSuspendedtB
u releaseReadSuspendedwB
xLB
z DLio/netty/handler/traffic/GlobalChannelTrafficShapingHandler$ToSend; channelRead =(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;)V getReadLimit ?
? ? # ? readTimeToWait (JJJJ)J??
Q? ? ?
? checkWaitReadTime -(Lio/netty/channel/ChannelHandlerContext;JJ)J??
? config "()Lio/netty/channel/ChannelConfig;??;? ? -io/netty/util/internal/logging/InternalLogger? isDebugEnabled? ??? Read Suspend: ? (J)Ljava/lang/StringBuilder;?
? (C)Ljava/lang/StringBuilder;?
? io/netty/channel/ChannelConfig?
isAutoRead? ??? (Z)Ljava/lang/StringBuilder;?
? isHandlerActive +(Lio/netty/channel/ChannelHandlerContext;)Z??
? debug? ??? setAutoRead #(Z)Lio/netty/channel/ChannelConfig;???? READ_SUSPENDED Lio/netty/util/AttributeKey;?? ? attr 7(Lio/netty/util/AttributeKey;)Lio/netty/util/Attribute;?? ?? java/lang/Boolean? (Z)Ljava/lang/Boolean;?
?? io/netty/util/Attribute? (Ljava/lang/Object;)V ???? REOPEN_TASK?? ? ? ??? java/lang/Runnable? >B
? *()Lio/netty/util/concurrent/EventExecutor; X? ?? java/util/concurrent/TimeUnit? MILLISECONDS Ljava/util/concurrent/TimeUnit;?? ?? &io/netty/util/concurrent/EventExecutor? schedule `(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Lio/netty/util/concurrent/ScheduledFuture;???? Suspend final status => ? will reopened at: ? informReadOperation ,(Lio/netty/channel/ChannelHandlerContext;J)V??
? fireChannelRead <(Ljava/lang/Object;)Lio/netty/channel/ChannelHandlerContext;?? ?? maxLocalRead
maxGlobalRead /Lio/netty/util/Attribute; Lio/netty/util/Attribute;
reopenTask Ljava/lang/Runnable; Lio/netty/channel/ChannelConfig;
waitGlobal msg maximumCumulativeWrittenBytes maximumCumulativeReadBytes channelTrafficCounters @(Lio/netty/handler/traffic/GlobalChannelTrafficShapingHandler;)V >?
? ^(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V
getWriteLimit? ?
? writeTimeToWait??
Q? io/netty/channel/ChannelPromise Write suspend: submitWrite a(Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;JJJLio/netty/channel/ChannelPromise;)V
maxLocalWrite maxGlobalWrite isEmpty
?
w(JLjava/lang/Object;JLio/netty/channel/ChannelPromise;Lio/netty/handler/traffic/GlobalChannelTrafficShapingHandler$1;)V >
addLast?
checkWriteSuspend -(Lio/netty/channel/ChannelHandlerContext;JJ)V
setUserDefinedWritability ,(Lio/netty/channel/ChannelHandlerContext;Z)V
relativeTimeAction # ?(Lio/netty/handler/traffic/GlobalChannelTrafficShapingHandler;Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/traffic/GlobalChannelTrafficShapingHandler$PerChannel;J)V >
newToSend
writedelay delay globalSizeExceeded futureNow forSchedule sendAllValid t(Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/traffic/GlobalChannelTrafficShapingHandler$PerChannel;J)V pollFirst) ?
* ? # , addFirst.?
/ flush *()Lio/netty/channel/ChannelHandlerContext;12 ?3 (I)V >5
6
( Write Channel Limit: 9 Read Channel Limit: ;
access$100'(
> x0 x1 x2 x3 4io/netty/util/internal/logging/InternalLoggerFactoryE getInstance B(Ljava/lang/Class;)Lio/netty/util/internal/logging/InternalLogger;GH
FI Signature
ConstantValue Code LocalVariableTable LineNumberTable
StackMapTable
Exceptions LocalVariableTypeTable C()Ljava/util/Collection;
SourceFile InnerClasses RuntimeVisibleAnnotations ! K ! @ " # B $ # B % # &