anchor.diff:  %% limitations under the License.
   %%
   -module(index_settings_manager).
  +
  +-include("ns_common.hrl").
   
   -define(INDEX_CONFIG_KEY, {metakv, <<"/indexing/settings/config">>}).
   
  
positive.code:     erlang:put(prev_json, JSON).
  
  known_settings() ->
      [{memoryQuota, id_lens(<<"indexer.settings.memory_quota">>), 256},
       {generalSettings, general_settings_lens(), general_settings_defaults()},
       {compaction, compaction_lens(), compaction_defaults()}].
  
  
negative.code:           end,
      Set = fun (Value, Dict) ->
                    dict:store(Key, Value, Dict)
            end,
      {Get, Set}.
  
  memory_quota_lens() ->
      Key = <<"indexer.settings.memory_quota">>,
  
      Get = fun (Dict) ->
                    dict:fetch(Key, Dict) div ?MIB
            end,
      Set = fun (Value, Dict) ->
                    dict:store(Key, Value * ?MIB, Dict)
            end,
      {Get, Set}.
  
  