Class Buffer<K extends Comparable<K>>
java.lang.Object
io.aiven.commons.kafka.connector.source.lookback.Buffer<K>
- Type Parameters:
K- the key type.
- All Implemented Interfaces:
Lookback<K>
Lookback that uses a buffer to track the last N records.
-
Method Details
-
add
Description copied from interface:LookbackAdds a key to the lookback tracking.- Specified by:
addin interfaceLookback<K extends Comparable<K>>- Parameters:
key- the key to add.
-
get
Description copied from interface:LookbackGets the key to query for.- Specified by:
getin interfaceLookback<K extends Comparable<K>>- Returns:
- the key to query for.
-
contains
Description copied from interface:LookbackDetermines if the key is in the lookback.- Specified by:
containsin interfaceLookback<K extends Comparable<K>>- Parameters:
key- the key to search for.- Returns:
- true if this lookback holds the key.
-
size
public int size()Description copied from interface:LookbackGets the number of keys this Lookback can store.- Specified by:
sizein interfaceLookback<K extends Comparable<K>>- Returns:
- the number of keys this Lookback can store.
-
resize
Description copied from interface:LookbackResize the lookback. May resize this lookback or create new one. The resulting lookback will contain as much of the latest data from this lookback as possible in the new configuration.- Specified by:
resizein interfaceLookback<K extends Comparable<K>>- Parameters:
size- the desired size of the lookback. Ifsize < 0then 0 is used.- Returns:
- a
Lookbackinstance of the desired size.
-