Chris M. Hostetter created LUCENE-10675:
-------------------------------------------
Summary: MonitorConfiguration should support disabling scheduled
purgeCache
Key: LUCENE-10675
URL: https://issues.apache.org/jira/browse/LUCENE-10675
Project: Lucene - Core
Issue Type: Improvement
Components: modules/monitor
Reporter: Chris M. Hostetter
Monitors (using WritableQueryIndex) automatically create a private
ScheduledExecutor using a hardcoded ThreadFactory to schedule a periodic call
to the {{purgeCache()}} method.
The frequency of this periodic schedule can be adjusted via
MonitorConifguration – but it can't be disabled.
This seems odd because:
* {{purgeCache()}} is a public method that applications using a Monitor can
invoke themselves (possible via their own ScheduledExecutor)
* In a lot of usecases there's no need for periodicly calling this method –
it's enough to call exactly once after {{{}register(){}}}-ing or
{{{}deleteById(){}}}-ing one or more batches of {{MonitorQuery}} objects.
there is zero reason to call it again unless/untill something changes.
----
I propose we tweak the MonitorConfiguration API spec, and the use of the
configuration in the code, such that if the configured purgeFrequency is a
negative number, The {{purgeExecutor}} remains null (and no Executor is ever
created)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]