nickva commented on code in PR #5625: URL: https://github.com/apache/couchdb/pull/5625#discussion_r2298432070
########## src/couch/src/couch_bt_engine_cache.erl: ########## @@ -0,0 +1,251 @@ +% Licensed under the Apache License, Version 2.0 (the "License"); you may not +% use this file except in compliance with the License. You may obtain a copy of +% the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +% License for the specific language governing permissions and limitations under +% the License. + +-module(couch_bt_engine_cache). + +% Main API +% +-export([ + insert/2, + insert/3, + reset/1, + lookup/1, + status/0 +]). + +% Supervision and start API +% +-export([ + create_tables/0, + sup_children/0, + start_link/1, + init/1 +]). + +-define(DEFAULT_SIZE, 67108864). +-define(DEFAULT_LEAVE_PERCENT, 30). +-define(INTERVAL_MSEC, 3000). +% If we didn't clean any entries how often to poll ets size to start cleaning Review Comment: Thank you. You're right that is confusing. I think something like this might be more clear: ``` % How often cleaners check if the ets size increases. This is used in cases % when initially, at the start the cleaning interval, ets table size is below % "leave percent". Then we skip cleaning all the 0 usage entries. However, if a % new set of requests come in soon after, but before the next clean-up interval % they'll fail since the cache would be full. To be able to react quicker and % make room, cleaners poll table sizes a bit more often. ``` -- 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: notifications-unsubscr...@couchdb.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org