In Ambari 2.4.0, during the initial integration with LogSearch, a cache was implemented to reduce the number of calls to the LogSearch service when the PropertyProvider implementation for LogSearch integration is called in other contexts (such as Rolling/Express Upgrades, REST API calls on the HostComponent resource, etc).
That cache was implemented in the following class:
In the initial implementation, the cache was hard-coded to expire within in hour.
An hour is probably too short of an interval, since the cache data is unlikely to change often. This timeout should be a configurable option in the Ambari LogSearch Integration code.
1. The default timeout should be much larger, as this information obtained from the LogSearch service is generally static. We should increase the timeout to be at least 24 hours, or perhaps move to an unbounded timeout, provided that the timeout would be configurable.
2. The max timeout for the cache should be configurable in ambari.properties, with a reasonable default if not set (as mentioned above).