Class EagerBufferConfigImpl
- java.lang.Object
-
- org.apache.kafka.streams.kstream.internals.suppress.EagerBufferConfigImpl
-
- All Implemented Interfaces:
Suppressed.BufferConfig
public class EagerBufferConfigImpl extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description EagerBufferConfigImpl(long maxRecords, long maxBytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BufferFullStrategy
bufferFullStrategy()
Suppressed.BufferConfig
emitEarlyWhenFull()
Set the buffer to just emit the oldest records when any of its constraints are violated.boolean
equals(java.lang.Object o)
int
hashCode()
long
maxBytes()
long
maxRecords()
Suppressed.StrictBufferConfig
shutDownWhenFull()
Set the buffer to gracefully shut down the application when any of its constraints are violated This buffer is "strict" in the sense that it will enforce the time bound or shut down.java.lang.String
toString()
Suppressed.BufferConfig
withMaxBytes(long byteLimit)
Set a size constraint on the buffer, the maximum number of bytes it will use.Suppressed.BufferConfig
withMaxRecords(long recordLimit)
Set a size constraint on the buffer in terms of the maximum number of keys it will store.Suppressed.StrictBufferConfig
withNoBound()
Set the buffer to be unconstrained by size (either keys or bytes).
-
-
-
Method Detail
-
withMaxRecords
public Suppressed.BufferConfig withMaxRecords(long recordLimit)
Description copied from interface:Suppressed.BufferConfig
Set a size constraint on the buffer in terms of the maximum number of keys it will store.
-
withMaxBytes
public Suppressed.BufferConfig withMaxBytes(long byteLimit)
Description copied from interface:Suppressed.BufferConfig
Set a size constraint on the buffer, the maximum number of bytes it will use.
-
maxRecords
public long maxRecords()
-
maxBytes
public long maxBytes()
-
bufferFullStrategy
public BufferFullStrategy bufferFullStrategy()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
withNoBound
public Suppressed.StrictBufferConfig withNoBound()
Description copied from interface:Suppressed.BufferConfig
Set the buffer to be unconstrained by size (either keys or bytes). As a result, the buffer will consume as much memory as it needs, dictated by the time bound. If there isn't enough heap available to meet the demand, the application will encounter anOutOfMemoryError
and shut down (not guaranteed to be a graceful exit). Also, note that JVM processes under extreme memory pressure may exhibit poor GC behavior. This is a convenient option if you doubt that your buffer will be that large, but also don't wish to pick particular constraints, such as in testing. This buffer is "strict" in the sense that it will enforce the time bound or crash. It will never emit early.- Specified by:
withNoBound
in interfaceSuppressed.BufferConfig<BC extends Suppressed.BufferConfig<BC>>
-
shutDownWhenFull
public Suppressed.StrictBufferConfig shutDownWhenFull()
Description copied from interface:Suppressed.BufferConfig
Set the buffer to gracefully shut down the application when any of its constraints are violated This buffer is "strict" in the sense that it will enforce the time bound or shut down. It will never emit early.- Specified by:
shutDownWhenFull
in interfaceSuppressed.BufferConfig<BC extends Suppressed.BufferConfig<BC>>
-
emitEarlyWhenFull
public Suppressed.BufferConfig emitEarlyWhenFull()
Description copied from interface:Suppressed.BufferConfig
Set the buffer to just emit the oldest records when any of its constraints are violated. This buffer is "not strict" in the sense that it may emit early, so it is suitable for reducing duplicate results downstream, but does not promise to eliminate them.- Specified by:
emitEarlyWhenFull
in interfaceSuppressed.BufferConfig<BC extends Suppressed.BufferConfig<BC>>
-
-