List:Commits« Previous MessageNext Message »
From:paul.dubois Date:April 1 2011 4:29pm
Subject:svn commit - mysqldoc@oter02: r25672 - in trunk: . refman-5.1 refman-5.5 refman-5.6 refman-6.0
View as plain text  
Author: pd221994
Date: 2011-04-01 18:29:22 +0200 (Fri, 01 Apr 2011)
New Revision: 25672

Log:
 r46576@dhcp-adc-twvpn-1-vpnpool-10-154-10-228:  paul | 2011-04-01 11:26:38 -0500
 Add information about daemon plugins


Modified:
   svk:merge
   trunk/refman-5.1/extending-mysql.xml
   trunk/refman-5.5/extending-mysql.xml
   trunk/refman-5.6/extending-mysql.xml
   trunk/refman-6.0/extending-mysql.xml

Property changes on: trunk
___________________________________________________________________

Modified: svk:merge
===================================================================


Changed blocks: 0, Lines Added: 0, Lines Deleted: 0; 1277 bytes


Modified: trunk/refman-5.1/extending-mysql.xml
===================================================================
--- trunk/refman-5.1/extending-mysql.xml	2011-04-01 16:29:13 UTC (rev 25671)
+++ trunk/refman-5.1/extending-mysql.xml	2011-04-01 16:29:22 UTC (rev 25672)
Changed blocks: 5, Lines Added: 98, Lines Deleted: 6; 4558 bytes

@@ -615,6 +615,12 @@
 
         <listitem>
           <para>
+            Daemons
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
             <literal>INFORMATION_SCHEMA</literal> tables
           </para>
         </listitem>

@@ -807,7 +813,6 @@
 
       </section>
 
-<!--
       <section id="daemon-plugins">
 
         <title>Daemon Plugins</title>

@@ -834,7 +839,6 @@
         </para>
 
       </section>
--->
 
       <section id="information-schema-plugins">
 

@@ -2380,7 +2384,7 @@
 
 <programlisting>
 mysql_declare_plugin(<replaceable>name</replaceable>)
- <replaceable>... one or more server plugin declarations here ...</replaceable>
+ <replaceable>... one or more server plugin descriptors here ...</replaceable>
 mysql_declare_plugin_end;
 </programlisting>
 

@@ -3107,17 +3111,105 @@
 
       </section>
 
-<!--
       <section id="writing-daemon-plugins">
 
         <title>Writing Daemon Plugins</title>
 
         <para>
-          [TO DO]
+          A daemon plugin is a simple type of plugin used for code that
+          should be run by the server but that does not communicate with
+          it. For an example that shows how to write a daemon plugin,
+          see the <filename>plugin/daemon_example</filename> directory
+          within a MySQL source distribution. This directory contains
+          the <literal>daemon_example.cc</literal> source file for a
+          daemon plugin that writes a heartbeat string at regular
+          intervals to a file named
+          <filename>mysql-heartbeat.log</filename> in the data
+          directory. The following instructions refer to this source
+          file.
         </para>
 
+        <para>
+          To write a daemon plugin, include the following header file:
+        </para>
+
+<programlisting>
+#include &lt;mysql/plugin.h&gt;
+</programlisting>
+
+        <para>
+          This file defines the <literal>MYSQL_DAEMON_PLUGIN</literal>
+          plugin type and the data structures needed to declare the
+          plugin. Other MySQL or general header files might also be
+          needed.
+        </para>
+
+        <para>
+          The <filename>daemon_example.cc</filename> file sets up the
+          library descriptor as follows. The library descriptor includes
+          a single general server plugin descriptor.
+        </para>
+
+<programlisting>
+mysql_declare_plugin(daemon_example)
+{
+  MYSQL_DAEMON_PLUGIN,
+  &amp;daemon_example_plugin,
+  "daemon_example",
+  "Brian Aker",
+  "Daemon example, creates a heartbeat beat file in mysql-heartbeat.log",
+  PLUGIN_LICENSE_GPL,
+  daemon_example_plugin_init, /* Plugin Init */
+  daemon_example_plugin_deinit, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+  NULL,                       /* status variables                */
+  NULL,                       /* system variables                */
+  NULL                        /* config options                  */
+}
+mysql_declare_plugin_end;
+</programlisting>
+
+        <para>
+          The second member of the plugin descriptor,
+          <literal>daemon_example_plugin</literal>, points to the
+          type-specific daemon plugin descriptor. This structure is
+          trivial, consisting only of the type-specific API version
+          number:
+        </para>
+
+<programlisting>
+struct st_mysql_daemon daemon_example_plugin=
+{ MYSQL_DAEMON_INTERFACE_VERSION  };
+</programlisting>
+
+        <para>
+          The type-specific structure has no interface functions. There
+          is no communication between the server and the plugin, except
+          that the server calls the initialization and deinitialization
+          functions from the general plugin descriptor to start and stop
+          the plugin:
+        </para>
+
+        <itemizedlist>
+
+          <listitem>
+            <para>
+              <literal>daemon_example_plugin_init()</literal> opens the
+              heartbeat file and spawns a thread that wakes up
+              periodically and writes the next message to the file.
+            </para>
+          </listitem>
+
+          <listitem>
+            <para>
+              <literal>daemon_example_plugin_deinit()</literal> closes
+              the file and performs other cleanup.
+            </para>
+          </listitem>
+
+        </itemizedlist>
+
       </section>
--->
 
 <!--
       <section id="writing-information-schema-plugins">


Modified: trunk/refman-5.5/extending-mysql.xml
===================================================================
--- trunk/refman-5.5/extending-mysql.xml	2011-04-01 16:29:13 UTC (rev 25671)
+++ trunk/refman-5.5/extending-mysql.xml	2011-04-01 16:29:22 UTC (rev 25672)
Changed blocks: 5, Lines Added: 98, Lines Deleted: 6; 4558 bytes

@@ -674,6 +674,12 @@
 
         <listitem>
           <para>
+            Daemons
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
             <literal>INFORMATION_SCHEMA</literal> tables
           </para>
         </listitem>

@@ -884,7 +890,6 @@
 
       </section>
 
-<!--
       <section id="daemon-plugins">
 
         <title>Daemon Plugins</title>

@@ -911,7 +916,6 @@
         </para>
 
       </section>
--->
 
       <section id="information-schema-plugins">
 

@@ -2898,7 +2902,7 @@
 
 <programlisting>
 mysql_declare_plugin(<replaceable>name</replaceable>)
- <replaceable>... one or more server plugin declarations here ...</replaceable>
+ <replaceable>... one or more server plugin descriptors here ...</replaceable>
 mysql_declare_plugin_end;
 </programlisting>
 

@@ -3590,17 +3594,105 @@
 
       </section>
 
-<!--
       <section id="writing-daemon-plugins">
 
         <title>Writing Daemon Plugins</title>
 
         <para>
-          [TO DO]
+          A daemon plugin is a simple type of plugin used for code that
+          should be run by the server but that does not communicate with
+          it. For an example that shows how to write a daemon plugin,
+          see the <filename>plugin/daemon_example</filename> directory
+          within a MySQL source distribution. This directory contains
+          the <literal>daemon_example.cc</literal> source file for a
+          daemon plugin that writes a heartbeat string at regular
+          intervals to a file named
+          <filename>mysql-heartbeat.log</filename> in the data
+          directory. The following instructions refer to this source
+          file.
         </para>
 
+        <para>
+          To write a daemon plugin, include the following header file:
+        </para>
+
+<programlisting>
+#include &lt;mysql/plugin.h&gt;
+</programlisting>
+
+        <para>
+          This file defines the <literal>MYSQL_DAEMON_PLUGIN</literal>
+          plugin type and the data structures needed to declare the
+          plugin. Other MySQL or general header files might also be
+          needed.
+        </para>
+
+        <para>
+          The <filename>daemon_example.cc</filename> file sets up the
+          library descriptor as follows. The library descriptor includes
+          a single general server plugin descriptor.
+        </para>
+
+<programlisting>
+mysql_declare_plugin(daemon_example)
+{
+  MYSQL_DAEMON_PLUGIN,
+  &amp;daemon_example_plugin,
+  "daemon_example",
+  "Brian Aker",
+  "Daemon example, creates a heartbeat beat file in mysql-heartbeat.log",
+  PLUGIN_LICENSE_GPL,
+  daemon_example_plugin_init, /* Plugin Init */
+  daemon_example_plugin_deinit, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+  NULL,                       /* status variables                */
+  NULL,                       /* system variables                */
+  NULL                        /* config options                  */
+}
+mysql_declare_plugin_end;
+</programlisting>
+
+        <para>
+          The second member of the plugin descriptor,
+          <literal>daemon_example_plugin</literal>, points to the
+          type-specific daemon plugin descriptor. This structure is
+          trivial, consisting only of the type-specific API version
+          number:
+        </para>
+
+<programlisting>
+struct st_mysql_daemon daemon_example_plugin=
+{ MYSQL_DAEMON_INTERFACE_VERSION  };
+</programlisting>
+
+        <para>
+          The type-specific structure has no interface functions. There
+          is no communication between the server and the plugin, except
+          that the server calls the initialization and deinitialization
+          functions from the general plugin descriptor to start and stop
+          the plugin:
+        </para>
+
+        <itemizedlist>
+
+          <listitem>
+            <para>
+              <literal>daemon_example_plugin_init()</literal> opens the
+              heartbeat file and spawns a thread that wakes up
+              periodically and writes the next message to the file.
+            </para>
+          </listitem>
+
+          <listitem>
+            <para>
+              <literal>daemon_example_plugin_deinit()</literal> closes
+              the file and performs other cleanup.
+            </para>
+          </listitem>
+
+        </itemizedlist>
+
       </section>
--->
 
 <!--
       <section id="writing-information-schema-plugins">


Modified: trunk/refman-5.6/extending-mysql.xml
===================================================================
--- trunk/refman-5.6/extending-mysql.xml	2011-04-01 16:29:13 UTC (rev 25671)
+++ trunk/refman-5.6/extending-mysql.xml	2011-04-01 16:29:22 UTC (rev 25672)
Changed blocks: 5, Lines Added: 98, Lines Deleted: 6; 4558 bytes

@@ -674,6 +674,12 @@
 
         <listitem>
           <para>
+            Daemons
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
             <literal>INFORMATION_SCHEMA</literal> tables
           </para>
         </listitem>

@@ -884,7 +890,6 @@
 
       </section>
 
-<!--
       <section id="daemon-plugins">
 
         <title>Daemon Plugins</title>

@@ -911,7 +916,6 @@
         </para>
 
       </section>
--->
 
       <section id="information-schema-plugins">
 

@@ -2898,7 +2902,7 @@
 
 <programlisting>
 mysql_declare_plugin(<replaceable>name</replaceable>)
- <replaceable>... one or more server plugin declarations here ...</replaceable>
+ <replaceable>... one or more server plugin descriptors here ...</replaceable>
 mysql_declare_plugin_end;
 </programlisting>
 

@@ -3590,17 +3594,105 @@
 
       </section>
 
-<!--
       <section id="writing-daemon-plugins">
 
         <title>Writing Daemon Plugins</title>
 
         <para>
-          [TO DO]
+          A daemon plugin is a simple type of plugin used for code that
+          should be run by the server but that does not communicate with
+          it. For an example that shows how to write a daemon plugin,
+          see the <filename>plugin/daemon_example</filename> directory
+          within a MySQL source distribution. This directory contains
+          the <literal>daemon_example.cc</literal> source file for a
+          daemon plugin that writes a heartbeat string at regular
+          intervals to a file named
+          <filename>mysql-heartbeat.log</filename> in the data
+          directory. The following instructions refer to this source
+          file.
         </para>
 
+        <para>
+          To write a daemon plugin, include the following header file:
+        </para>
+
+<programlisting>
+#include &lt;mysql/plugin.h&gt;
+</programlisting>
+
+        <para>
+          This file defines the <literal>MYSQL_DAEMON_PLUGIN</literal>
+          plugin type and the data structures needed to declare the
+          plugin. Other MySQL or general header files might also be
+          needed.
+        </para>
+
+        <para>
+          The <filename>daemon_example.cc</filename> file sets up the
+          library descriptor as follows. The library descriptor includes
+          a single general server plugin descriptor.
+        </para>
+
+<programlisting>
+mysql_declare_plugin(daemon_example)
+{
+  MYSQL_DAEMON_PLUGIN,
+  &amp;daemon_example_plugin,
+  "daemon_example",
+  "Brian Aker",
+  "Daemon example, creates a heartbeat beat file in mysql-heartbeat.log",
+  PLUGIN_LICENSE_GPL,
+  daemon_example_plugin_init, /* Plugin Init */
+  daemon_example_plugin_deinit, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+  NULL,                       /* status variables                */
+  NULL,                       /* system variables                */
+  NULL                        /* config options                  */
+}
+mysql_declare_plugin_end;
+</programlisting>
+
+        <para>
+          The second member of the plugin descriptor,
+          <literal>daemon_example_plugin</literal>, points to the
+          type-specific daemon plugin descriptor. This structure is
+          trivial, consisting only of the type-specific API version
+          number:
+        </para>
+
+<programlisting>
+struct st_mysql_daemon daemon_example_plugin=
+{ MYSQL_DAEMON_INTERFACE_VERSION  };
+</programlisting>
+
+        <para>
+          The type-specific structure has no interface functions. There
+          is no communication between the server and the plugin, except
+          that the server calls the initialization and deinitialization
+          functions from the general plugin descriptor to start and stop
+          the plugin:
+        </para>
+
+        <itemizedlist>
+
+          <listitem>
+            <para>
+              <literal>daemon_example_plugin_init()</literal> opens the
+              heartbeat file and spawns a thread that wakes up
+              periodically and writes the next message to the file.
+            </para>
+          </listitem>
+
+          <listitem>
+            <para>
+              <literal>daemon_example_plugin_deinit()</literal> closes
+              the file and performs other cleanup.
+            </para>
+          </listitem>
+
+        </itemizedlist>
+
       </section>
--->
 
 <!--
       <section id="writing-information-schema-plugins">


Modified: trunk/refman-6.0/extending-mysql.xml
===================================================================
--- trunk/refman-6.0/extending-mysql.xml	2011-04-01 16:29:13 UTC (rev 25671)
+++ trunk/refman-6.0/extending-mysql.xml	2011-04-01 16:29:22 UTC (rev 25672)
Changed blocks: 5, Lines Added: 98, Lines Deleted: 6; 4558 bytes

@@ -662,6 +662,12 @@
 
         <listitem>
           <para>
+            Daemons
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
             <literal>INFORMATION_SCHEMA</literal> tables
           </para>
         </listitem>

@@ -866,7 +872,6 @@
 
       </section>
 
-<!--
       <section id="daemon-plugins">
 
         <title>Daemon Plugins</title>

@@ -893,7 +898,6 @@
         </para>
 
       </section>
--->
 
       <section id="information-schema-plugins">
 

@@ -2546,7 +2550,7 @@
 
 <programlisting>
 mysql_declare_plugin(<replaceable>name</replaceable>)
- <replaceable>... one or more server plugin declarations here ...</replaceable>
+ <replaceable>... one or more server plugin descriptors here ...</replaceable>
 mysql_declare_plugin_end;
 </programlisting>
 

@@ -3271,17 +3275,105 @@
 
       </section>
 
-<!--
       <section id="writing-daemon-plugins">
 
         <title>Writing Daemon Plugins</title>
 
         <para>
-          [TO DO]
+          A daemon plugin is a simple type of plugin used for code that
+          should be run by the server but that does not communicate with
+          it. For an example that shows how to write a daemon plugin,
+          see the <filename>plugin/daemon_example</filename> directory
+          within a MySQL source distribution. This directory contains
+          the <literal>daemon_example.cc</literal> source file for a
+          daemon plugin that writes a heartbeat string at regular
+          intervals to a file named
+          <filename>mysql-heartbeat.log</filename> in the data
+          directory. The following instructions refer to this source
+          file.
         </para>
 
+        <para>
+          To write a daemon plugin, include the following header file:
+        </para>
+
+<programlisting>
+#include &lt;mysql/plugin.h&gt;
+</programlisting>
+
+        <para>
+          This file defines the <literal>MYSQL_DAEMON_PLUGIN</literal>
+          plugin type and the data structures needed to declare the
+          plugin. Other MySQL or general header files might also be
+          needed.
+        </para>
+
+        <para>
+          The <filename>daemon_example.cc</filename> file sets up the
+          library descriptor as follows. The library descriptor includes
+          a single general server plugin descriptor.
+        </para>
+
+<programlisting>
+mysql_declare_plugin(daemon_example)
+{
+  MYSQL_DAEMON_PLUGIN,
+  &amp;daemon_example_plugin,
+  "daemon_example",
+  "Brian Aker",
+  "Daemon example, creates a heartbeat beat file in mysql-heartbeat.log",
+  PLUGIN_LICENSE_GPL,
+  daemon_example_plugin_init, /* Plugin Init */
+  daemon_example_plugin_deinit, /* Plugin Deinit */
+  0x0100 /* 1.0 */,
+  NULL,                       /* status variables                */
+  NULL,                       /* system variables                */
+  NULL                        /* config options                  */
+}
+mysql_declare_plugin_end;
+</programlisting>
+
+        <para>
+          The second member of the plugin descriptor,
+          <literal>daemon_example_plugin</literal>, points to the
+          type-specific daemon plugin descriptor. This structure is
+          trivial, consisting only of the type-specific API version
+          number:
+        </para>
+
+<programlisting>
+struct st_mysql_daemon daemon_example_plugin=
+{ MYSQL_DAEMON_INTERFACE_VERSION  };
+</programlisting>
+
+        <para>
+          The type-specific structure has no interface functions. There
+          is no communication between the server and the plugin, except
+          that the server calls the initialization and deinitialization
+          functions from the general plugin descriptor to start and stop
+          the plugin:
+        </para>
+
+        <itemizedlist>
+
+          <listitem>
+            <para>
+              <literal>daemon_example_plugin_init()</literal> opens the
+              heartbeat file and spawns a thread that wakes up
+              periodically and writes the next message to the file.
+            </para>
+          </listitem>
+
+          <listitem>
+            <para>
+              <literal>daemon_example_plugin_deinit()</literal> closes
+              the file and performs other cleanup.
+            </para>
+          </listitem>
+
+        </itemizedlist>
+
       </section>
--->
 
 <!--
       <section id="writing-information-schema-plugins">


Thread
svn commit - mysqldoc@oter02: r25672 - in trunk: . refman-5.1 refman-5.5 refman-5.6 refman-6.0paul.dubois1 Apr