Package cz.o2.proxima.core.storage
Interface ThroughputLimiter
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable,java.io.Serializable
- All Known Implementing Classes:
GlobalWatermarkThroughputLimiter,ThroughputLimiter.NoOpThroughputLimiter
@Evolving public interface ThroughputLimiter extends java.io.Serializable, java.io.Closeable
A limiter of data rate coming from various sources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceThroughputLimiter.ContextA context ofgetPauseTime(cz.o2.proxima.core.storage.ThroughputLimiter.Context)method.static classThroughputLimiter.NoOpThroughputLimiter
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()java.time.DurationgetPauseTime(ThroughputLimiter.Context context)Retrieve the amount of time the source should pause processing for.default voidsetup(java.util.Map<java.lang.String,java.lang.Object> cfg)Setup the limiter with given configuration.
-
-
-
Method Detail
-
setup
default void setup(java.util.Map<java.lang.String,java.lang.Object> cfg)
Setup the limiter with given configuration.- Parameters:
cfg- configuration (scoped to a (operator) defined prefix)
-
getPauseTime
java.time.Duration getPauseTime(ThroughputLimiter.Context context)
Retrieve 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.- Parameters:
context- context for the limiter- Returns:
- the amount of time to pause the source for.
-
close
void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-