Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dgud/mnesia/depr-mnesia-registry/OTP-18994'
Browse files Browse the repository at this point in the history
* dgud/mnesia/depr-mnesia-registry/OTP-18994:
  Update deprecations
  Deprecate mnesia_registry functions
  • Loading branch information
dgud committed Feb 27, 2024
2 parents 66a9180 + 5dec40a commit efb7a92
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
Binary file modified bootstrap/lib/stdlib/ebin/otp_internal.beam
Binary file not shown.
37 changes: 17 additions & 20 deletions lib/mnesia/src/mnesia_registry.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,16 @@
%%
-module(mnesia_registry).
-moduledoc """
Dump support for registries in erl_interface.
This module is deprecated and the functions should not be used.
This module is usually part of the `erl_interface` application, but is currently
part of the Mnesia application.
This module was intended for internal use within OTP by the `erl_interface` application,
but it has two functions that are exported for public use.
This module is mainly intended for internal use within OTP, but it has two
functions that are exported for public use.
On C-nodes, `erl_interface` has support for registry tables. These tables reside
in RAM on the C-node, but can also be dumped into Mnesia tables. By default, the
dumping of registry tables through `erl_interface` causes a corresponding Mnesia
table to be created with `mnesia_registry:create_table/1`, if necessary.
Tables that are created with these functions can be administered as all other
Mnesia tables. They can be included in backups, replicas can be added, and so
on. The tables are normal Mnesia tables owned by the user of the corresponding
`erl_interface` registries.
Since the `erl_interface` have removed the registry functionality a long time ago,
these functions are deprecated.
## See Also
[erl_interface(3)](`e:erl_interface:index.html`), `m:mnesia`
`m:mnesia`
""".

%%%----------------------------------------------------------------------
Expand Down Expand Up @@ -94,7 +83,9 @@ on. The tables are normal Mnesia tables owned by the user of the corresponding
-export([start_dump/2, start_restore/2]).
-export([create_table/1, create_table/2]).

%% Internal exports
-deprecated([{create_table, '_', "use mnesia:create_table/2 instead"}]).

%% Internal exports
-export([init/4]).

-record(state, {table, ops = [], link_to}).
Expand Down Expand Up @@ -169,7 +160,10 @@ start_restore(Tab, LinkTo) ->
start(restore, Tab, LinkTo).

-doc """
create_table(Tab) -> ok | exit(Reason)
> #### Warning {: .warning }
>
> _This function is deprecated. Do not use it._
>
A wrapper function for `mnesia:create_table/2`, which creates a table (if there
is no existing table) with an appropriate set of `attributes`. The table only
Expand All @@ -187,7 +181,10 @@ create_table(Tab) ->
create_table(Tab, [{Storage, [node()]}]).

-doc """
create_table(Tab, TabDef) -> ok | exit(Reason)
> #### Warning {: .warning }
>
> _This function is deprecated. Do not use it._
>
A wrapper function for `mnesia:create_table/2`, which creates a table (if there
is no existing table) with an appropriate set of `attributes`. The attributes
Expand Down
2 changes: 2 additions & 0 deletions lib/stdlib/src/otp_internal.erl
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ obsolete(zlib, setBufSize, 2) ->
{removed, "this function has been removed"};
obsolete(auth, node_cookie, _) ->
{deprecated, "use erlang:set_cookie/2 and net_adm:ping/1 instead"};
obsolete(mnesia_registry, create_table, _) ->
{deprecated, "Use mnesia:create_table/2 instead", "OTP 28"};
obsolete(asn1ct, decode, _) ->
{removed, "use Mod:decode/2 instead"};
obsolete(asn1ct, encode, _) ->
Expand Down
6 changes: 6 additions & 0 deletions system/doc/general_info/DEPRECATIONS
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
# is scheduled to be removed in OTP 25.
#

#
# Added in OTP 27.
#

mnesia_registry:create_table/_ since=27 remove=28

#
# Added in OTP 26.
#
Expand Down

0 comments on commit efb7a92

Please sign in to comment.