-
Ottomata authored
Dynamic stream config has been buggy, and in hindsight, we don't need it. We need: - the ability to refresh stream config periodically - the ability to match regex stream names keys in stram config against requested stream names We don't necessarily need to fetch a specific stream config from stream_config_uri at runtime. We can simply fetch all of the stream configs from stream_config_uri at initialization, and then if configured, periodically re-fetch from stream_config_uri. This patch: - Removes support for dynamic_stream_config, stream_config_recache_on_expire, and stream_config_precache_list - Removes support for templated stream_config_uri. We don't need this anymore if we don't request specific streams from stream_config_uri. - Removes CachedMap and use of node-cache to look up and cache stream configs at runtime. - Adds a new StreamConfigs class that implements the same API as CachedMap, except that the lookup functions are no longer async. - When streams are looked up by regex, the cached stream config will be mutated to include an entry for the match. This keeps previous behavior where dynamically looking up a regex matched stream config would have that stream config cached under that stream name key. - Removes use of bluebird Promises. Most use the async sugar anyway, only a test still used bluebird, and native Promise is fine. Behavior changes: - A failed re-fetch after stream_config_ttl will not flush previously fetch stream configs. The previously fetched stream configs will be used until the next successful re-fetch. In the previous version, dynamic stream config would take care of this, as if a stream config wasn't cached, it would be attemted to be cached the next time it was needed. Bug: T326002 Change-Id: I9787a1c670e3d1b6f4a58e15d3dca3fb66a1558b
7296d053