Dieter
07/20/2022, 11:01 AMKonstantin
07/20/2022, 11:39 AMDieter
07/20/2022, 11:59 AMMaciej Obuchowski
07/20/2022, 1:41 PMDieter
07/20/2022, 2:11 PMadd to add the newest value. But there seems to be no remove to remove the oldest. That means I would need to call clear and addAll. Would that be correct?
How would that affect the performance?Maciej Obuchowski
07/20/2022, 4:04 PMValueState<DataStructure<T>> - I think the only problem with that is that you always have to serialize and deserialize whole structure when you refer to it. At least if you use the RocksDB state backend.Ken Krugler
07/20/2022, 4:46 PMMapState<Integer, YourValueType>, where the key is an incrementing value. Then you have two ValueState<Integer> states, one for the lowest index, and the other for the highest index. When you add a value, you’d increment the highest index, then use the two index states to determine the number of records. If you need to flush, you can remove the specific element(s) from the MapState, then update your lowest index state. RocksDB stores each row as a separate object, thus you avoid de/re-serialization of all state.Dieter
07/20/2022, 5:46 PM