This is an automated email from the ASF dual-hosted git repository. vatamane pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/main by this push: new e9c5c605b Remove code_change and empty terminate callbacks e9c5c605b is described below commit e9c5c605bec40db59f305c89602f825dc1901270 Author: Nick Vatamaniuc <vatam...@gmail.com> AuthorDate: Fri Nov 17 14:22:01 2023 -0500 Remove code_change and empty terminate callbacks We don't support hot-code release upgrades and these are now optional gen_server callbacks. For references: https://www.erlang.org/doc/man/gen_server#Module:code_change-3 https://www.erlang.org/doc/man/gen_server#Module:terminate-2 --- src/chttpd/src/chttpd_auth_cache.erl | 6 +----- src/config/src/config.erl | 8 +------- src/config/src/config_listener.erl | 6 +----- src/config/src/config_listener_mon.erl | 10 +--------- src/config/src/config_notifier.erl | 10 +--------- src/couch/src/couch_db_updater.erl | 5 +---- src/couch/src/couch_event_sup.erl | 8 +------- src/couch/src/couch_file.erl | 5 +---- src/couch/src/couch_httpd_vhost.erl | 8 +------- src/couch/src/couch_multidb_changes.erl | 9 ++------- src/couch/src/couch_native_process.erl | 4 ---- src/couch/src/couch_os_process.erl | 5 +---- src/couch/src/couch_password_hasher.erl | 6 +----- src/couch/src/couch_proc_manager.erl | 6 +----- src/couch/src/couch_server.erl | 5 +---- src/couch/src/couch_stream.erl | 10 +--------- src/couch/src/couch_uuids.erl | 8 +------- src/couch/src/couch_work_queue.erl | 5 +---- src/couch/test/eunit/test_web.erl | 8 +------- src/couch_event/src/couch_event_server.erl | 10 +--------- src/couch_index/src/couch_index.erl | 5 +---- src/couch_index/src/couch_index_compactor.erl | 5 +---- src/couch_index/src/couch_index_server.erl | 5 +---- src/couch_index/src/couch_index_updater.erl | 5 +---- src/couch_log/src/couch_log_error_logger_h.erl | 10 +--------- src/couch_log/src/couch_log_monitor.erl | 10 +--------- src/couch_log/src/couch_log_server.erl | 6 +----- src/couch_log/test/eunit/couch_log_error_logger_h_test.erl | 7 +------ src/couch_log/test/eunit/couch_log_monitor_test.erl | 7 +------ src/couch_log/test/eunit/couch_log_server_test.erl | 4 ---- src/couch_mrview/src/couch_mrview_update_notifier.erl | 8 +------- src/couch_peruser/src/couch_peruser.erl | 12 +----------- src/couch_replicator/src/couch_replicator_auth_session.erl | 8 -------- src/couch_replicator/src/couch_replicator_clustering.erl | 10 +--------- src/couch_replicator/src/couch_replicator_connection.erl | 10 +--------- src/couch_replicator/src/couch_replicator_db_changes.erl | 10 +--------- src/couch_replicator/src/couch_replicator_doc_processor.erl | 10 +--------- src/couch_replicator/src/couch_replicator_httpc_pool.erl | 8 +------- src/couch_replicator/src/couch_replicator_notifier.erl | 8 +------- src/couch_replicator/src/couch_replicator_rate_limiter.erl | 10 +--------- src/couch_replicator/src/couch_replicator_scheduler.erl | 4 ---- src/couch_replicator/src/couch_replicator_scheduler_job.erl | 4 ---- src/couch_replicator/src/couch_replicator_worker.erl | 8 +------- src/couch_stats/src/couch_stats_process_tracker.erl | 10 +--------- src/custodian/src/custodian_db_checker.erl | 6 +----- src/custodian/src/custodian_server.erl | 9 --------- src/ddoc_cache/src/ddoc_cache_entry.erl | 6 +----- src/ddoc_cache/src/ddoc_cache_lru.erl | 6 +----- src/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl | 3 +-- src/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl | 7 +------ src/dreyfus/src/dreyfus_index.erl | 10 +--------- src/dreyfus/src/dreyfus_index_manager.erl | 10 +--------- src/ets_lru/src/ets_lru.erl | 7 +------ src/global_changes/src/global_changes_server.erl | 10 +--------- src/ioq/src/ioq.erl | 8 +------- src/jwtf/src/jwtf_keystore.erl | 10 +--------- src/ken/src/ken_server.erl | 10 ++-------- src/mango/src/mango_native_proc.erl | 6 +----- src/mem3/src/mem3_cluster.erl | 10 +--------- src/mem3/src/mem3_distribution.erl | 6 +----- src/mem3/src/mem3_nodes.erl | 10 +--------- src/mem3/src/mem3_reshard.erl | 6 +----- src/mem3/src/mem3_reshard_dbdoc.erl | 10 +--------- src/mem3/src/mem3_seeds.erl | 10 +--------- src/mem3/src/mem3_shards.erl | 5 +---- src/mem3/src/mem3_sync.erl | 8 +------- src/mem3/src/mem3_sync_event.erl | 10 +--------- src/mem3/src/mem3_sync_nodes.erl | 5 +---- src/rexi/src/rexi_buffer.erl | 13 +------------ src/rexi/src/rexi_server.erl | 6 +----- src/rexi/src/rexi_server_mon.erl | 12 +----------- src/smoosh/src/smoosh_server.erl | 4 ---- 72 files changed, 67 insertions(+), 482 deletions(-) diff --git a/src/chttpd/src/chttpd_auth_cache.erl b/src/chttpd/src/chttpd_auth_cache.erl index c664cd3a9..c3eb0a50f 100644 --- a/src/chttpd/src/chttpd_auth_cache.erl +++ b/src/chttpd/src/chttpd_auth_cache.erl @@ -19,8 +19,7 @@ handle_call/3, handle_cast/2, handle_info/2, - terminate/2, - code_change/3 + terminate/2 ]). -export([listen_for_changes/1, changes_callback/2]). @@ -145,9 +144,6 @@ terminate(_Reason, #state{changes_pid = Pid}) when is_pid(Pid) -> terminate(_Reason, _State) -> ok. -code_change(_OldVsn, #state{} = State, _Extra) -> - {ok, State}. - %% private functions spawn_changes(Since) -> diff --git a/src/config/src/config.erl b/src/config/src/config.erl index 62b5e6770..3ece5326b 100644 --- a/src/config/src/config.erl +++ b/src/config/src/config.erl @@ -36,7 +36,7 @@ -export([subscribe_for_changes/1]). -export([parse_ini_file/1]). --export([init/1, terminate/2, code_change/3]). +-export([init/1]). -export([handle_call/3, handle_cast/2, handle_info/2]). -export([is_sensitive/2]). @@ -264,9 +264,6 @@ init(IniFiles) -> debug_config(), {ok, #config{ini_files = IniFiles, write_filename = WriteFile}}. -terminate(_Reason, _State) -> - ok. - handle_call(all, _From, Config) -> Resp = lists:sort((ets:tab2list(?MODULE))), {reply, Resp, Config}; @@ -414,9 +411,6 @@ handle_info(Info, State) -> couch_log:error("config:handle_info Info: ~p~n", [Info]), {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - is_sensitive(Section, Key) -> Sensitive = application:get_env(config, sensitive, #{}), case maps:get(Section, Sensitive, false) of diff --git a/src/config/src/config_listener.erl b/src/config/src/config_listener.erl index 36d77d399..d63efc941 100644 --- a/src/config/src/config_listener.erl +++ b/src/config/src/config_listener.erl @@ -24,8 +24,7 @@ handle_event/2, handle_call/2, handle_info/2, - terminate/2, - code_change/3 + terminate/2 ]). -callback handle_config_change( @@ -69,6 +68,3 @@ handle_info(_Info, St) -> terminate(Reason, {Module, {Subscriber, State}}) -> Module:handle_config_terminate(Subscriber, Reason, State). - -code_change(_OldVsn, St, _Extra) -> - {ok, St}. diff --git a/src/config/src/config_listener_mon.erl b/src/config/src/config_listener_mon.erl index 9b72153e4..b74a61306 100644 --- a/src/config/src/config_listener_mon.erl +++ b/src/config/src/config_listener_mon.erl @@ -20,11 +20,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -record(st, { @@ -51,9 +49,6 @@ init({Pid, Mod, InitSt}) -> proc_lib:init_ack(Else) end. -terminate(_Reason, _St) -> - ok. - handle_call(_Message, _From, St) -> {reply, ignored, St}. @@ -74,6 +69,3 @@ handle_info({gen_event_EXIT, {config_listener, Module}, Reason}, St) -> {stop, shutdown, St}; handle_info(_, St) -> {noreply, St}. - -code_change(_OldVsn, St, _Extra) -> - {ok, St}. diff --git a/src/config/src/config_notifier.erl b/src/config/src/config_notifier.erl index 21c6387d2..b09d33fd6 100644 --- a/src/config/src/config_notifier.erl +++ b/src/config/src/config_notifier.erl @@ -23,9 +23,7 @@ init/1, handle_event/2, handle_call/2, - handle_info/2, - terminate/2, - code_change/3 + handle_info/2 ]). subscribe(Subscription) -> @@ -54,12 +52,6 @@ handle_call(_Request, St) -> handle_info(_Info, St) -> {ok, St}. -terminate(_Reason, {_Subscriber, _Subscription}) -> - ok. - -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - maybe_notify(Event, Subscriber, all) -> Subscriber ! Event; maybe_notify({config_change, Sec, Key, _, _} = Event, Subscriber, Subscription) -> diff --git a/src/couch/src/couch_db_updater.erl b/src/couch/src/couch_db_updater.erl index c7d896d3d..0747390b2 100644 --- a/src/couch/src/couch_db_updater.erl +++ b/src/couch/src/couch_db_updater.erl @@ -14,7 +14,7 @@ -behaviour(gen_server). -export([add_sizes/3, upgrade_sizes/1]). --export([init/1, terminate/2, handle_call/3, handle_cast/2, code_change/3, handle_info/2]). +-export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2]). -include_lib("couch/include/couch_db.hrl"). -include("couch_db_int.hrl"). @@ -251,9 +251,6 @@ handle_info(Msg, Db) -> Else end. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - sort_and_tag_grouped_docs(Client, GroupedDocs) -> % These groups should already be sorted but sometimes clients misbehave. % The merge_updates function will fail and the database can end up with diff --git a/src/couch/src/couch_event_sup.erl b/src/couch/src/couch_event_sup.erl index 661c6091a..5ddc561c0 100644 --- a/src/couch/src/couch_event_sup.erl +++ b/src/couch/src/couch_event_sup.erl @@ -20,7 +20,7 @@ -include_lib("couch/include/couch_db.hrl"). -export([start_link/3, start_link/4, stop/1]). --export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2, code_change/3]). +-export([init/1, handle_call/3, handle_cast/2, handle_info/2]). % % Instead calling the @@ -57,9 +57,6 @@ init({EventMgr, EventHandler, Args}) -> {stop, Error} end. -terminate(_Reason, _State) -> - ok. - handle_call(stop, _From, State) -> {stop, normal, ok, State}. @@ -68,6 +65,3 @@ handle_cast(_Msg, State) -> handle_info({gen_event_EXIT, _Handler, Reason}, State) -> {stop, Reason, State}. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. diff --git a/src/couch/src/couch_file.erl b/src/couch/src/couch_file.erl index 0afb23c55..336f5b59a 100644 --- a/src/couch/src/couch_file.erl +++ b/src/couch/src/couch_file.erl @@ -50,7 +50,7 @@ -export([last_read/1]). % gen_server callbacks --export([init/1, terminate/2, code_change/3, format_status/2]). +-export([init/1, terminate/2, format_status/2]). -export([handle_call/3, handle_cast/2, handle_info/2]). %% helper functions @@ -623,9 +623,6 @@ handle_call(find_header, _From, #file{fd = Fd, eof = Pos} = File) -> handle_cast(close, Fd) -> {stop, normal, Fd}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - handle_info(Msg, File) when ?IS_OLD_STATE(File) -> handle_info(Msg, upgrade_state(File)); handle_info(maybe_close, File) -> diff --git a/src/couch/src/couch_httpd_vhost.erl b/src/couch/src/couch_httpd_vhost.erl index 8d835fe8d..170e1a2f7 100644 --- a/src/couch/src/couch_httpd_vhost.erl +++ b/src/couch/src/couch_httpd_vhost.erl @@ -20,7 +20,7 @@ -export([urlsplit_netloc/2, redirect_to_vhost/2]). -export([host/1, split_host_port/1]). --export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). +-export([init/1, handle_call/3, handle_cast/2, handle_info/2]). % config_listener api -export([handle_config_change/5, handle_config_terminate/3]). @@ -412,12 +412,6 @@ handle_info(restart_config_listener, State) -> handle_info(_Info, State) -> {noreply, State}. -terminate(_Reason, _State) -> - ok. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - handle_config_change("vhosts", _, _, _, _) -> {ok, ?MODULE:reload()}; handle_config_change(_, _, _, _, _) -> diff --git a/src/couch/src/couch_multidb_changes.erl b/src/couch/src/couch_multidb_changes.erl index adb1b740f..a9b4c4fb6 100644 --- a/src/couch/src/couch_multidb_changes.erl +++ b/src/couch/src/couch_multidb_changes.erl @@ -23,8 +23,7 @@ terminate/2, handle_call/3, handle_info/2, - handle_cast/2, - code_change/3 + handle_cast/2 ]). -export([ @@ -163,9 +162,6 @@ handle_info({'EXIT', From, Reason}, #state{pids = Pids} = State) -> handle_info(_Msg, State) -> {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - % Private functions -spec register_with_event_server(pid()) -> reference(). @@ -721,8 +717,7 @@ t_start_link_no_ddocs() -> t_misc_gen_server_callbacks() -> ?_test(begin - ?assertEqual(ok, terminate(reason, state)), - ?assertEqual({ok, state}, code_change(old, state, extra)) + ?assertEqual(ok, terminate(reason, state)) end). scan_dbs_test_() -> diff --git a/src/couch/src/couch_native_process.erl b/src/couch/src/couch_native_process.erl index 2d234403b..c9280f1d7 100644 --- a/src/couch/src/couch_native_process.erl +++ b/src/couch/src/couch_native_process.erl @@ -43,10 +43,8 @@ -export([ start_link/0, init/1, - terminate/2, handle_call/3, handle_cast/2, - code_change/3, handle_info/2 ]). -export([set_timeout/2, prompt/2]). @@ -128,8 +126,6 @@ handle_info({'EXIT', _, normal}, State) -> {noreply, State, State#evstate.idle}; handle_info({'EXIT', _, Reason}, State) -> {stop, Reason, State}. -terminate(_Reason, _State) -> ok. -code_change(_OldVersion, State, _Extra) -> {ok, State}. run(#evstate{list_pid = Pid} = State, [<<"list_row">>, Row]) when is_pid(Pid) -> Pid ! {self(), list_row, Row}, diff --git a/src/couch/src/couch_os_process.erl b/src/couch/src/couch_os_process.erl index 19e6417b0..afd7e09a5 100644 --- a/src/couch/src/couch_os_process.erl +++ b/src/couch/src/couch_os_process.erl @@ -15,7 +15,7 @@ -export([start_link/1, stop/1]). -export([set_timeout/2, prompt/2]). --export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2, code_change/3]). +-export([init/1, terminate/2, handle_call/3, handle_cast/2, handle_info/2]). -include_lib("couch/include/couch_db.hrl"). @@ -218,9 +218,6 @@ handle_info(Msg, #os_proc{idle = Idle} = OsProc) -> couch_log:debug("OS Proc: Unknown info: ~p", [Msg]), {noreply, OsProc, Idle}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - killer(KillCmd) -> receive _ -> diff --git a/src/couch/src/couch_password_hasher.erl b/src/couch/src/couch_password_hasher.erl index 6b184e95c..70d43d6e9 100644 --- a/src/couch/src/couch_password_hasher.erl +++ b/src/couch/src/couch_password_hasher.erl @@ -21,8 +21,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -export([maybe_upgrade_password_hash/4, hash_admin_passwords/1]). @@ -94,9 +93,6 @@ handle_info({done, AuthModule, UserName}, State) -> handle_info(Msg, State) -> {stop, {invalid_info, Msg}, State}. -code_change(_OldVsn, #state{} = State, _Extra) -> - {ok, State}. - %%%=================================================================== %%% Internal functions %%%=================================================================== diff --git a/src/couch/src/couch_proc_manager.erl b/src/couch/src/couch_proc_manager.erl index 664b255a8..5c86ff437 100644 --- a/src/couch/src/couch_proc_manager.erl +++ b/src/couch/src/couch_proc_manager.erl @@ -33,8 +33,7 @@ terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -export([ @@ -278,9 +277,6 @@ handle_info(restart_config_listener, State) -> handle_info(_Msg, State) -> {noreply, State}. -code_change(_OldVsn, #state{} = State, _Extra) -> - {ok, State}. - handle_config_terminate(_, stop, _) -> ok; handle_config_terminate(_Server, _Reason, _State) -> diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl index 42f6189cc..384f9d308 100644 --- a/src/couch/src/couch_server.erl +++ b/src/couch/src/couch_server.erl @@ -17,7 +17,7 @@ -export([open/2, create/2, delete/2, get_version/0, get_version/1, get_git_sha/0, get_uuid/0]). -export([all_databases/0, all_databases/2]). -export([init/1, handle_call/3, sup_start_link/1]). --export([handle_cast/2, code_change/3, handle_info/2, terminate/2]). +-export([handle_cast/2, handle_info/2, terminate/2]). -export([dev_start/0, is_admin/2, has_admins/0, get_stats/0]). -export([close_db_if_idle/1]). -export([delete_compaction_files/1]). @@ -719,9 +719,6 @@ handle_cast({close_db_if_idle, DbName}, Server) -> handle_cast(Msg, Server) -> {stop, {unknown_cast_message, Msg}, Server}. -code_change(_OldVsn, #server{} = State, _Extra) -> - {ok, State}. - handle_info({'EXIT', _Pid, config_change}, Server) -> {stop, config_change, Server}; handle_info({'EXIT', Pid, Reason}, Server) -> diff --git a/src/couch/src/couch_stream.erl b/src/couch/src/couch_stream.erl index 02825a161..ea375101f 100644 --- a/src/couch/src/couch_stream.erl +++ b/src/couch/src/couch_stream.erl @@ -30,11 +30,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -include_lib("couch/include/couch_db.hrl"). @@ -197,9 +195,6 @@ init({Engine, OpenerPid, OpenerPriority, Options}) -> ) }}. -terminate(_Reason, _Stream) -> - ok. - handle_call({write, Bin}, _From, Stream) -> BinSize = iolist_size(Bin), #stream{ @@ -280,9 +275,6 @@ handle_call(close, _From, Stream) -> handle_cast(_Msg, State) -> {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - handle_info({'DOWN', Ref, _, _, _}, #stream{opener_monitor = Ref} = State) -> {stop, normal, State}; handle_info(_Info, State) -> diff --git a/src/couch/src/couch_uuids.erl b/src/couch/src/couch_uuids.erl index 76a42ae3e..7a04f3026 100644 --- a/src/couch/src/couch_uuids.erl +++ b/src/couch/src/couch_uuids.erl @@ -18,7 +18,7 @@ -export([start/0, stop/0]). -export([new/0, random/0]). --export([init/1, terminate/2, code_change/3]). +-export([init/1]). -export([handle_call/3, handle_cast/2, handle_info/2]). % config_listener api @@ -42,9 +42,6 @@ init([]) -> ok = config:listen_for_changes(?MODULE, nil), {ok, state()}. -terminate(_Reason, _State) -> - ok. - handle_call(create, _From, random) -> {reply, random(), random}; handle_call(create, _From, {utc_random, ClockSeq}) -> @@ -76,9 +73,6 @@ handle_info(restart_config_listener, State) -> handle_info(_Info, State) -> {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - handle_config_change("uuids", _, _, _, _) -> {ok, gen_server:cast(?MODULE, change)}; handle_config_change(_, _, _, _, _) -> diff --git a/src/couch/src/couch_work_queue.erl b/src/couch/src/couch_work_queue.erl index 41d01c25b..ccd9d993a 100644 --- a/src/couch/src/couch_work_queue.erl +++ b/src/couch/src/couch_work_queue.erl @@ -20,7 +20,7 @@ % gen_server callbacks -export([init/1, terminate/2]). --export([handle_call/3, handle_cast/2, code_change/3, handle_info/2]). +-export([handle_call/3, handle_cast/2, handle_info/2]). -record(q, { queue = queue:new(), @@ -166,8 +166,5 @@ handle_cast(close, #q{items = 0} = Q) -> handle_cast(close, Q) -> {noreply, Q#q{close_on_dequeue = true}}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - handle_info(X, Q) -> {stop, X, Q}. diff --git a/src/couch/test/eunit/test_web.erl b/src/couch/test/eunit/test_web.erl index 25fe7092b..a2eb6a2e8 100644 --- a/src/couch/test/eunit/test_web.erl +++ b/src/couch/test/eunit/test_web.erl @@ -16,7 +16,7 @@ -compile(tuple_calls). -export([start_link/0, stop/0, loop/1, get_port/0, set_assert/1, check_last/0]). --export([init/1, terminate/2, code_change/3]). +-export([init/1]). -export([handle_call/3, handle_cast/2, handle_info/2]). -include_lib("couch/include/couch_eunit.hrl"). @@ -67,9 +67,6 @@ check_last() -> init(_) -> {ok, nil}. -terminate(_Reason, _State) -> - ok. - stop() -> mochiweb_http:stop(?SERVER). @@ -109,6 +106,3 @@ handle_cast(Msg, State) -> handle_info(Msg, State) -> ?debugFmt("Ignoring info message: ~p", [Msg]), {noreply, State}. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. diff --git a/src/couch_event/src/couch_event_server.erl b/src/couch_event/src/couch_event_server.erl index af199b465..6b7a4b365 100644 --- a/src/couch_event/src/couch_event_server.erl +++ b/src/couch_event/src/couch_event_server.erl @@ -19,11 +19,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -include("couch_event_int.hrl"). @@ -44,9 +42,6 @@ init(_) -> by_dbname = ByDbName }}. -terminate(_Reason, _St) -> - ok. - handle_call({register, Pid, NewDbNames}, _From, St) -> case khash:get(St#st.by_pid, Pid) of undefined -> @@ -91,9 +86,6 @@ handle_info(Msg, St) -> couch_log:notice("~s ignoring info ~w", [?MODULE, Msg]), {noreply, St}. -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - notify_listeners(ByDbName, DbName, Event) -> Msg = {'$couch_event', DbName, Event}, notify_listeners(khash:get(ByDbName, all_dbs), Msg), diff --git a/src/couch_index/src/couch_index.erl b/src/couch_index/src/couch_index.erl index 0f3ff680f..b8bb35183 100644 --- a/src/couch_index/src/couch_index.erl +++ b/src/couch_index/src/couch_index.erl @@ -21,7 +21,7 @@ -export([compact/1, compact/2, get_compactor_pid/1]). %% gen_server callbacks --export([init/1, terminate/2, code_change/3]). +-export([init/1, terminate/2]). -export([handle_call/3, handle_cast/2, handle_info/2]). -include_lib("couch/include/couch_db.hrl"). @@ -364,9 +364,6 @@ handle_info({'DOWN', _, _, _Pid, _}, #st{mod = Mod, idx_state = IdxState} = Stat catch send_all(State#st.waiters, shutdown), {stop, normal, State#st{waiters = []}}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - maybe_restart_updater(#st{waiters = []}) -> ok; maybe_restart_updater(#st{idx_state = IdxState} = State) -> diff --git a/src/couch_index/src/couch_index_compactor.erl b/src/couch_index/src/couch_index_compactor.erl index ac066648d..2bfe9b804 100644 --- a/src/couch_index/src/couch_index_compactor.erl +++ b/src/couch_index/src/couch_index_compactor.erl @@ -17,7 +17,7 @@ -export([start_link/2, run/2, cancel/1, is_running/1, get_compacting_pid/1]). %% gen_server callbacks --export([init/1, terminate/2, code_change/3]). +-export([init/1, terminate/2]). -export([handle_call/3, handle_cast/2, handle_info/2]). -include_lib("couch/include/couch_db.hrl"). @@ -89,9 +89,6 @@ handle_info({'EXIT', Pid, _Reason}, #st{idx = Pid} = State) -> handle_info(_Mesg, State) -> {stop, unknown_info, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - compact(Parent, Mod, IdxState) -> DbName = Mod:get(db_name, IdxState), %% We use with_db here to make sure we hold db open diff --git a/src/couch_index/src/couch_index_server.erl b/src/couch_index/src/couch_index_server.erl index 277db1d8d..549f8a226 100644 --- a/src/couch_index/src/couch_index_server.erl +++ b/src/couch_index/src/couch_index_server.erl @@ -16,7 +16,7 @@ -export([start_link/1, validate/2, get_index/4, get_index/3, get_index/2]). --export([init/1, terminate/2, code_change/3]). +-export([init/1, terminate/2]). -export([handle_call/3, handle_cast/2, handle_info/2]). % Sharding functions @@ -242,9 +242,6 @@ handle_info(Msg, State) -> couch_log:warning("~p did not expect ~p", [?MODULE, Msg]), {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - handle_config_change("couchdb", "index_dir", RootDir, _, #st{root_dir = RootDir} = St) -> {ok, St}; handle_config_change("couchdb", "view_index_dir", RootDir, _, #st{root_dir = RootDir} = St) -> diff --git a/src/couch_index/src/couch_index_updater.erl b/src/couch_index/src/couch_index_updater.erl index fe2150505..0c5bd5111 100644 --- a/src/couch_index/src/couch_index_updater.erl +++ b/src/couch_index/src/couch_index_updater.erl @@ -20,7 +20,7 @@ -export([update/3]). %% gen_server callbacks --export([init/1, terminate/2, code_change/3]). +-export([init/1, terminate/2]). -export([handle_call/3, handle_cast/2, handle_info/2]). -include_lib("couch/include/couch_db.hrl"). @@ -110,9 +110,6 @@ handle_info({'EXIT', _Pid, normal}, State) -> handle_info(_Mesg, State) -> {stop, unknown_info, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - update(Idx, Mod, IdxState) -> DbName = Mod:get(db_name, IdxState), IndexName = Mod:get(idx_name, IdxState), diff --git a/src/couch_log/src/couch_log_error_logger_h.erl b/src/couch_log/src/couch_log_error_logger_h.erl index ff7ae045f..5611b2a40 100644 --- a/src/couch_log/src/couch_log_error_logger_h.erl +++ b/src/couch_log/src/couch_log_error_logger_h.erl @@ -20,19 +20,14 @@ -export([ init/1, - terminate/2, handle_call/2, handle_event/2, - handle_info/2, - code_change/3 + handle_info/2 ]). init(_) -> {ok, undefined}. -terminate(_Reason, _St) -> - ok. - handle_call(_, St) -> {ok, ignored, St}. @@ -43,6 +38,3 @@ handle_event(Event, St) -> handle_info(_, St) -> {ok, St}. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. diff --git a/src/couch_log/src/couch_log_monitor.erl b/src/couch_log/src/couch_log_monitor.erl index 13b053d2c..ace61bac1 100644 --- a/src/couch_log/src/couch_log_monitor.erl +++ b/src/couch_log/src/couch_log_monitor.erl @@ -20,11 +20,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -define(HANDLER_MOD, couch_log_error_logger_h). @@ -38,9 +36,6 @@ init(_) -> ok = gen_event:add_sup_handler(error_logger, ?HANDLER_MOD, []), {ok, nil}. -terminate(_, _) -> - ok. - handle_call(_Msg, _From, St) -> {reply, ignored, St}. @@ -51,6 +46,3 @@ handle_info({gen_event_EXIT, ?HANDLER_MOD, Reason}, St) -> {stop, Reason, St}; handle_info(_Msg, St) -> {noreply, St}. - -code_change(_, State, _) -> - {ok, State}. diff --git a/src/couch_log/src/couch_log_server.erl b/src/couch_log/src/couch_log_server.erl index 05cf92a75..d778ab7d2 100644 --- a/src/couch_log/src/couch_log_server.erl +++ b/src/couch_log/src/couch_log_server.erl @@ -24,8 +24,7 @@ terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -include("couch_log.hrl"). @@ -87,6 +86,3 @@ handle_cast(Msg, St) -> handle_info(Msg, St) -> {reply, ok, NewSt} = handle_call(Msg, nil, St), {noreply, NewSt}. - -code_change(_Vsn, St, _Extra) -> - {ok, St}. diff --git a/src/couch_log/test/eunit/couch_log_error_logger_h_test.erl b/src/couch_log/test/eunit/couch_log_error_logger_h_test.erl index cb053d611..0a6075ac6 100644 --- a/src/couch_log/test/eunit/couch_log_error_logger_h_test.erl +++ b/src/couch_log/test/eunit/couch_log_error_logger_h_test.erl @@ -18,8 +18,7 @@ couch_log_error_logger_h_test_() -> {setup, fun couch_log_test_util:start/0, fun couch_log_test_util:stop/1, [ - fun handler_ignores_unknown_messages/0, - fun coverage_test/0 + fun handler_ignores_unknown_messages/0 ]}. handler_ignores_unknown_messages() -> @@ -30,7 +29,3 @@ handler_ignores_unknown_messages() -> error_logger ! this_is_a_message, Handlers2 = gen_event:which_handlers(error_logger), ?assert(lists:member(?HANDLER, Handlers2)). - -coverage_test() -> - Resp = couch_log_error_logger_h:code_change(foo, bazinga, baz), - ?assertEqual({ok, bazinga}, Resp). diff --git a/src/couch_log/test/eunit/couch_log_monitor_test.erl b/src/couch_log/test/eunit/couch_log_monitor_test.erl index ceeb98b4e..1ee161e36 100644 --- a/src/couch_log/test/eunit/couch_log_monitor_test.erl +++ b/src/couch_log/test/eunit/couch_log_monitor_test.erl @@ -19,8 +19,7 @@ couch_log_monitor_test_() -> {setup, fun couch_log_test_util:start/0, fun couch_log_test_util:stop/1, [ fun monitor_ignores_unknown_messages/0, - fun monitor_restarts_handler/0, - fun coverage_test/0 + fun monitor_restarts_handler/0 ]}. monitor_ignores_unknown_messages() -> @@ -46,10 +45,6 @@ monitor_restarts_handler() -> Handlers = gen_event:which_handlers(error_logger), ?assert(lists:member(?HANDLER, Handlers)). -coverage_test() -> - Resp = couch_log_monitor:code_change(foo, bazinga, baz), - ?assertEqual({ok, bazinga}, Resp). - get_monitor_pid() -> Children = supervisor:which_children(couch_log_sup), [MonPid] = [Pid || {couch_log_monitor, Pid, _, _} <- Children, is_pid(Pid)], diff --git a/src/couch_log/test/eunit/couch_log_server_test.erl b/src/couch_log/test/eunit/couch_log_server_test.erl index a2334b048..df768f26e 100644 --- a/src/couch_log/test/eunit/couch_log_server_test.erl +++ b/src/couch_log/test/eunit/couch_log_server_test.erl @@ -104,7 +104,3 @@ check_logs_ignored_messages() -> }, couch_log_test_util:last_log() ). - -coverage_test() -> - Resp = couch_log_server:code_change(foo, bazinga, baz), - ?assertEqual({ok, bazinga}, Resp). diff --git a/src/couch_mrview/src/couch_mrview_update_notifier.erl b/src/couch_mrview/src/couch_mrview_update_notifier.erl index ac91131a0..699a14b3b 100644 --- a/src/couch_mrview/src/couch_mrview_update_notifier.erl +++ b/src/couch_mrview/src/couch_mrview_update_notifier.erl @@ -15,7 +15,7 @@ -behaviour(gen_event). -export([start_link/1, notify/1]). --export([init/1, terminate/2, handle_event/2, handle_call/2, handle_info/2, code_change/3, stop/1]). +-export([init/1, handle_event/2, handle_call/2, handle_info/2, stop/1]). -include_lib("couch/include/couch_db.hrl"). @@ -33,9 +33,6 @@ stop(Pid) -> init(Fun) -> {ok, Fun}. -terminate(_Reason, _State) -> - ok. - handle_event(Event, Fun) -> Fun(Event), {ok, Fun}. @@ -46,6 +43,3 @@ handle_call(_Request, State) -> handle_info({'EXIT', Pid, Reason}, Pid) -> couch_log:error("View update notification process ~p died: ~p", [Pid, Reason]), remove_handler. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. diff --git a/src/couch_peruser/src/couch_peruser.erl b/src/couch_peruser/src/couch_peruser.erl index 7a6aec06f..6f4a24cab 100644 --- a/src/couch_peruser/src/couch_peruser.erl +++ b/src/couch_peruser/src/couch_peruser.erl @@ -23,9 +23,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - terminate/2, - code_change/3 + handle_info/2 ]). -export([init_changes_handler/1, changes_handler/3]). @@ -497,11 +495,3 @@ handle_info(restart_config_listener, State) -> {noreply, State}; handle_info(_Msg, State) -> {noreply, State}. - -terminate(_Reason, _State) -> - %% Everything should be linked or monitored, let nature - %% take its course. - ok. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. diff --git a/src/couch_replicator/src/couch_replicator_auth_session.erl b/src/couch_replicator/src/couch_replicator_auth_session.erl index a5cfaf190..31fa0a1b1 100644 --- a/src/couch_replicator/src/couch_replicator_auth_session.erl +++ b/src/couch_replicator/src/couch_replicator_auth_session.erl @@ -59,11 +59,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_cast/2, handle_info/2, - code_change/3, format_status/2 ]). @@ -131,9 +129,6 @@ cleanup({Pid, _Epoch, Timeout}) -> init([#state{} = State]) -> {ok, State}. -terminate(_Reason, _State) -> - ok. - handle_call({update_headers, Headers, _Epoch}, _From, State) -> case maybe_refresh(State) of {ok, State1} -> @@ -159,9 +154,6 @@ handle_info(Msg, State) -> couch_log:error("~p : Received un-expected message ~p", [?MODULE, Msg]), {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - format_status(_Opt, [_PDict, State]) -> [ {epoch, State#state.epoch}, diff --git a/src/couch_replicator/src/couch_replicator_clustering.erl b/src/couch_replicator/src/couch_replicator_clustering.erl index 8db320433..1b4122955 100644 --- a/src/couch_replicator/src/couch_replicator_clustering.erl +++ b/src/couch_replicator/src/couch_replicator_clustering.erl @@ -34,11 +34,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_info/2, - handle_cast/2, - code_change/3 + handle_cast/2 ]). -export([ @@ -151,9 +149,6 @@ init([]) -> ), {ok, #state{mem3_cluster_pid = Mem3Cluster, cluster_stable = false}}. -terminate(_Reason, _State) -> - ok. - handle_call(is_stable, _From, #state{cluster_stable = IsStable} = State) -> {reply, IsStable, State}; handle_call(set_stable, _From, State) -> @@ -169,9 +164,6 @@ handle_info(restart_config_listener, State) -> ok = config:listen_for_changes(?MODULE, nil), {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - %% Internal functions handle_config_change("replicator", "cluster_quiet_period", V, _, S) -> diff --git a/src/couch_replicator/src/couch_replicator_connection.erl b/src/couch_replicator/src/couch_replicator_connection.erl index a158d2609..978962bd7 100644 --- a/src/couch_replicator/src/couch_replicator_connection.erl +++ b/src/couch_replicator/src/couch_replicator_connection.erl @@ -21,11 +21,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_info/2, - handle_cast/2, - code_change/3 + handle_cast/2 ]). -export([ @@ -244,12 +242,6 @@ handle_info(restart_config_listener, State) -> ok = config:listen_for_changes(?MODULE, nil), {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - -terminate(_Reason, _State) -> - ok. - maybe_log_worker_death(_Host, _Port, normal) -> ok; maybe_log_worker_death(Host, Port, Reason) -> diff --git a/src/couch_replicator/src/couch_replicator_db_changes.erl b/src/couch_replicator/src/couch_replicator_db_changes.erl index 947af51b4..4536b0718 100644 --- a/src/couch_replicator/src/couch_replicator_db_changes.erl +++ b/src/couch_replicator/src/couch_replicator_db_changes.erl @@ -20,11 +20,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_info/2, - handle_cast/2, - code_change/3 + handle_cast/2 ]). -export([ @@ -59,9 +57,6 @@ init([]) -> {ok, State} end. -terminate(_Reason, _State) -> - ok. - handle_call(_Msg, _From, State) -> {reply, {error, invalid_call}, State}. @@ -73,9 +68,6 @@ handle_cast({cluster, stable}, State) -> handle_info(_Msg, State) -> {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - -spec restart_mdb_changes(#state{}) -> #state{}. restart_mdb_changes(#state{mdb_changes = nil} = State) -> Suffix = <<"_replicator">>, diff --git a/src/couch_replicator/src/couch_replicator_doc_processor.erl b/src/couch_replicator/src/couch_replicator_doc_processor.erl index 2a2b2d123..4e26bdd97 100644 --- a/src/couch_replicator/src/couch_replicator_doc_processor.erl +++ b/src/couch_replicator/src/couch_replicator_doc_processor.erl @@ -21,11 +21,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_info/2, - handle_cast/2, - code_change/3 + handle_cast/2 ]). -export([ @@ -205,9 +203,6 @@ init([]) -> ), {ok, nil}. -terminate(_Reason, _State) -> - ok. - handle_call({updated, Id, Rep, Filter}, _From, State) -> ok = updated_doc(Id, Rep, Filter), {reply, ok, State}; @@ -244,9 +239,6 @@ handle_info( handle_info(_Msg, State) -> {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - % Doc processor gen_server private helper functions % Handle doc update -- add to ets, then start a worker to try to turn it into diff --git a/src/couch_replicator/src/couch_replicator_httpc_pool.erl b/src/couch_replicator/src/couch_replicator_httpc_pool.erl index f744b7f77..fb15dcea1 100644 --- a/src/couch_replicator/src/couch_replicator_httpc_pool.erl +++ b/src/couch_replicator/src/couch_replicator_httpc_pool.erl @@ -19,7 +19,7 @@ % gen_server API -export([init/1, handle_call/3, handle_info/2, handle_cast/2]). --export([code_change/3, terminate/2, format_status/2]). +-export([format_status/2]). -include_lib("couch/include/couch_db.hrl"). @@ -135,12 +135,6 @@ handle_info({'DOWN', Ref, process, _, _}, #state{callers = Callers} = State) -> {noreply, State} end. -code_change(_OldVsn, #state{} = State, _Extra) -> - {ok, State}. - -terminate(_Reason, _State) -> - ok. - format_status(_Opt, [_PDict, State]) -> #state{ url = Url, diff --git a/src/couch_replicator/src/couch_replicator_notifier.erl b/src/couch_replicator/src/couch_replicator_notifier.erl index 55888f1b7..21c6d5a25 100644 --- a/src/couch_replicator/src/couch_replicator_notifier.erl +++ b/src/couch_replicator/src/couch_replicator_notifier.erl @@ -18,7 +18,7 @@ -export([start_link/1, stop/1, notify/1]). % gen_event callbacks --export([init/1, terminate/2, code_change/3]). +-export([init/1]). -export([handle_event/2, handle_call/2, handle_info/2]). -include_lib("couch/include/couch_db.hrl"). @@ -39,9 +39,6 @@ stop(Pid) -> init(FunAcc) -> {ok, FunAcc}. -terminate(_Reason, _State) -> - ok. - handle_event(Event, Fun) when is_function(Fun, 1) -> Fun(Event), {ok, Fun}; @@ -54,6 +51,3 @@ handle_call(_Msg, State) -> handle_info(_Msg, State) -> {ok, State}. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. diff --git a/src/couch_replicator/src/couch_replicator_rate_limiter.erl b/src/couch_replicator/src/couch_replicator_rate_limiter.erl index 5d2c184b8..c98f98d61 100644 --- a/src/couch_replicator/src/couch_replicator_rate_limiter.erl +++ b/src/couch_replicator/src/couch_replicator_rate_limiter.erl @@ -45,11 +45,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_info/2, - handle_cast/2, - code_change/3 + handle_cast/2 ]). -export([ @@ -127,9 +125,6 @@ init([]) -> couch_replicator_rate_limiter_tables:create(#rec.id), {ok, #state{timer = new_timer()}}. -terminate(_Reason, _State) -> - ok. - handle_call(_Msg, _From, State) -> {reply, invalid, State}. @@ -142,9 +137,6 @@ handle_info(cleanup, #state{timer = Timer}) -> [cleanup_table(TId, now_msec() - ?MAX_INTERVAL) || TId <- TIds], {noreply, #state{timer = new_timer()}}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - % Private functions -spec update_success(any(), interval(), msec(), msec()) -> interval(). diff --git a/src/couch_replicator/src/couch_replicator_scheduler.erl b/src/couch_replicator/src/couch_replicator_scheduler.erl index d02256807..fd189c2c8 100644 --- a/src/couch_replicator/src/couch_replicator_scheduler.erl +++ b/src/couch_replicator/src/couch_replicator_scheduler.erl @@ -25,7 +25,6 @@ handle_call/3, handle_info/2, handle_cast/2, - code_change/3, format_status/2 ]). @@ -342,9 +341,6 @@ handle_info(restart_config_listener, State) -> handle_info(_, State) -> {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - terminate(_Reason, _State) -> couch_replicator_share:clear(), ok. diff --git a/src/couch_replicator/src/couch_replicator_scheduler_job.erl b/src/couch_replicator/src/couch_replicator_scheduler_job.erl index b211da85b..dab8f8a48 100644 --- a/src/couch_replicator/src/couch_replicator_scheduler_job.erl +++ b/src/couch_replicator/src/couch_replicator_scheduler_job.erl @@ -24,7 +24,6 @@ handle_call/3, handle_info/2, handle_cast/2, - code_change/3, format_status/2, sum_stats/2, report_seq_done/3 @@ -458,9 +457,6 @@ terminate_cleanup(#rep_state{rep_details = #rep{id = RepId}} = State) -> couch_replicator_api_wrap:db_close(State#rep_state.source), couch_replicator_api_wrap:db_close(State#rep_state.target). -code_change(_OldVsn, #rep_state{} = State, _Extra) -> - {ok, State}. - format_status(_Opt, [_PDict, State]) -> #rep_state{ source = Source, diff --git a/src/couch_replicator/src/couch_replicator_worker.erl b/src/couch_replicator/src/couch_replicator_worker.erl index 24043b1eb..078e6e7e0 100644 --- a/src/couch_replicator/src/couch_replicator_worker.erl +++ b/src/couch_replicator/src/couch_replicator_worker.erl @@ -17,7 +17,7 @@ -export([start_link/5]). % gen_server callbacks --export([init/1, terminate/2, code_change/3]). +-export([init/1]). -export([handle_call/3, handle_cast/2, handle_info/2]). -export([format_status/2]). @@ -242,9 +242,6 @@ handle_info({'EXIT', _Pid, {doc_write_failed, _} = Err}, State) -> handle_info({'EXIT', Pid, Reason}, State) -> {stop, {process_died, Pid, Reason}, State}. -terminate(_Reason, _State) -> - ok. - format_status(_Opt, [_PDict, State]) -> #state{ cp = MainJobPid, @@ -265,9 +262,6 @@ format_status(_Opt, [_PDict, State]) -> {batch_size, BatchSize} ]. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - sum_stats(Pid, Stats) when is_pid(Pid) -> ok = gen_server:cast(Pid, {sum_stats, Stats}). diff --git a/src/couch_stats/src/couch_stats_process_tracker.erl b/src/couch_stats/src/couch_stats_process_tracker.erl index c53f0f887..33cc137da 100644 --- a/src/couch_stats/src/couch_stats_process_tracker.erl +++ b/src/couch_stats/src/couch_stats_process_tracker.erl @@ -23,9 +23,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3, - terminate/2 + handle_info/2 ]). -record(st, {}). @@ -72,9 +70,3 @@ handle_info({'DOWN', Ref, _, _, _} = Msg, State) -> handle_info(Msg, State) -> error_logger:error_msg("~p received unknown message ~p", [?MODULE, Msg]), {noreply, State}. - -terminate(_Reason, _State) -> - ok. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. diff --git a/src/custodian/src/custodian_db_checker.erl b/src/custodian/src/custodian_db_checker.erl index cabcbb1ee..ca3027efd 100644 --- a/src/custodian/src/custodian_db_checker.erl +++ b/src/custodian/src/custodian_db_checker.erl @@ -20,8 +20,7 @@ terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -export([ @@ -64,9 +63,6 @@ handle_info({'EXIT', Pid, Reason}, #st{checker = Pid} = St) -> handle_info(Msg, St) -> {stop, {invalid_info, Msg}, St}. -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - restart_checker(#st{checker = undefined} = St) -> Pid = spawn_link(fun ?MODULE:check_dbs/0), St#st{checker = Pid}; diff --git a/src/custodian/src/custodian_server.erl b/src/custodian/src/custodian_server.erl index eb817db3b..d532adf07 100644 --- a/src/custodian/src/custodian_server.erl +++ b/src/custodian/src/custodian_server.erl @@ -23,7 +23,6 @@ handle_call/3, handle_cast/2, handle_info/2, - code_change/3, terminate/2 ]). @@ -43,8 +42,6 @@ rescan = false }). --define(VSN_0_2_7, 184129240591641721395874905059581858099). - -ifdef(TEST). -define(RELISTEN_DELAY, 50). -else. @@ -113,12 +110,6 @@ terminate(_Reason, State) -> couch_util:shutdown_sync(State#state.shard_checker), ok. -code_change(?VSN_0_2_7, State, _Extra) -> - ok = config:listen_for_changes(?MODULE, nil), - {ok, State}; -code_change(_OldVsn, #state{} = State, _Extra) -> - {ok, State}. - % private functions start_shard_checker(#state{shard_checker = undefined} = State) -> diff --git a/src/ddoc_cache/src/ddoc_cache_entry.erl b/src/ddoc_cache/src/ddoc_cache_entry.erl index a9a9bb230..de9cb55cc 100644 --- a/src/ddoc_cache/src/ddoc_cache_entry.erl +++ b/src/ddoc_cache/src/ddoc_cache_entry.erl @@ -34,8 +34,7 @@ terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -export([ @@ -257,9 +256,6 @@ handle_info({'DOWN', _, _, Pid, Resp}, #st{key = Key, opener = Pid} = St) -> handle_info(Msg, St) -> {stop, {bad_info, Msg}, St}. -code_change(_, St, _) -> - {ok, St}. - spawn_opener(Key) -> {Pid, _} = erlang:spawn_monitor(?MODULE, do_open, [Key]), Pid. diff --git a/src/ddoc_cache/src/ddoc_cache_lru.erl b/src/ddoc_cache/src/ddoc_cache_lru.erl index afd819236..e9a1f6f6b 100644 --- a/src/ddoc_cache/src/ddoc_cache_lru.erl +++ b/src/ddoc_cache/src/ddoc_cache_lru.erl @@ -25,8 +25,7 @@ terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -export([ @@ -218,9 +217,6 @@ handle_info({'EXIT', Pid, normal}, St) -> handle_info(Msg, St) -> {stop, {invalid_info, Msg}, St}. -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - handle_db_event(ShardDbName, created, St) -> gen_server:cast(?MODULE, {evict, mem3:dbname(ShardDbName)}), {ok, St}; diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl b/src/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl index d2d0559c6..a30f3b2ce 100644 --- a/src/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl +++ b/src/ddoc_cache/test/eunit/ddoc_cache_coverage_test.erl @@ -29,8 +29,7 @@ coverage_test_() -> restart_lru() -> send_bad_messages(ddoc_cache_lru), - ?assertEqual(ok, ddoc_cache_lru:terminate(bang, {st, a, b, c})), - ?assertEqual({ok, foo}, ddoc_cache_lru:code_change(1, foo, [])). + ?assertEqual(ok, ddoc_cache_lru:terminate(bang, {st, a, b, c})). stop_on_evictor_death() -> meck:new(ddoc_cache_ev, [passthrough]), diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl b/src/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl index b46815a1e..19ae24094 100644 --- a/src/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl +++ b/src/ddoc_cache/test/eunit/ddoc_cache_entry_test.erl @@ -44,8 +44,7 @@ check_entry_test_() -> ?TDEF(kill_opener_on_terminate), ?TDEF(evict_when_not_accessed), ?TDEF(open_dead_entry), - ?TDEF(handles_bad_messages), - ?TDEF(handles_code_change) + ?TDEF(handles_bad_messages) ]) }. @@ -132,10 +131,6 @@ handles_bad_messages(_) -> ?assertEqual(CastExpect, ddoc_cache_entry:handle_cast(foo, bar)), ?assertEqual(InfoExpect, ddoc_cache_entry:handle_info(foo, bar)). -handles_code_change(_) -> - CCExpect = {ok, bar}, - ?assertEqual(CCExpect, ddoc_cache_entry:code_change(foo, bar, baz)). - handles_bad_shutdown_test_() -> {timeout, 10, ?_test(begin diff --git a/src/dreyfus/src/dreyfus_index.erl b/src/dreyfus/src/dreyfus_index.erl index a5d2c3c13..c97a837d5 100644 --- a/src/dreyfus/src/dreyfus_index.erl +++ b/src/dreyfus/src/dreyfus_index.erl @@ -36,9 +36,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - terminate/2, - code_change/3 + handle_info/2 ]). % private definitions. @@ -287,12 +285,6 @@ handle_info( [gen_server:reply(P, {error, Reason}) || {P, _} <- WaitList], {stop, normal, State}. -terminate(_Reason, _State) -> - ok. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - % private functions. open_index(DbName, #index{analyzer = Analyzer, sig = Sig}) -> diff --git a/src/dreyfus/src/dreyfus_index_manager.erl b/src/dreyfus/src/dreyfus_index_manager.erl index 4385257ce..046fff68e 100644 --- a/src/dreyfus/src/dreyfus_index_manager.erl +++ b/src/dreyfus/src/dreyfus_index_manager.erl @@ -28,9 +28,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - terminate/2, - code_change/3 + handle_info/2 ]). -export([handle_db_event/3]). @@ -111,12 +109,6 @@ handle_info({'EXIT', FromPid, Reason}, State) -> end, {noreply, State}. -terminate(_Reason, _State) -> - ok. - -code_change(_OldVsn, nil, _Extra) -> - {ok, nil}. - % private functions handle_db_event(DbName, created, _St) -> diff --git a/src/ets_lru/src/ets_lru.erl b/src/ets_lru/src/ets_lru.erl index d5394bfb3..e0af787ee 100644 --- a/src/ets_lru/src/ets_lru.erl +++ b/src/ets_lru/src/ets_lru.erl @@ -36,9 +36,7 @@ handle_call/3, handle_cast/2, - handle_info/2, - - code_change/3 + handle_info/2 ]). -define(DEFAULT_TIME_UNIT, millisecond). @@ -216,9 +214,6 @@ handle_info(timeout, St) -> handle_info(Msg, St) -> {stop, {invalid_info, Msg}, St}. -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - accessed(Key, St) -> Pattern = #entry{key = Key, atime = '$1', _ = '_'}, case ets:match(St#st.objects, Pattern) of diff --git a/src/global_changes/src/global_changes_server.erl b/src/global_changes/src/global_changes_server.erl index dd66694f2..0fb19ba1e 100644 --- a/src/global_changes/src/global_changes_server.erl +++ b/src/global_changes/src/global_changes_server.erl @@ -19,11 +19,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -export([ @@ -75,9 +73,6 @@ init([]) -> }, {ok, State}. -terminate(_Reason, _Srv) -> - ok. - handle_call(_Msg, _From, State) -> {reply, ok, State}. @@ -137,9 +132,6 @@ handle_info({'DOWN', Ref, _, _, Reason}, #state{handler_ref = Ref} = State) -> handle_info(_, State) -> {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - flush_updates(State) -> DocIds = sets:to_list(State#state.pending_updates), try group_ids_by_shard(State#state.dbname, DocIds) of diff --git a/src/ioq/src/ioq.erl b/src/ioq/src/ioq.erl index f5d3a0491..bcb99b291 100644 --- a/src/ioq/src/ioq.erl +++ b/src/ioq/src/ioq.erl @@ -17,7 +17,7 @@ -export([start_link/0, call/3, call_search/3]). -export([get_queue_lengths/0]). -export([get_io_priority/0, set_io_priority/1, maybe_set_io_priority/1]). --export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_change/3, terminate/2]). +-export([init/1, handle_call/3, handle_cast/2, handle_info/2]). % config_listener api -export([handle_config_change/5, handle_config_terminate/3]). @@ -175,12 +175,6 @@ handle_config_terminate(_Server, stop, _State) -> handle_config_terminate(_Server, _Reason, _State) -> erlang:send_after(?RELISTEN_DELAY, whereis(?MODULE), restart_config_listener). -code_change(_Vsn, State, _Extra) -> - {ok, State}. - -terminate(_Reason, _State) -> - ok. - enqueue_request(#request{priority = compaction} = Request, #state{} = State) -> State#state{background = queue:in(Request, State#state.background)}; enqueue_request(#request{priority = shard_sync} = Request, #state{} = State) -> diff --git a/src/jwtf/src/jwtf_keystore.erl b/src/jwtf/src/jwtf_keystore.erl index 4c2933264..fe898ebdc 100644 --- a/src/jwtf/src/jwtf_keystore.erl +++ b/src/jwtf/src/jwtf_keystore.erl @@ -27,9 +27,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3, - terminate/2 + handle_info/2 ]). % config_listener api @@ -77,12 +75,6 @@ handle_info(restart_config_listener, State) -> handle_info(_Msg, State) -> {noreply, State}. -terminate(_Reason, _State) -> - ok. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - % config listener callback handle_config_change("jwt_keys", ConfigKey, _ConfigValue, _, _) -> diff --git a/src/ken/src/ken_server.erl b/src/ken/src/ken_server.erl index f046e9fc6..66b3d4ad7 100644 --- a/src/ken/src/ken_server.erl +++ b/src/ken/src/ken_server.erl @@ -14,8 +14,8 @@ % gen_server boilerplate -behaviour(gen_server). --export([init/1, terminate/2]). --export([handle_call/3, handle_cast/2, handle_info/2, code_change/3]). +-export([init/1]). +-export([handle_call/3, handle_cast/2, handle_info/2]). % Public interface -export([start_link/0]). @@ -115,9 +115,6 @@ init(_) -> ets:new(ken_workers, [named_table, public, {keypos, #job.name}]), {ok, #state{pruned_last = erlang:monotonic_time()}}. -terminate(_Reason, _State) -> - ok. - handle_call({set_batch_size, BS}, _From, #state{batch_size = Old} = State) -> {reply, Old, State#state{batch_size = BS}, 0}; handle_call({set_delay, Delay}, _From, #state{delay = Old} = State) -> @@ -223,9 +220,6 @@ handle_info({'DOWN', _, _, Pid, Reason}, State) -> handle_info(Msg, State) -> {stop, {unknown_info, Msg}, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - %% private functions maybe_start_next_queued_job(#state{dbworker = {_, _}} = State) -> diff --git a/src/mango/src/mango_native_proc.erl b/src/mango/src/mango_native_proc.erl index d316d7038..f7f6156ea 100644 --- a/src/mango/src/mango_native_proc.erl +++ b/src/mango/src/mango_native_proc.erl @@ -24,8 +24,7 @@ terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -record(st, { @@ -109,9 +108,6 @@ handle_cast(Msg, St) -> handle_info(Msg, St) -> {stop, {invalid_info, Msg}, St}. -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - map_doc(#st{indexes = Indexes}, Doc) -> lists:map(fun(Idx) -> get_index_entries(Idx, Doc) end, Indexes). diff --git a/src/mem3/src/mem3_cluster.erl b/src/mem3/src/mem3_cluster.erl index 974b2cbef..17d661d67 100644 --- a/src/mem3/src/mem3_cluster.erl +++ b/src/mem3/src/mem3_cluster.erl @@ -36,11 +36,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -callback cluster_stable(Context :: term()) -> NewContext :: term(). @@ -81,9 +79,6 @@ init([Module, Context, StartPeriod, Period]) -> timer = new_timer(StartPeriod) }}. -terminate(_Reason, _State) -> - ok. - handle_call(_Msg, _From, State) -> {reply, ignored, State}. @@ -104,9 +99,6 @@ handle_info(stability_check, #state{mod = Mod, ctx = Ctx} = State) -> {noreply, State#state{timer = Timer}} end. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - %% Internal functions -spec cluster_changed(#state{}) -> #state{}. diff --git a/src/mem3/src/mem3_distribution.erl b/src/mem3/src/mem3_distribution.erl index a2b77de8a..431875d25 100644 --- a/src/mem3/src/mem3_distribution.erl +++ b/src/mem3/src/mem3_distribution.erl @@ -26,8 +26,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -define(JITTER_PERCENT, 0.25). @@ -59,9 +58,6 @@ handle_info(connect, #st{} = St) -> handle_info(Msg, St) -> {stop, {bad_info, Msg}, St}. -code_change(_OldVsn, #st{} = St, _Extra) -> - {ok, St}. - connect(Log) -> Expected = ordsets:from_list([N || N <- mem3:nodes(), N =/= node()]), Connected = ordsets:from_list(nodes()), diff --git a/src/mem3/src/mem3_nodes.erl b/src/mem3/src/mem3_nodes.erl index 87dd6ae42..8cd3765d9 100644 --- a/src/mem3/src/mem3_nodes.erl +++ b/src/mem3/src/mem3_nodes.erl @@ -16,9 +16,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - terminate/2, - code_change/3 + handle_info/2 ]). -export([start_link/0, get_nodelist/0, get_node_info/2]). @@ -96,12 +94,6 @@ handle_info(start_listener, #state{update_seq = Seq} = State) -> handle_info(_Info, State) -> {noreply, State}. -terminate(_Reason, _State) -> - ok. - -code_change(_OldVsn, #state{} = State, _Extra) -> - {ok, State}. - %% internal functions initialize_nodelist() -> diff --git a/src/mem3/src/mem3_reshard.erl b/src/mem3/src/mem3_reshard.erl index b3bed69ff..0e3daaca8 100644 --- a/src/mem3/src/mem3_reshard.erl +++ b/src/mem3/src/mem3_reshard.erl @@ -44,8 +44,7 @@ terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -include("mem3_reshard.hrl"). @@ -356,9 +355,6 @@ handle_info(Info, State) -> couch_log:error("~p unexpected info ~p", [?MODULE, Info]), {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - %% Private API validate_and_start_job(#shard{} = Source, Split) -> diff --git a/src/mem3/src/mem3_reshard_dbdoc.erl b/src/mem3/src/mem3_reshard_dbdoc.erl index 7fb69598e..ffed94a8f 100644 --- a/src/mem3/src/mem3_reshard_dbdoc.erl +++ b/src/mem3/src/mem3_reshard_dbdoc.erl @@ -20,11 +20,9 @@ start_link/0, init/1, - terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -include_lib("couch/include/couch_db.hrl"). @@ -64,9 +62,6 @@ init(_) -> couch_log:notice("~p start init()", [?MODULE]), {ok, nil}. -terminate(_Reason, _State) -> - ok. - handle_call({update_shard_map, Source, Target}, _From, State) -> Res = try @@ -88,9 +83,6 @@ handle_info(Info, State) -> couch_log:error("~p unexpected info ~p", [?MODULE, Info]), {noreply, State}. -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - % Private update_shard_map(Source, Target) -> diff --git a/src/mem3/src/mem3_seeds.erl b/src/mem3/src/mem3_seeds.erl index 6d74398e7..b007bdeec 100644 --- a/src/mem3/src/mem3_seeds.erl +++ b/src/mem3/src/mem3_seeds.erl @@ -17,9 +17,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3, - terminate/2 + handle_info/2 ]). -export([ @@ -92,12 +90,6 @@ handle_info({'DOWN', Ref, _, Pid, Output}, #st{jobref = {Pid, Ref}} = St) -> handle_info(_Msg, St) -> {noreply, St}. -terminate(_Reason, _St) -> - ok. - -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - % internal functions start_replication([]) -> diff --git a/src/mem3/src/mem3_shards.erl b/src/mem3/src/mem3_shards.erl index d1725a82d..a72ffc926 100644 --- a/src/mem3/src/mem3_shards.erl +++ b/src/mem3/src/mem3_shards.erl @@ -14,7 +14,7 @@ -behaviour(gen_server). -behaviour(config_listener). --export([init/1, terminate/2, code_change/3]). +-export([init/1, terminate/2]). -export([handle_call/3, handle_cast/2, handle_info/2]). -export([handle_config_change/5, handle_config_terminate/3]). @@ -301,9 +301,6 @@ terminate(_Reason, #st{changes_pid = Pid}) -> exit(Pid, kill), ok. -code_change(_OldVsn, #st{} = St, _Extra) -> - {ok, St}. - %% internal functions start_changes_listener(SinceSeq) -> diff --git a/src/mem3/src/mem3_sync.erl b/src/mem3/src/mem3_sync.erl index 668ed5650..0ef702ddb 100644 --- a/src/mem3/src/mem3_sync.erl +++ b/src/mem3/src/mem3_sync.erl @@ -17,8 +17,7 @@ handle_call/3, handle_cast/2, handle_info/2, - terminate/2, - code_change/3 + terminate/2 ]). -export([ @@ -184,11 +183,6 @@ terminate(_Reason, State) -> [exit(Pid, shutdown) || #job{pid = Pid} <- State#state.active], ok. -code_change(_, #state{waiting = WaitingList} = State, _) when is_list(WaitingList) -> - {ok, State#state{waiting = from_list(WaitingList)}}; -code_change(_, State, _) -> - {ok, State}. - maybe_resubmit(State, #job{name = DbName, node = Node} = Job) -> case lists:member(DbName, local_dbs()) of true -> diff --git a/src/mem3/src/mem3_sync_event.erl b/src/mem3/src/mem3_sync_event.erl index cd945e8bf..41b35f6f2 100644 --- a/src/mem3/src/mem3_sync_event.erl +++ b/src/mem3/src/mem3_sync_event.erl @@ -17,9 +17,7 @@ init/1, handle_event/2, handle_call/2, - handle_info/2, - terminate/2, - code_change/3 + handle_info/2 ]). init(_) -> @@ -50,12 +48,6 @@ handle_info({nodedown, Node}, State) -> handle_info(_Info, State) -> {ok, State}. -terminate(_Reason, _State) -> - ok. - -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - drain_nodeups(Acc) -> receive {nodeup, Node} -> diff --git a/src/mem3/src/mem3_sync_nodes.erl b/src/mem3/src/mem3_sync_nodes.erl index e2b269605..f8d718ef9 100644 --- a/src/mem3/src/mem3_sync_nodes.erl +++ b/src/mem3/src/mem3_sync_nodes.erl @@ -16,7 +16,7 @@ -export([start_link/0]). -export([add/1]). --export([init/1, terminate/2, code_change/3]). +-export([init/1, terminate/2]). -export([handle_call/3, handle_cast/2, handle_info/2]). -export([monitor_sync/1]). @@ -79,9 +79,6 @@ handle_info({'DOWN', _, _, _, {sync_error, Nodes}}, #st{tid = Tid} = St) -> handle_info(Msg, St) -> {stop, {invalid_info, Msg}, St}. -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - start_sync(Nodes) -> {Pid, _} = spawn_monitor(?MODULE, monitor_sync, [Nodes]), Pid. diff --git a/src/rexi/src/rexi_buffer.erl b/src/rexi/src/rexi_buffer.erl index 7c1b0c5d0..9bedbef63 100644 --- a/src/rexi/src/rexi_buffer.erl +++ b/src/rexi/src/rexi_buffer.erl @@ -18,9 +18,7 @@ init/1, handle_call/3, handle_cast/2, - handle_info/2, - terminate/2, - code_change/3 + handle_info/2 ]). -export([ @@ -88,15 +86,6 @@ handle_info(timeout, State) -> handle_info({'DOWN', Ref, _, Pid, _}, #state{sender = {Pid, Ref}} = State) -> {noreply, State#state{sender = nil}, 0}. -terminate(_Reason, _State) -> - ok. - -code_change(_OldVsn, {state, Buffer, Sender, Count}, _Extra) -> - Max = list_to_integer(config:get("rexi", "buffer_count", "2000")), - {ok, #state{buffer = Buffer, sender = Sender, count = Count, max_count = Max}}; -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - should_drop(#state{count = Count, max_count = Max}) -> Count >= Max. diff --git a/src/rexi/src/rexi_server.erl b/src/rexi/src/rexi_server.erl index 07b1cdd82..676a15d52 100644 --- a/src/rexi/src/rexi_server.erl +++ b/src/rexi/src/rexi_server.erl @@ -17,8 +17,7 @@ handle_call/3, handle_cast/2, handle_info/2, - terminate/2, - code_change/3 + terminate/2 ]). -export([start_link/1, init_p/2, init_p/3]). @@ -122,9 +121,6 @@ terminate(_Reason, St) -> ), ok. -code_change(_OldVsn, #st{} = State, _Extra) -> - {ok, State}. - init_p(From, MFA) -> init_p(From, MFA, undefined). diff --git a/src/rexi/src/rexi_server_mon.erl b/src/rexi/src/rexi_server_mon.erl index f547d45e4..eb8683a95 100644 --- a/src/rexi/src/rexi_server_mon.erl +++ b/src/rexi/src/rexi_server_mon.erl @@ -23,11 +23,9 @@ -export([ init/1, - terminate/2, handle_call/3, handle_cast/2, - handle_info/2, - code_change/3 + handle_info/2 ]). -export([ @@ -68,9 +66,6 @@ init(ChildMod) -> couch_log:notice("~s : started servers", [ChildMod]), {ok, ChildMod}. -terminate(_Reason, _St) -> - ok. - handle_call(status, _From, ChildMod) -> case missing_servers(ChildMod) of [] -> @@ -104,11 +99,6 @@ handle_info(Msg, St) -> couch_log:notice("~s ignored_info ~w", [?MODULE, Msg]), {noreply, St}. -code_change(_OldVsn, nil, _Extra) -> - {ok, rexi_server}; -code_change(_OldVsn, St, _Extra) -> - {ok, St}. - start_servers(ChildMod) -> lists:foreach( fun(Id) -> diff --git a/src/smoosh/src/smoosh_server.erl b/src/smoosh/src/smoosh_server.erl index 3b0b86808..0ae759016 100644 --- a/src/smoosh/src/smoosh_server.erl +++ b/src/smoosh/src/smoosh_server.erl @@ -33,7 +33,6 @@ handle_call/3, handle_cast/2, handle_info/2, - code_change/3, terminate/2 ]). @@ -264,9 +263,6 @@ terminate(_Reason, #state{access_cleaner = CPid}) -> end, ets:foldl(Fun, ok, ?MODULE). -code_change(_OldVsn, State, _Extra) -> - {ok, State}. - update_access(Object) -> Now = erlang:monotonic_time(second), true = ets:insert(?ACCESS, {Object, Now}),