Class GlobalWatermarkThroughputLimiter
- java.lang.Object
-
- cz.o2.proxima.core.storage.watermark.GlobalWatermarkThroughputLimiter
-
- All Implemented Interfaces:
ThroughputLimiter,java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable
public class GlobalWatermarkThroughputLimiter extends java.lang.Object implements ThroughputLimiter
AThroughputLimiterthat synchronizes progress of global watermark among distributed consumers.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cz.o2.proxima.core.storage.ThroughputLimiter
ThroughputLimiter.Context, ThroughputLimiter.NoOpThroughputLimiter
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_SLEEP_TIME_CFGConfiguration key for the amount of time to sleep when reader is too far ahead global watermark in milliseconds.static java.lang.StringGLOBAL_WATERMARK_UPDATE_MS_CFGConfiguration key for number of milliseconds to pass between two updates of global watermark.static java.lang.StringMAX_AHEAD_TIME_MS_CFGConfiguration key for maximum amount of time that a reader can be ahead of a global watermark in milliseconds.
-
Constructor Summary
Constructors Constructor Description GlobalWatermarkThroughputLimiter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.time.DurationgetPauseTime(ThroughputLimiter.Context context)Retrieve the amount of time the source should pause processing for.protected java.lang.ObjectreadResolve()voidsetup(java.util.Map<java.lang.String,java.lang.Object> cfg)Setup the limiter with given configuration.java.lang.StringtoString()
-
-
-
Field Detail
-
MAX_AHEAD_TIME_MS_CFG
public static final java.lang.String MAX_AHEAD_TIME_MS_CFG
Configuration key for maximum amount of time that a reader can be ahead of a global watermark in milliseconds.- See Also:
- Constant Field Values
-
GLOBAL_WATERMARK_UPDATE_MS_CFG
public static final java.lang.String GLOBAL_WATERMARK_UPDATE_MS_CFG
Configuration key for number of milliseconds to pass between two updates of global watermark.- See Also:
- Constant Field Values
-
DEFAULT_SLEEP_TIME_CFG
public static final java.lang.String DEFAULT_SLEEP_TIME_CFG
Configuration key for the amount of time to sleep when reader is too far ahead global watermark in milliseconds.- See Also:
- Constant Field Values
-
-
Method Detail
-
setup
public void setup(java.util.Map<java.lang.String,java.lang.Object> cfg)
Description copied from interface:ThroughputLimiterSetup the limiter with given configuration.- Specified by:
setupin interfaceThroughputLimiter- Parameters:
cfg- configuration (scoped to a (operator) defined prefix)
-
getPauseTime
public java.time.Duration getPauseTime(ThroughputLimiter.Context context)
Description copied from interface:ThroughputLimiterRetrieve the amount of time the source should pause processing for. If the reader should proceed without pausing returnDuration.ZERO. Note that this method is called for each input element andmustbe therefore cheap.- Specified by:
getPauseTimein interfaceThroughputLimiter- Parameters:
context- context for the limiter- Returns:
- the amount of time to pause the source for.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceThroughputLimiter
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
readResolve
protected java.lang.Object readResolve()
-
-