Class AutoScalingEventExecutorChooserFactory.AutoScalingEventExecutorChooser
java.lang.Object
io.netty.util.concurrent.AutoScalingEventExecutorChooserFactory.AutoScalingEventExecutorChooser
- All Implemented Interfaces:
EventExecutorChooserFactory.EventExecutorChooser, EventExecutorChooserFactory.ObservableEventExecutorChooser
- Enclosing class:
AutoScalingEventExecutorChooserFactory
private final class AutoScalingEventExecutorChooserFactory.AutoScalingEventExecutorChooser
extends Object
implements EventExecutorChooserFactory.ObservableEventExecutorChooser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EventExecutorChooserFactory.EventExecutorChooserprivate final EventExecutor[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the current number of activeEventExecutors.Returns a list containing the last calculated utilization for eachEventExecutorin the group.next()This method is only responsible for picking from the active executors list.private voidtryScaleUpBy(int amount) Tries to increase the active thread count by waking up suspended executors.
-
Field Details
-
executors
-
allExecutorsChooser
-
state
-
utilizationMetrics
private final List<AutoScalingEventExecutorChooserFactory.AutoScalingUtilizationMetric> utilizationMetrics
-
-
Constructor Details
-
AutoScalingEventExecutorChooser
AutoScalingEventExecutorChooser(EventExecutor[] executors)
-
-
Method Details
-
next
This method is only responsible for picking from the active executors list. The monitor handles all scaling decisions.- Specified by:
nextin interfaceEventExecutorChooserFactory.EventExecutorChooser
-
tryScaleUpBy
private void tryScaleUpBy(int amount) Tries to increase the active thread count by waking up suspended executors. This method is thread-safe and updates the state atomically.- Parameters:
amount- The desired number of threads to add to the active count.
-
activeExecutorCount
public int activeExecutorCount()Description copied from interface:EventExecutorChooserFactory.ObservableEventExecutorChooserReturns the current number of activeEventExecutors.- Specified by:
activeExecutorCountin interfaceEventExecutorChooserFactory.ObservableEventExecutorChooser- Returns:
- the number of active executors.
-
executorUtilizations
public List<AutoScalingEventExecutorChooserFactory.AutoScalingUtilizationMetric> executorUtilizations()Description copied from interface:EventExecutorChooserFactory.ObservableEventExecutorChooserReturns a list containing the last calculated utilization for eachEventExecutorin the group.- Specified by:
executorUtilizationsin interfaceEventExecutorChooserFactory.ObservableEventExecutorChooser- Returns:
- an umodifiable view of the executor utilizations.
-