| 构造器和说明 |
|---|
SlidingTimeWindowReservoir(long window,
TimeUnit windowUnit)
Creates a new
SlidingTimeWindowReservoir with the given window of time. |
SlidingTimeWindowReservoir(long window,
TimeUnit windowUnit,
Clock clock)
Creates a new
SlidingTimeWindowReservoir with the given clock and window of time. |
public SlidingTimeWindowReservoir(long window,
TimeUnit windowUnit)
SlidingTimeWindowReservoir with the given window of time.window - the window of timewindowUnit - the unit of windowpublic SlidingTimeWindowReservoir(long window,
TimeUnit windowUnit,
Clock clock)
SlidingTimeWindowReservoir with the given clock and window of time.window - the window of timewindowUnit - the unit of windowclock - the Clock to usepublic int size()
Reservoirpublic void update(long value)
Reservoirpublic Snapshot getSnapshot()
ReservoirgetSnapshot 在接口中 ReservoirCopyright © 2020. All rights reserved.