damccorm commented on code in PR #37214:
URL: https://github.com/apache/beam/pull/37214#discussion_r2662010685
##########
sdks/typescript/src/apache_beam/worker/state.ts:
##########
@@ -49,9 +49,37 @@ export interface StateProvider {
export class CachingStateProvider implements StateProvider {
underlying: StateProvider;
cache: Map<string, MaybePromise<any>> = new Map();
+ maxCacheSize: number;
- constructor(underlying: StateProvider) {
+ constructor(underlying: StateProvider, maxCacheSize: number = 1000) {
Review Comment:
Rather than just using the number of elements, I think it would be better to
use the size of the elements (similar to
https://github.com/apache/beam/blob/44ed498ee5cb3336cc3915732b0fa6b2068c1f58/sdks/python/apache_beam/runners/worker/statecache.py#L285
). That way we're evicting based on memory consumed instead of just number of
keys.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]