类 SlidingWindow.Builder<T>
java.lang.Object
com.aizuda.easy.retry.client.common.window.SlidingWindow.Builder<T>
- 类型参数:
T-
- 封闭类:
- SlidingWindow<T>
滑动窗口构建器
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明build()构建滑动窗口对象static <T> SlidingWindow.Builder<T>创建一个新的构建器withDuration(long duration, ChronoUnit chronoUnit) 添加窗口期时间withListener(Listener<T> listener) 添加监听器withScheduledExecutorServiced(ScheduledExecutorService threadPoolExecutor) 添加定时调度线程池withTotalThreshold(int totalThreshold) 总量窗口期阈值withWindowTotalThreshold(int windowTotalThreshold) 窗口数量预警
-
构造器详细资料
-
Builder
public Builder()
-
-
方法详细资料
-
newBuilder
创建一个新的构建器- 类型参数:
T-- 返回:
- this
-
withTotalThreshold
总量窗口期阈值- 参数:
totalThreshold- 总量窗口期阈值- 返回:
- this
-
withWindowTotalThreshold
窗口数量预警- 参数:
windowTotalThreshold- 窗口数量阈值- 返回:
- this
-
withListener
添加监听器- 参数:
listener- 监听器- 返回:
- this
-
withDuration
添加窗口期时间- 参数:
duration- 时长chronoUnit- 单位- 返回:
- this
-
withScheduledExecutorServiced
public SlidingWindow.Builder<T> withScheduledExecutorServiced(ScheduledExecutorService threadPoolExecutor) 添加定时调度线程池- 参数:
threadPoolExecutor- 线程池对象- 返回:
- this
-
build
构建滑动窗口对象- 返回:
SlidingWindow滑动窗口对象
-