Class SlidingWindow.Builder<T>
java.lang.Object
com.aizuda.snailjob.client.common.window.SlidingWindow.Builder<T>
- Type Parameters:
T-
- Enclosing class:
- SlidingWindow<T>
滑动窗口构建器
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()构建滑动窗口对象static <T> SlidingWindow.Builder<T>创建一个新的构建器withDuration(long duration, ChronoUnit chronoUnit) 添加窗口期时间withListener(Listener<T> listener) 添加监听器withScheduledExecutorServiced(ScheduledExecutorService threadPoolExecutor) 添加定时调度线程池withTotalThreshold(int totalThreshold) 总量窗口期阈值withWindowTotalThreshold(int windowTotalThreshold) 窗口数量预警
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
newBuilder
创建一个新的构建器- Type Parameters:
T-- Returns:
- this
-
withTotalThreshold
总量窗口期阈值- Parameters:
totalThreshold- 总量窗口期阈值- Returns:
- this
-
withWindowTotalThreshold
窗口数量预警- Parameters:
windowTotalThreshold- 窗口数量阈值- Returns:
- this
-
withListener
添加监听器- Parameters:
listener- 监听器- Returns:
- this
-
withDuration
添加窗口期时间- Parameters:
duration- 时长chronoUnit- 单位- Returns:
- this
-
withScheduledExecutorServiced
public SlidingWindow.Builder<T> withScheduledExecutorServiced(ScheduledExecutorService threadPoolExecutor) 添加定时调度线程池- Parameters:
threadPoolExecutor- 线程池对象- Returns:
- this
-
build
构建滑动窗口对象- Returns:
SlidingWindow滑动窗口对象
-