All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.groupbyinc.flux.common.util.concurrent.QueueResizingEsThreadPoolExecutor.class Maven / Gradle / Ivy

There is a newer version: 59
Show newest version
????4?Lcom/groupbyinc/flux/common/util/concurrent/QueueResizingEsThreadPoolExecutor?com/groupbyinc/flux/common/util/concurrent/EsThreadPoolExecutor&QueueResizingEsThreadPoolExecutor.java%java/lang/invoke/MethodHandles$Lookupjava/lang/invoke/MethodHandlesLookup
EWMA_ALPHADlogger!Lorg/apache/logging/log4j/Logger;QUEUE_ADJUSTMENT_AMOUNTI2runnableWrapperLjava/util/function/Function;GLjava/util/function/Function;	workQueueCLcom/groupbyinc/flux/common/util/concurrent/ResizableBlockingQueue;YLcom/groupbyinc/flux/common/util/concurrent/ResizableBlockingQueue;
tasksPerFrameminQueueSizemaxQueueSizetargetedResponseTimeNanosJ
executionEWMA?Lcom/groupbyinc/flux/common/ExponentiallyWeightedMovingAverage;totalTaskNanos(Ljava/util/concurrent/atomic/AtomicLong;	taskCount+Ljava/util/concurrent/atomic/AtomicInteger;startNs$assertionsDisabledZi(Ljava/lang/String;IIJLjava/util/concurrent/TimeUnit;Lcom/groupbyinc/flux/common/util/concurrent/ResizableBlockingQueue;IILjava/util/function/Function;ILcom/groupbyinc/flux/common/unit/TimeValue;Ljava/util/concurrent/ThreadFactory;Lcom/groupbyinc/flux/common/util/concurrent/XRejectedExecutionHandler;Lcom/groupbyinc/flux/common/util/concurrent/ThreadContext;)V?(Ljava/lang/String;IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;Lcom/groupbyinc/flux/common/util/concurrent/XRejectedExecutionHandler;Lcom/groupbyinc/flux/common/util/concurrent/ThreadContext;)V&(
)&java/util/concurrent/atomic/AtomicLong+(J)V&-
,. 	0)java/util/concurrent/atomic/AtomicInteger2(I)V&4
35!"	7	9	;	=java/lang/System?nanoTime()JAB
@C#	E	G	I)com/groupbyinc/flux/common/unit/TimeValueKgetNanosMB
LN	P=com/groupbyinc/flux/common/ExponentiallyWeightedMovingAverageR	T(DD)V&V
SW	Y
	[Pthread pool [{}] will adjust queue by [{}] when determining automatic queue size]getName()Ljava/lang/String;_`
ajava/lang/IntegercvalueOf(I)Ljava/lang/Integer;ef
dgorg/apache/logging/log4j/Loggeridebug9(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)VkljmthisNLcom/groupbyinc/flux/common/util/concurrent/QueueResizingEsThreadPoolExecutor;nameLjava/lang/String;corePoolSizemaximumPoolSize
keepAliveTimeunitLjava/util/concurrent/TimeUnit;targetedResponseTime+Lcom/groupbyinc/flux/common/unit/TimeValue;
threadFactory$Ljava/util/concurrent/ThreadFactory;handlerFLcom/groupbyinc/flux/common/util/concurrent/XRejectedExecutionHandler;
contextHolder:Lcom/groupbyinc/flux/common/util/concurrent/ThreadContext;	doExecute(Ljava/lang/Runnable;)Vjava/util/function/Function?apply&(Ljava/lang/Object;)Ljava/lang/Object;????java/lang/Runnable???
?commandLjava/lang/Runnable;calculateLambda(IJ)D$%	?java/lang/AssertionError?java/lang/StringBuilder?()V&?
??/cannot calculate for instantaneous tasks, got: ?append-(Ljava/lang/String;)Ljava/lang/StringBuilder;??
??(J)Ljava/lang/StringBuilder;??
??toString?`
??(Ljava/lang/Object;)V&?
??$cannot calculate for no tasks, got: ?(I)Ljava/lang/StringBuilder;??
??totalNumberOfTaskstotalFrameTaskNanos
calculateL(DJ)I+cannot calculate for instantaneous requests?java/lang/Math?
toIntExact(J)I??
??lambdagetCurrentCapacity()IAcom/groupbyinc/flux/common/util/concurrent/ResizableBlockingQueue?capacity??
??getTaskExecutionEWMA()D
getAverage??
S?getCurrentQueueSizesize??
??afterExecute,(Ljava/lang/Runnable;Ljava/lang/Throwable;)Vjava/lang/ArithmeticException???
?8com/groupbyinc/flux/common/util/concurrent/TimedRunnable?%expected only TimedRunnables in queue?
getTotalNanos?B
??	addAndGet(J)J??
,?getTotalExecutionNanos?B
??=expected task to always take longer than 0 nanoseconds, got: ?addValue(D)V??
S?incrementAndGet??
3?max(JJ)J??
????
???
?isDebugEnabled()Z??j??[{}]: there were [{}] tasks in [{}], avg task time [{}], EWMA task execution [{}], [{} tasks/s], optimal queue is [{}], current capacity [{}]?timeValueNanos.(J)Lcom/groupbyinc/flux/common/unit/TimeValue;??
L?java/util/Locale?ROOTLjava/util/Locale;??	??%.2f?java/lang/ObjecttimeValueSeconds?
LnanosB
Ljava/lang/Double	(D)Ljava/lang/Double;e

java/lang/StringformatK(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
?(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Vkjjava/lang/ThrowableadjustCapacity(IIII)I
?Hadjusted [{}] queue size by [{}], old capacity: [{}], new capacity: [{}]](Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Vkj (I)I?"
3#%tasks should never be negative, got: %][{}]: too many incoming tasks while queue size adjustment occurs, resetting measurements to 0''(Ljava/lang/String;Ljava/lang/Object;)Vk)j*	getAndSet,?
,-,"
3/"java/lang/invoke/LambdaMetafactory1metafactory?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;34
256,()Lorg/apache/logging/log4j/message/Message;8lambda$afterExecute$0.(JJ)Lorg/apache/logging/log4j/message/Message;:;
<=get?(Lcom/groupbyinc/flux/common/util/concurrent/QueueResizingEsThreadPoolExecutor;JJ)Lorg/apache/logging/log4j/util/MessageSupplier;?@AwarnG(Lorg/apache/logging/log4j/util/MessageSupplier;Ljava/lang/Throwable;)VCDjEavgTaskTimedesiredQueueSizeoldCapacitynewCapacitytaskseLjava/lang/ArithmeticException;	endTimeNstotalRuntimertLjava/lang/Throwable;	taskNanos
totalNanostaskExecutionNanosappendThreadPoolExecutorDetails(Ljava/lang/StringBuilder;)Vmin queue capacity = X, Zmax queue capacity = \
frame size = ^targeted response rate = `-(Ljava/lang/Object;)Ljava/lang/StringBuilder;?b
?ctask execution EWMA = eadjustment amount = gsbLjava/lang/StringBuilder;5org/apache/logging/log4j/message/ParameterizedMessagek|failed to calculate optimal queue size for [{}] thread pool, total frame time [{}ns], tasks [{}], task execution time [{}ns]mjava/lang/Longo(J)Ljava/lang/Long;eq
pr((Ljava/lang/String;[Ljava/lang/Object;)V&t
lujava/lang/ClassxdesiredAssertionStatusz?
y{??3333332com/groupbyinc/flux/common/logging/ESLoggerFactory	getLogger4(Ljava/lang/Class;)Lorg/apache/logging/log4j/Logger;??
??
ConstantValue	SignatureCodeLocalVariableTableLocalVariableTypeTableLineNumberTable?(Ljava/lang/String;IIJLjava/util/concurrent/TimeUnit;Lcom/groupbyinc/flux/common/util/concurrent/ResizableBlockingQueue;IILjava/util/function/Function;ILcom/groupbyinc/flux/common/unit/TimeValue;Ljava/util/concurrent/ThreadFactory;Lcom/groupbyinc/flux/common/util/concurrent/XRejectedExecutionHandler;Lcom/groupbyinc/flux/common/util/concurrent/ThreadContext;)V
StackMapTableBootstrapMethods
SourceFileInnerClasses1	
??? !"#$%&'??|*+
?**?,Y	?/?1*?3Y?6?8*
?:*?<*?>*?D?F*?H*	?J*?O?Q*?SY?U?X?Z?\^*?b2?h?n???|op|qr|s|t|u|vw|||	|
||xy|z{
||}|~?||
?>C9:+E1F7G=HDIJJPKYLhMnNvM{O?????J**?:+????????op???
WX????R???$	????Y??Y???????????????"???Y??Y??????????????o??R?R??b'cLj?'$???`??? 	??
??Y????& ?k???????
uw????2*??r?D7		*?Fe7*	?F*?>
???9

*?Q??6*??m7?\?*?b*?>?h????*?Z?ŏ?????Y
???k?
S??h?h?
*?<2*?H*?J?6?8?\???-?\*?b?2?θh?h?h?!*?8*?>t?$6
???%
? ??Y??Y??&??
???????
*?>?.?\(*?b?+*?1
?.X*?8?0W*?D?F?*?1u??X?:
?\*?B
?F*?8*?>t?$6
???%
? ??Y??Y??&??
???????
*?>?.?\(*?b?+*?1
?.X*?8?0W*?D?F?*?1u??X?}:*?8*?>t?$6???%? ??Y??Y??&?????????*?>?.?\(*?b?+*?1
?.X*?8?0W*?D?F?*?1u??X???h???hn??nnpn???RG???
??H??I,<JvgK
?LM
gK
~gK~jN	?aO?op?P??QR%?S/?T8?U?E???%?/?8?a?k?y?~???????????????????????????
????'?,?>?H?[?c?h?v??????????????????????????,?5?<???D?M?V?`?k?n?~????????????????????????C????<?j??j???53?
B??K3?
B?7?3?
??VW???+Y??*?H??[??W+]??*?J??[??W+_??*?>??[??W+a??*?Q???d[??W+f??*?Z?ŏ???d[??W+h??2??[??W???op?ij???*???W?s???:;?t.?lYn?Y*?bSY?sSY*?>?hSY!?sS?v?? .op.O.T???-?w??R?|????}?U???\??'*,-,?@?79>9??
	





© 2015 - 2025 Weber Informatics LLC | Privacy Policy