File: mnesia_registry.html

package info (click to toggle)
erlang-doc-html 1%3A11.b.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,284 kB
  • ctags: 10,724
  • sloc: erlang: 505; ansic: 323; makefile: 62; perl: 61; sh: 45
file content (127 lines) | stat: -rw-r--r-- 3,493 bytes parent folder | download
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>mnesia_registry</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
  <STYLE TYPE="text/css">
<!--
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
  <IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>mnesia_registry</H1>
</CENTER>

<H3>MODULE</H3>
<DIV CLASS=REFBODY>
mnesia_registry
</DIV>

<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
Dump support for registries in erl_interface. 
</DIV>

<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>

<P>The module <CODE>mnesia_registry</CODE> is usually part of
<CODE>erl_interface</CODE>, but for the time being, it is a part of the
Mnesia application.


<P><CODE>mnesia_registry</CODE> is mainly an module intended for
internal usage within OTP, but it has two functions that
are exported for public use.


<P>On C-nodes <CODE>erl_interface</CODE> has support for registry
tables. These reside in RAM on the C-node but they may also be
dumped into Mnesia tables. By default, the dumping of registry
tables via <CODE>erl_interface</CODE> causes a corresponding Mnesia
table to be created with <CODE>mnesia_registry:create_table/1</CODE>
if necessary.


<P>The tables that are created with these functions can be
administered as all other Mnesia tables. They may be included in
backups or replicas may be added etc. The tables are in fact
normal Mnesia tables owned by the user of the corresponding
<CODE>erl_interface</CODE> registries.


</DIV>

<H3>EXPORTS</H3>

<P><A NAME="create_table/1"><STRONG><CODE>create_table(Tab) -&#62; ok | exit(Reason)</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This is a wrapper function for
<CODE>mnesia:create_table/2</CODE> which creates a table (if there is no existing table)
with an appropriate set of <CODE>attributes</CODE>. The table will
only reside on the local node and its storage type will be
the same as the <CODE>schema</CODE> table on the local
node, ie. <CODE>{ram_copies,[node()]}</CODE> or
<CODE>{disc_copies,[node()]}</CODE>.


<P>It is this function that is used by <CODE>erl_interface</CODE> to
create the Mnesia table if it did not already exist.

</DIV>

<P><A NAME="create_table/2"><STRONG><CODE>create_table(Tab, TabDef) -&#62; ok | exit(Reason)</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY>

<P>This is a wrapper function for
<CODE>mnesia:create_table/2</CODE> which creates a table (if there is no existing table)
with an appropriate set of <CODE>attributes</CODE>. The attributes
and <CODE>TabDef</CODE> are forwarded to
<CODE>mnesia:create_table/2</CODE>. For example, if the table should
reside as <CODE>disc_only_copies</CODE> on all nodes a call would
look like:

<PRE>
          TabDef = [{{disc_only_copies, node()|nodes()]}],
          mnesia_registry:create_table(my_reg, TabDef)
        
</PRE>

</DIV>

<H3>See Also</H3>
<DIV CLASS=REFBODY>

<P> mnesia(3), erl_interface(3)


</DIV>

<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
 Dan Gudmundsson - support@erlang.ericsson.se<BR>
 Hkan Mattsson - support@erlang.ericsson.se<BR>

</DIV>
<CENTER>
<HR>
<SMALL>mnesia 4.3.3<BR>
Copyright &copy; 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>