1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
<year>1998</year>
<year>2013</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
The contents of this file are subject to the Erlang Public License,
Version 1.1, (the "License"); you may not use this file except in
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
The Initial Developer of the Original Code is Ericsson AB.
</legalnotice>
<title>mnesia_registry</title>
<prepared>Dan Gudmundsson and Håkan Mattsson</prepared>
<responsible></responsible>
<docno></docno>
<approved></approved>
<checked></checked>
<date>98-04-24</date>
<rev>A</rev>
<file>mnesia_registry.sgml</file>
</header>
<module>mnesia_registry</module>
<modulesummary>Dump support for registries in erl_interface.</modulesummary>
<description>
<p>This module is usually part of the <c>erl_interface</c>
application, but is currently part of the <c>Mnesia</c>
application.</p>
<p>This module is mainly intended for internal use within OTP,
but it has two functions that are exported for public use.</p>
<p>On C-nodes, <c>erl_interface</c> has support for registry
tables. These tables reside in RAM on the C-node, but can also
be dumped into <c>Mnesia</c> tables. By default, the dumping
of registry tables through <c>erl_interface</c> causes a
corresponding <c>Mnesia</c> table to be created with
<c>mnesia_registry:create_table/1</c>, if necessary.</p>
<p>Tables that are created with these functions can be
administered as all other <c>Mnesia</c> tables. They can be
included in backups, replicas can be added, and so on.
The tables are normal <c>Mnesia</c> tables owned by the user
of the corresponding <c>erl_interface</c> registries.</p>
</description>
<funcs>
<func>
<name>create_table(Tab) -> ok | exit(Reason)</name>
<fsummary>Creates a registry table in Mnesia.</fsummary>
<desc>
<p>A wrapper function for <c>mnesia:create_table/2</c>,
which creates a table (if there is no existing table)
with an appropriate set of <c>attributes</c>. The table
only resides on the local node and its storage type is
the same as the <c>schema</c> table on the local node,
that is, <c>{ram_copies,[node()]}</c> or
<c>{disc_copies,[node()]}</c>.</p>
<p>This function is used by <c>erl_interface</c> to
create the <c>Mnesia</c> table if it does not already
exist.</p>
</desc>
</func>
<func>
<name>create_table(Tab, TabDef) -> ok | exit(Reason)</name>
<fsummary>Creates a customized registry table in Mnesia.</fsummary>
<desc>
<p>A wrapper function for <c>mnesia:create_table/2</c>,
which creates a table (if there is no existing table)
with an appropriate set of <c>attributes</c>. The
attributes and <c>TabDef</c> are forwarded to
<c>mnesia:create_table/2</c>. For example, if the table
is to reside as <c>disc_only_copies</c> on all nodes,
a call looks as follows:</p>
<code type="none">
TabDef = [{{disc_only_copies, node()|nodes()]}],
mnesia_registry:create_table(my_reg, TabDef)</code>
</desc>
</func>
</funcs>
<section>
<title>See Also</title>
<p><seealso marker="erl_interface:index">erl_interface(3)</seealso>,
<seealso marker="mnesia:mnesia">mnesia(3)</seealso></p>
</section>
</erlref>
|