mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document or at least list assorted Fabric related bits
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@332945 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
6b9fbd042b
commit
849749083c
5 changed files with 541 additions and 0 deletions
|
@ -111,6 +111,29 @@
|
|||
API changes may happen at any time without prior warning.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
New
|
||||
<link linkend="function.mysqlnd-ms-get-stats">statistics</link>
|
||||
to monitor the Fabric XML RPC call <literal>sharding.lookup_servers</literal>:
|
||||
<literal>fabric_sharding_lookup_servers_success</literal>,
|
||||
<literal>fabric_sharding_lookup_servers_failure</literal>,
|
||||
<literal>fabric_sharding_lookup_servers_time_total</literal>,
|
||||
<literal>fabric_sharding_lookup_servers_bytes_total</literal>,
|
||||
<literal>fabric_sharding_lookup_servers_xml_failure</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
New functions related to MySQL Fabric:
|
||||
<link linkend="function.mysqlnd-ms-fabric-select-shard">
|
||||
<function>mysqlnd_ms_fabric_select_shard</function></link>,
|
||||
<link linkend="function.mysqlnd-ms-fabric-select-global">
|
||||
<function>mysqlnd_ms_fabric_select_global</function></link>,
|
||||
<link linkend="function.mysqlnd-ms-dump-servers">
|
||||
<function>mysqlnd_ms_dump_servers</function></link>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
|
|
259
reference/mysqlnd_ms/functions/mysqlnd-ms-dump-servers.xml
Normal file
259
reference/mysqlnd_ms/functions/mysqlnd-ms-dump-servers.xml
Normal file
|
@ -0,0 +1,259 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 322165 $ -->
|
||||
|
||||
<refentry xml:id="function.mysqlnd-ms-dump-servers" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>mysqlnd_ms_dump_servers</refname>
|
||||
<refpurpose>Returns a list of currently configured servers</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type>
|
||||
<methodname>mysqlnd_ms_dump_servers</methodname>
|
||||
<methodparam><type>mixed</type><parameter>connection</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns a list of currently configured servers.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A MySQL connection handle obtained from any of the
|
||||
connect functions of the <link linkend="ref.mysqli">mysqli</link>,
|
||||
<link linkend="ref.mysql">mysql</link> or
|
||||
<link linkend="ref.pdo-mysql">PDO_MYSQL</link> extensions.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&false; on error. Otherwise, returns an array with two entries
|
||||
<literal>masters</literal> and <literal>slaves</literal> each of which contains
|
||||
an array listing all corresponding servers.
|
||||
</para>
|
||||
<para>
|
||||
The function can be used to check and debug the list of servers currently
|
||||
used by the plugin. It is mostly useful when the list of servers changes at
|
||||
runtime, for example, when using MySQL Fabric.
|
||||
</para>
|
||||
<para>
|
||||
<literal>masters</literal> and <literal>slaves</literal> server entries
|
||||
</para>
|
||||
<informaltable>
|
||||
<tgroup cols="3">
|
||||
<colspec colwidth="1*"/>
|
||||
<colspec colwidth="7*"/>
|
||||
<colspec colwidth="2*"/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Key</entry>
|
||||
<entry>Description</entry>
|
||||
<entry>Version</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>name_from_config</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
<para>
|
||||
Server entry name from config, if appliciable. NULL if no
|
||||
configuration name is available.
|
||||
</para>
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>hostname</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
<para>
|
||||
Host name of the server.
|
||||
</para>
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>user</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
<para>
|
||||
Database user used to authenticate against the server.
|
||||
</para>
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>port</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
<para>
|
||||
TCP/IP port of the server.
|
||||
</para>
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>socket</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
<para>
|
||||
Unix domain socket of the server.
|
||||
</para>
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
<para>
|
||||
<function>mysqlnd_ms_dump_servers</function> requires
|
||||
PECL mysqlnd_ms >> 1.6.0.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>mysqlnd_ms_dump_servers</function> example</title>
|
||||
<programlisting role="ini">
|
||||
<![CDATA[
|
||||
{
|
||||
"myapp": {
|
||||
"master": {
|
||||
"master1": {
|
||||
"host":"master1_host",
|
||||
"port":"master1_port",
|
||||
"socket":"master1_socket",
|
||||
"db":"master1_db",
|
||||
"user":"master1_user",
|
||||
"password":"master1_pw"
|
||||
}
|
||||
},
|
||||
"slave": {
|
||||
"slave_0": {
|
||||
"host":"slave0_host",
|
||||
"port":"slave0_port",
|
||||
"socket":"slave0_socket",
|
||||
"db":"slave0_db",
|
||||
"user":"slave0_user",
|
||||
"password":"slave0_pw"
|
||||
},
|
||||
"slave_1": {
|
||||
"host":"slave1_host"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$link = mysqli_connect("myapp", "global_user", "global_pass", "global_db", 1234, "global_socket");
|
||||
var_dump(mysqlnd_ms_dump_servers($link);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(2) {
|
||||
["masters"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
["name_from_config"]=>
|
||||
string(7) "master1"
|
||||
["hostname"]=>
|
||||
string(12) "master1_host"
|
||||
["user"]=>
|
||||
string(12) "master1_user"
|
||||
["port"]=>
|
||||
int(3306)
|
||||
["socket"]=>
|
||||
string(14) "master1_socket"
|
||||
}
|
||||
}
|
||||
["slaves"]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(5) {
|
||||
["name_from_config"]=>
|
||||
string(7) "slave_0"
|
||||
["hostname"]=>
|
||||
string(11) "slave0_host"
|
||||
["user"]=>
|
||||
string(11) "slave0_user"
|
||||
["port"]=>
|
||||
int(3306)
|
||||
["socket"]=>
|
||||
string(13) "slave0_socket"
|
||||
}
|
||||
[1]=>
|
||||
array(5) {
|
||||
["name_from_config"]=>
|
||||
string(7) "slave_1"
|
||||
["hostname"]=>
|
||||
string(11) "slave1_host"
|
||||
["user"]=>
|
||||
string(12) "gloabal_user"
|
||||
["port"]=>
|
||||
int(1234)
|
||||
["socket"]=>
|
||||
string(13) "global_socket"
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 322165 $ -->
|
||||
|
||||
<refentry xml:id="function.mysqlnd-ms-fabric-select-global" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>mysqlnd_ms_fabric_select_global</refname>
|
||||
<refpurpose>Switch to global sharding server for a given table</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type>
|
||||
<methodname>mysqlnd_ms_fabric_select_global</methodname>
|
||||
<methodparam><type>mixed</type><parameter>connection</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>table_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
<para>
|
||||
MySQL Fabric related.
|
||||
</para>
|
||||
<para>
|
||||
Switch the connection to the nodes handling global sharding queries
|
||||
for the given table name.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A MySQL connection handle obtained from any of the
|
||||
connect functions of the <link linkend="ref.mysqli">mysqli</link>,
|
||||
<link linkend="ref.mysql">mysql</link> or
|
||||
<link linkend="ref.pdo-mysql">PDO_MYSQL</link> extensions.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The table name to ask Fabric about.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&false; on error. Otherwise, &true;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
<para>
|
||||
<function>mysqlnd_ms_fabric_select_global</function> requires
|
||||
PECL mysqlnd_ms >> 1.6.0.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 322165 $ -->
|
||||
|
||||
<refentry xml:id="function.mysqlnd-ms-fabric-select-shard" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>mysqlnd_ms_fabric_select_shard</refname>
|
||||
<refpurpose>Switch to shard</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type>
|
||||
<methodname>mysqlnd_ms_fabric_select_shard</methodname>
|
||||
<methodparam><type>mixed</type><parameter>connection</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>table_name</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>shard_key</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
|
||||
<para>
|
||||
MySQL Fabric related.
|
||||
</para>
|
||||
<para>
|
||||
Switch the connection to the shards responsible for the
|
||||
given table name and shard key.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>connection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A MySQL connection handle obtained from any of the
|
||||
connect functions of the <link linkend="ref.mysqli">mysqli</link>,
|
||||
<link linkend="ref.mysql">mysql</link> or
|
||||
<link linkend="ref.pdo-mysql">PDO_MYSQL</link> extensions.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>table_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The table name to ask Fabric about.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>shard_key</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The shard key to ask Fabric about.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&false; on error. Otherwise, &true;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
<para>
|
||||
<function>mysqlnd_ms_fabric_select_shard</function> requires
|
||||
PECL mysqlnd_ms >> 1.6.0.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -454,6 +454,69 @@
|
|||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>fabric_sharding_lookup_servers_success</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
Number of successful <literal>sharding.lookup_servers</literal>
|
||||
remote procedure calls to MySQL Fabric.
|
||||
A call is considered successful if the plugin could reach MySQL
|
||||
Fabric and got any reply. The reply itself may or may not be
|
||||
understood by the plugin. Success refers to the network transport
|
||||
only. If the reply was not understood or indicates a valid error condition,
|
||||
<literal>fabric_sharding_lookup_servers_xml_failure</literal>
|
||||
gets incremented.
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>fabric_sharding_lookup_servers_failure</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
Number of failed <literal>sharding.lookup_servers</literal>
|
||||
remote procedure calls to MySQL Fabric.
|
||||
A remote procedure call is considered failed if there was a
|
||||
network error in connecting to, writing to or reading from
|
||||
MySQL Fabric.
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>fabric_sharding_lookup_servers_time_total</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
Time spent connecting to,writing to and reading from MySQL
|
||||
Fabrich during the <literal>sharding.lookup_servers</literal>
|
||||
remote procedure call. The value is aggregated for all calls. Time is
|
||||
measured in microseconds.
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>fabric_sharding_lookup_servers_bytes_total</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
Total number of bytes received from MySQL Fabric in reply to
|
||||
<literal>sharding.lookup_servers</literal> calls.
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
<literal>fabric_sharding_lookup_servers_xml_failure</literal>
|
||||
</entry>
|
||||
<entry>
|
||||
How often a reply from MySQL Fabric to
|
||||
<literal>sharding.lookup_servers</literal> calls was not understood.
|
||||
Please note, the current experimental implementation does not
|
||||
distinguish between valid errors returned and malformed replies.
|
||||
</entry>
|
||||
<entry>Since 1.6.0.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
Loading…
Reference in a new issue