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 interface
ThroughputLimiter.Context
A context ofgetPauseTime(cz.o2.proxima.core.storage.ThroughputLimiter.Context)
method.static class
ThroughputLimiter.NoOpThroughputLimiter
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
java.time.Duration
getPauseTime(ThroughputLimiter.Context context)
Retrieve the amount of time the source should pause processing for.default void
setup(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 andmust
be therefore cheap.- Parameters:
context
- context for the limiter- Returns:
- the amount of time to pause the source for.
-
close
void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-