From 0ea95560324d0e84bd0be4bef6a88ad8405262ca Mon Sep 17 00:00:00 2001 From: ocelot-inc <pgulutzan@ocelot.ca> Date: Thu, 21 Aug 2014 14:45:52 -0600 Subject: [PATCH] consistent use of docbook userinput tag --- doc/user/configuration-reference.xml | 2 +- doc/user/data-model.xml | 4 +- doc/user/databases.xml | 32 +++++----- doc/user/replication.xml | 92 ++++++++++++++-------------- doc/user/server-administration.xml | 20 +++--- doc/user/stored-procedures.xml | 28 ++++----- doc/user/triggers.xml | 4 +- doc/user/tutorial.xml | 84 ++++++++++++++++--------- 8 files changed, 145 insertions(+), 121 deletions(-) diff --git a/doc/user/configuration-reference.xml b/doc/user/configuration-reference.xml index 4dcf601940..b08091f1b2 100644 --- a/doc/user/configuration-reference.xml +++ b/doc/user/configuration-reference.xml @@ -38,7 +38,7 @@ or <listitem xml:id="version-option"> <para><option>--version</option>, <option>-V</option></para> <para>Print product name and version, for example: - <programlisting><prompt>$ </prompt> ./tarantool --version + <programlisting><prompt>$ </prompt> <userinput>./tarantool --version</userinput> Tarantool 1.6.0-1084-ge067689 Target: Linux-x86_64-Debug ... diff --git a/doc/user/data-model.xml b/doc/user/data-model.xml index 3b2fe41d66..7e9fb3d7c1 100644 --- a/doc/user/data-model.xml +++ b/doc/user/data-model.xml @@ -124,8 +124,8 @@ must exist and must be a 64-bit unsigned integer. <para> Space definitions and index definitions are stored permanently in <emphasis>system spaces</emphasis>. It is possible to add, drop, or alter the definitions at runtime, with some restrictions. -The syntax details for defining spaces and indexes are in chapter 4 -<link linkend="sp-box-schema">Databases</link>. +The syntax details for defining spaces and indexes are in section +<link linkend="sp-box-library">The box library</link>. </para> diff --git a/doc/user/databases.xml b/doc/user/databases.xml index d1758742e9..ffc46ed98c 100644 --- a/doc/user/databases.xml +++ b/doc/user/databases.xml @@ -192,7 +192,7 @@ <varlistentry> <term> <emphasis role="lua" xml:id="box.create_space"> - box.schema.create_space(space-name [, {options} ]) + box.schema.create_space(<replaceable>space-name</replaceable> [, {<replaceable>options</replaceable>} ]) </emphasis> </term> <listitem> @@ -294,7 +294,7 @@ tarantool> <userinput>s = box.schema.create_space('space55', {if_not_exists = tr <varlistentry> <term> <emphasis role="lua" xml:id="box.create_index"> - box.space.<replaceable>space-name</replaceable>:create_index(index-name [, {options} ]) + box.space.<replaceable>space-name</replaceable>:create_index(<replaceable>index-name</replaceable> [, {<replaceable>options</replaceable>} ]) </emphasis> </term> <listitem> @@ -508,7 +508,7 @@ tarantool> <userinput>box.space.space_that_does_not_exist:drop()</userinput> tarantool> <userinput>box.space.space55:rename('space56')</userinput> --- ... -tarantool> box.space.space56:rename('space55') +tarantool> <userinput>box.space.space56:rename('space55')</userinput> --- ... </programlisting> @@ -519,7 +519,7 @@ tarantool> box.space.space56:rename('space55') <varlistentry> <term> <emphasis role="lua" xml:id="box.space.alter"> - box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:alter({options}) + box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:alter({<replaceable>options</replaceable>}) </emphasis> </term> <listitem> @@ -575,7 +575,7 @@ tarantool> <userinput>box.space.space55.index.primary:drop()</userinput> <varlistentry> <term> <emphasis role="lua" xml:id="box.space.rename"> - box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:rename(index-name) + box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:rename(<replaceable>index-name</replaceable>) </emphasis> </term> <listitem> @@ -1497,7 +1497,7 @@ The result will be a table of tuples and will look like this: <varlistentry> <term> - <emphasis role="lua">box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:min([key])</emphasis> + <emphasis role="lua">box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:min([<replaceable>key</replaceable>])</emphasis> </term> <listitem> <para> @@ -1525,7 +1525,7 @@ The result will be a table of tuples and will look like this: <varlistentry> <term> - <emphasis role="lua">box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:max([key])</emphasis> + <emphasis role="lua">box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:max([<replaceable>key</replaceable>])</emphasis> </term> <listitem> <para> @@ -1584,7 +1584,7 @@ The result will be a table of tuples and will look like this: <varlistentry> <term> - <emphasis role="lua">box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:count(<replaceable>key-value</replaceable>, options)</emphasis> + <emphasis role="lua">box.space.<replaceable>space-name</replaceable>.index.<replaceable>index-name</replaceable>:count(<replaceable>key-value</replaceable>, <replaceable>options</replaceable>)</emphasis> </term> <listitem> <para> @@ -3432,7 +3432,7 @@ There are three special users: 'guest', 'admin', and 'public'. To select a row from the _user space, use <code>box.select</code>. For example, here is what happens with a select for user id = 0, which is the 'guest' user, without a password: -<programlisting><prompt>tarantool></prompt> box.space._user:select{0} +<programlisting><prompt>tarantool></prompt> <userinput>box.space._user:select{0}</userinput> --- - - [0, 1, 'guest'] ...</programlisting></para> @@ -3464,14 +3464,14 @@ To drop a user, say For example, here is a session which creates a new user with a strong password, selects a tuple in the _user space, and then drops the user. -<programlisting><prompt>tarantool></prompt> box.schema.user.create('ElizabethBrowning', {password = 'Iwtso65$SDS?'}) +<programlisting><prompt>tarantool></prompt> <userinput>box.schema.user.create('ElizabethBrowning', {password = 'Iwtso65$SDS?'})</userinput> --- ... -<prompt>tarantool></prompt> box.space._user:select{4} +<prompt>tarantool></prompt> <userinput>box.space._user:select{4}</userinput> --- - - [4, 1, 'ElizabethBrowning', {'chap-sha1': 'zyy3yArGOQ4T40PnsL6yPGlgYrU='}] ... -<prompt>tarantool></prompt> box.schema.user.drop('ElizabethBrowning') +<prompt>tarantool></prompt> <userinput>box.schema.user.drop('ElizabethBrowning')</userinput> --- ...</programlisting></para> @@ -3491,24 +3491,24 @@ the type of operation -- "read" or "write" or "execute" or a combination such as <para> The function for granting a privilege is: -<code>box.schema.user.grant(<replaceable>user-name-of-grantee</replaceable>, <replaceable>operation-type</replaceable>, <replaceable>object-type</replaceable>, '<replaceable>>object-name</replaceable>)</code> +<code>box.schema.user.grant(<replaceable>user-name-of-grantee</replaceable>, <replaceable>operation-type</replaceable>, <replaceable>object-type</replaceable>, <replaceable>object-name</replaceable>)</code> or <code>box.schema.user.grant(<replaceable>user-name-of-grantee</replaceable>, <replaceable>operation-type</replaceable>, 'universe')</code>. </para> <para> The function for revoking a privilege is: -<code>box.schema.user.revoke(<replaceable>user-name-of-grantee</replaceable>, <replaceable>operation-type</replaceable>, <replaceable>object-type</replaceable>, '<replaceable>>object-name</replaceable>)</code>. +<code>box.schema.user.revoke(<replaceable>user-name-of-grantee</replaceable>, <replaceable>operation-type</replaceable>, <replaceable>object-type</replaceable>, <replaceable>object-name</replaceable>)</code>. </para> <para> For example, here is a session where the admin user gave the guest user the privilege to read from a space named space55, and then took the privilege away: -<programlisting><prompt>tarantool></prompt> box.schema.user.grant('guest', 'read', 'space', 'space55') +<programlisting><prompt>tarantool></prompt> <userinput>box.schema.user.grant('guest', 'read', 'space', 'space55')</userinput> --- ... -<prompt>tarantool></prompt> box.schema.user.revoke('guest', 'read', 'space', 'space55') +<prompt>tarantool></prompt> <userinput>box.schema.user.revoke('guest', 'read', 'space', 'space55')</userinput> --- ...</programlisting></para> diff --git a/doc/user/replication.xml b/doc/user/replication.xml index c53133db7b..fbd80271be 100644 --- a/doc/user/replication.xml +++ b/doc/user/replication.xml @@ -100,7 +100,7 @@ <note><simpara> Replication parameters are "dynamic", which allows the replica to become a master and vice versa with the help of the - <olink targetptr="box.cfg"/> statement. + <olink targetptr="box.cfg">box.cfg</olink> statement. </simpara></note> </section> @@ -206,7 +206,7 @@ Step 2. Check where the second server's files will go by looking at the first server's databases can happen without conflicts. </para> <para> -Step 3. Start the second server thus:<programlisting><userinput>box.cfg{listen=uri#2, replication_source=<replaceable>uri#1</replaceable>}</userinput></programlisting> +Step 3. Start the second server thus:<programlisting><userinput>box.cfg{listen=<replaceable>uri#2</replaceable>, replication_source=<replaceable>uri#1</replaceable>}</userinput></programlisting> ... where uri#1 = the primary port that the first server is listening on. </para> <para> @@ -339,20 +339,20 @@ Now the screen looks like this: (except that UUID values are always different): <row><entry align="center">TERMINAL #1</entry><entry align="center">TERMINAL #2</entry></row> </thead> <tbody> - <row><entry><programlisting>$ # Terminal 1 -$ mkdir -p ~/tarantool_test_node_1 -$ cd ~/tarantool_test_node_1 -~/tarantool_test_node_1$ rm -R ~/tarantool_test_node_1/* -~/tarantool_test_node_1$ ~/tarantool-master/src/tarantool + <row><entry><programlisting>$ <userinput># Terminal 1</userinput> +$ <userinput>mkdir -p ~/tarantool_test_node_1</userinput> +$ <userinput>cd ~/tarantool_test_node_1</userinput> +~/tarantool_test_node_1$ <userinput>rm -R ~/tarantool_test_node_1/*</userinput> +~/tarantool_test_node_1$ <userinput>~/tarantool-master/src/tarantool</userinput> ~/tarantool-master/src/tarantool: version 1.6.0-1724-g033ed69 type 'help' for interactive help -tarantool> box.cfg{listen=3301} +tarantool> <userinput>box.cfg{listen=3301}</userinput> ... ... -tarantool> box.schema.user.grant('guest','read,write,execute','universe') +tarantool> <userinput>box.schema.user.grant('guest','read,write,execute','universe')</userinput> 2014-08-14 13:39:57.712 [24956] wal I> creating `./00000000000000000000.xlog.inprogress' --- ... -tarantool> box.space._cluster:select({0},{iterator='GE'}) +tarantool> <userinput>box.space._cluster:select({0},{iterator='GE'})</userinput> --- - - [1, 'd3de1435-5e26-4122-95e5-3e2d40e6e1df'] ... @@ -414,25 +414,25 @@ tarantool> 2014-08-14 13:41:31.097 [24958] main/101/spawner I> created a replica 2014-08-14 13:41:31.098 [25148] main/101/relay/127.0.0.1:42758 I> snapshot sent 2014-08-14 13:41:31.190 [24958] main/101/spawner I> created a replication relay: pid = 25150 2014-08-14 13:41:31.291 [25150] main/101/relay/127.0.0.1:42759 I> recover from `./00000000000000000000.xlog'</programlisting></entry> - <entry><programlisting><prompt>$ # Terminal 2 -~/tarantool_test_node_2$ mkdir -p ~/tarantool_test_node_2 -~/tarantool_test_node_2$ cd ~/tarantool_test_node_2 -~/tarantool_test_node_2$ rm -R ~/tarantool_test_node_2/* -~/tarantool_test_node_2$ ~/tarantool-master/src/tarantool +<entry><programlisting><prompt>$</prompt> <userinput># Terminal 2</userinput> +~/tarantool_test_node_2$ <userinput>mkdir -p ~/tarantool_test_node_2</userinput> +~/tarantool_test_node_2$ <userinput>cd ~/tarantool_test_node_2</userinput> +~/tarantool_test_node_2$ <userinput>rm -R ~/tarantool_test_node_2/*</userinput> +~/tarantool_test_node_2$ <userinput>~/tarantool-master/src/tarantool</userinput> /home/pgulutzan/tarantool-master/src/tarantool: version 1.6.0-1724-g033ed69 type 'help' for interactive help -tarantool> box.cfg{listen=3302, replication_source=3301} +tarantool> <userinput>box.cfg{listen=3302, replication_source=3301}</userinput> ... ... --- ... -tarantool> box.space._cluster:select({0},{iterator='GE'}) +tarantool> <userinput>box.space._cluster:select({0},{iterator='GE'})</userinput> 2014-08-14 13:41:31.189 [25139] main/102/replica/0.0.0.0:3301 C> connected to master 2014-08-14 13:41:31.291 [25139] wal I> creating `./00000000000000000000.xlog.inprogress' --- - - [1, 'd3de1435-5e26-4122-95e5-3e2d40e6e1df'] - [2, 'ea7d17d7-6690-4334-b09c-f38ffa305d36'] ... -</prompt></programlisting></entry></row> +</programlisting></entry></row> </tbody> </tgroup> </informaltable> @@ -448,24 +448,24 @@ Now the screen looks like this: <row><entry align="center">TERMINAL #1</entry><entry align="center">TERMINAL #2</entry></row> </thead> <tbody> - <row><entry><programlisting><prompt>... ... + <row><entry><programlisting>... ... tarantool> 2014-08-14 13:41:31.097 [24958] main/101/spawner I> created a replication relay: pid = 25148 2014-08-14 13:41:31.098 [25148] main/101/relay/127.0.0.1:42758 I> recovery start 2014-08-14 13:41:31.098 [25148] main/101/relay/127.0.0.1:42758 I> recovering from `./00000000000000000000.snap' 2014-08-14 13:41:31.098 [25148] main/101/relay/127.0.0.1:42758 I> snapshot sent 2014-08-14 13:41:31.190 [24958] main/101/spawner I> created a replication relay: pid = 25150 2014-08-14 13:41:31.291 [25150] main/101/relay/127.0.0.1:42759 I> recover from `./00000000000000000000.xlog' -s = box.schema.create_space('tester') +<userinput>s = box.schema.create_space('tester')</userinput> --- ... -tarantool> s:create_index('primary', {}) +tarantool> <userinput>s:create_index('primary', {})</userinput> --- ... -tarantool> s:insert{1,'Tuple inserted on Terminal #1'} +tarantool> <userinput>s:insert{1,'Tuple inserted on Terminal #1'}</userinput> --- - [1, 'Tuple inserted on Terminal #1'] ... -</prompt></programlisting></entry> +</programlisting></entry> <entry><programlisting><prompt>$ # Terminal 2 ~/tarantool_test_node_2$ mkdir -p ~/tarantool_test_node_2 ~/tarantool_test_node_2$ cd ~/tarantool_test_node_2 @@ -521,7 +521,7 @@ tarantool> s:insert{1,'Tuple inserted on Terminal #1'} --- - [1, 'Tuple inserted on Terminal #1'] ...</prompt></programlisting></entry> - <entry><programlisting><prompt>... ... + <entry><programlisting>... ... tarantool> box.space._cluster:select({0},{iterator='GE'}) 2014-08-14 13:41:31.189 [25139] main/102/replica/0.0.0.0:3301 C> connected to master 2014-08-14 13:41:31.291 [25139] wal I> creating `./00000000000000000000.xlog.inprogress' @@ -529,18 +529,18 @@ tarantool> box.space._cluster:select({0},{iterator='GE'}) - - [1, 'd3de1435-5e26-4122-95e5-3e2d40e6e1df'] - [2, 'ea7d17d7-6690-4334-b09c-f38ffa305d36'] ... -tarantool> s = box.space.tester +tarantool> <userinput>s = box.space.tester</userinput> --- ... -tarantool> s:select({1},{iterator='GE'}) +tarantool> <userinput>s:select({1},{iterator='GE'})</userinput> --- - - [1, 'Tuple inserted on Terminal #1'] ... -tarantool> s:insert{2,'Tuple inserted on Terminal #2'} +tarantool> <userinput>s:insert{2,'Tuple inserted on Terminal #2'}</userinput> --- - [2, 'Tuple inserted on Terminal #2'] ... -</prompt></programlisting></entry></row> +</programlisting></entry></row> </tbody> </tgroup> </informaltable> @@ -565,27 +565,27 @@ they both contain the same tuples. <row><entry align="center">TERMINAL #1</entry><entry align="center">TERMINAL #2</entry></row> </thead> <tbody> - <row><entry><programlisting><prompt>... ... + <row><entry><programlisting>... ... tarantool> s:insert{1,'Tuple inserted on Terminal #1'} --- - [1, 'Tuple inserted on Terminal #1'] ... -tarantool> os.exit() +tarantool> <userinput>os.exit()</userinput> 2014-08-14 15:08:40.376 [25150] main/101/relay/127.0.0.1:42759 I> done `./00000000000000000000.xlog' 2014-08-14 15:08:40.414 [24958] main/101/spawner I> Exiting: master shutdown 2014-08-14 15:08:40.414 [24958] main/101/spawner I> sending signal 15 to 1 children 2014-08-14 15:08:40.414 [24958] main/101/spawner I> waiting for children for up to 5 seconds -~/tarantool_test_node_1$ ls -l ~/tarantool_test_node_1 +~/tarantool_test_node_1$ <userinput>ls -l ~/tarantool_test_node_1</userinput> total 12 -rw-rw-r-- 1 1781 Aug 14 13:39 00000000000000000000.snap -rw-rw-r-- 1 416 Aug 14 15:08 00000000000000000000.xlog drwxr-x--- 2 4096 Aug 14 13:39 sophia -~/tarantool_test_node_1$ ls -l ~/tarantool_test_node_2 +~/tarantool_test_node_1$ <userinput>ls -l ~/tarantool_test_node_2</userinput> total 12 -rw-rw-r-- 1 1781 Aug 14 13:41 00000000000000000000.snap -rw-rw-r-- 1 486 Aug 14 14:52 00000000000000000000.xlog drwxr-x--- 2 4096 Aug 14 13:41 sophia -</prompt></programlisting></entry> +</programlisting></entry> <entry><programlisting><prompt>... ... tarantool> s:select({1},{iterator='GE'}) --- @@ -636,7 +636,7 @@ total 12 -rw-rw-r-- 1 486 Aug 14 14:52 00000000000000000000.xlog drwxr-x--- 2 4096 Aug 14 13:41 sophia </prompt></programlisting></entry> - <entry><programlisting><prompt>... ... + <entry><programlisting>... ... tarantool> s:insert{2,'Tuple inserted on Terminal #2'} --- - [2, 'Tuple inserted on Terminal #2'] @@ -646,17 +646,17 @@ tarantool> 2014-08-14 15:08:40.417 [25139] main/102/replica/0.0.0.0:3301 I> c unexpected EOF when reading from socket, called on fd 11, aka 127.0.0.1:42759, peer of 127.0.0.1:3301: Broken pipe 2014-08-14 15:08:40.417 [25139] main/102/replica/0.0.0.0:3301 I> will retry every 1 second -tarantool> box.space.tester:select({0},{iterator='GE'}) +tarantool> <userinput>box.space.tester:select({0},{iterator='GE'})</userinput> --- - - [1, 'Tuple inserted on Terminal #1'] - [2, 'Tuple inserted on Terminal #2'] ... -tarantool> box.space.tester:insert{3,'Another'} +tarantool> <userinput>box.space.tester:insert{3,'Another'}</userinput> --- - [3, 'Another'] ... -</prompt></programlisting></entry></row> +</programlisting></entry></row> </tbody> </tgroup> </informaltable> @@ -676,7 +676,7 @@ Now the screen looks like this: <row><entry align="center">TERMINAL #1</entry><entry align="center">TERMINAL #2</entry></row> </thead> <tbody> - <row><entry><programlisting><prompt>... ... + <row><entry><programlisting>... ... tarantool> s:insert{1,'Tuple inserted on Terminal #1'} --- - [1, 'Tuple inserted on Terminal #1'] @@ -696,21 +696,21 @@ total 12 -rw-rw-r-- 1 1781 Aug 14 13:41 00000000000000000000.snap -rw-rw-r-- 1 486 Aug 14 14:52 00000000000000000000.xlog drwxr-x--- 2 4096 Aug 14 13:41 sophia -~/tarantool_test_node_1$ ~/tarantool-master/src/tarantool +~/tarantool_test_node_1$ <userinput>~/tarantool-master/src/tarantool</userinput> ~/tarantool: version 1.6.0-1724-g033ed69 type 'help' for interactive help -tarantool> box.cfg{listen=3301} +tarantool> <userinput>box.cfg{listen=3301}</userinput> ... ... --- ... -tarantool> box.space.tester:select({0},{iterator='GE'}) +tarantool> <userinput>box.space.tester:select({0},{iterator='GE'})</userinput> 2014-08-14 15:22:22.883 [14305] main/101/spawner I> created a replication relay: pid = 14313 2014-08-14 15:22:22.983 [14313] main/101/relay/127.0.0.1:43646 I> recover from `./00000000000000000000.xlog' 2014-08-14 15:22:22.984 [14313] main/101/relay/127.0.0.1:43646 I> done `./00000000000000000000.xlog' --- - - [1, 'Tuple inserted on Terminal #1'] ... -</prompt></programlisting></entry> +</programlisting></entry> <entry><programlisting><prompt>... ... tarantool> s:insert{2,'Tuple inserted on Terminal #2'} --- @@ -756,7 +756,7 @@ The screen now looks like this: <row><entry align="center">TERMINAL #1</entry><entry align="center">TERMINAL #2</entry></row> </thead> <tbody> - <row><entry><programlisting><prompt>... ... + <row><entry><programlisting>... ... ~/tarantool_test_node_1$ ~/tarantool-master/src/tarantool ~/tarantool: version 1.6.0-1724-g033ed69 type 'help' for interactive help @@ -771,15 +771,15 @@ tarantool> box.space.tester:select({0},{iterator='GE'}) --- - - [1, 'Tuple inserted on Terminal #1'] ... -tarantool> box.cfg{replication_source='3302'} +tarantool> <userinput>box.cfg{replication_source='3302'}</userinput> 2014-08-14 15:35:47.567 [14303] main/101/interactive C> starting replication from 0.0.0.0:3302 --- ... -tarantool> box.space.tester:select({0},{iterator='GE'}) +tarantool> <userinput>box.space.tester:select({0},{iterator='GE'})</userinput> 2014-08-14 15:35:47.568 [14303] main/103/replica/0.0.0.0:3302 C> connected to master 2014-08-14 15:35:47.670 [14303] wal I> creating `./00000000000000000005.xlog.inprogress' 2014-08-14 15:35:47.684 [14313] main/101/relay/127.0.0.1:43646 I> recover from `./00000000000000000005.xlog' -</prompt></programlisting></entry> +</programlisting></entry> <entry><programlisting><prompt>... ... tarantool> s:insert{2,'Tuple inserted on Terminal #2'} --- diff --git a/doc/user/server-administration.xml b/doc/user/server-administration.xml index 0d0c6570dd..9d663c6ee4 100644 --- a/doc/user/server-administration.xml +++ b/doc/user/server-administration.xml @@ -159,29 +159,29 @@ are typed in by the user following prompts. Here is an example of an interactive-mode tarantool client session: <programlisting> -<prompt>$ </prompt>tarantool +<prompt>$ </prompt><userinput>tarantool</userinput> [ tarantool will display an introductory message including version number here ] -tarantool> box.cfg{listen=3301} +tarantool> <userinput>box.cfg{listen=3301}</userinput> [ tarantool will display configuration information here ] -tarantool> s = box.schema.create_space('tester') +tarantool> <userinput>s = box.schema.create_space('tester')</userinput> [ tarantool may display an in-progress message here ] --- ... -tarantool> s:create_index('primary', {type = 'hash', parts = {1, 'NUM'}}) +tarantool> <userinput>s:create_index('primary', {type = 'hash', parts = {1, 'NUM'}})</userinput> --- ... -tarantool> box.space.tester:insert{1,'My first tuple'} +tarantool> <userinput>box.space.tester:insert{1,'My first tuple'}</userinput> --- - [1, 'My first tuple'] ... -tarantool> box.space.tester:select(1) +tarantool> <userinput>box.space.tester:select(1)</userinput> --- - - [1, 'My first tuple'] ... -tarantool> box.space.tester:drop() +tarantool> <userinput>box.space.tester:drop()</userinput> --- ... -tarantool> os.exit() +tarantool> <userinput>os.exit()</userinput> 2014-04-30 10:28:00.886 [20436] main/101/spawner I> Exiting: master shutdown <prompt>$ </prompt> </programlisting> @@ -244,10 +244,10 @@ for example tarantool should be in <filename>/usr/bin</filename>. The only necessary argument is the "instance", which is an arbitrary numeric identification formatted as digit.digit. The following is a sample run: -<programlisting><prompt>$ </prompt>tarantool_deploy.sh 0.1 +<programlisting><prompt>$ </prompt><userinput>tarantool_deploy.sh 0.1</userinput> tarantool_deploy.sh: About to deploy Tarantool instance 0.1. tarantool_deploy.sh: Continue? [n/y] -y +<userinput>y</userinput> tarantool_deploy.sh: >>> deploy instance 0.1 tarantool_deploy.sh: >>> updating deployment config tarantool_deploy.sh: done diff --git a/doc/user/stored-procedures.xml b/doc/user/stored-procedures.xml index d4ba445183..7e8ed1d596 100644 --- a/doc/user/stored-procedures.xml +++ b/doc/user/stored-procedures.xml @@ -822,23 +822,23 @@ tarantool> <userinput>json.decode('{"hello": "world"}').hello</userinput> <para> <bridgehead renderas="sect4">Example</bridgehead> <programlisting> -tarantool> yaml = require('yaml') +<prompt>tarantool></prompt> <userinput>yaml = require('yaml')</userinput> --- ... -tarantool> y = yaml.encode({'a',1,'b',2}) +<prompt>tarantool></prompt> <userinput>y = yaml.encode({'a',1,'b',2})</userinput> --- ... -tarantool> z = yaml.decode(y) +<prompt>tarantool></prompt> <userinput>z = yaml.decode(y)</userinput> --- ... -tarantool> z[1],z[2],z[3],z[4] +<prompt>tarantool></prompt> <userinput>z[1],z[2],z[3],z[4]</userinput> --- - a - 1 - b - 2 ... -tarantool> if yaml.NULL == nil then print('hi') end +<prompt>tarantool></prompt> <userinput>if yaml.NULL == nil then print('hi') end</userinput> hi --- ... @@ -900,23 +900,23 @@ hi <para> <bridgehead renderas="sect4">Example</bridgehead> <programlisting> -tarantool> msgpack = require('msgpack') +<prompt>tarantool></prompt> <userinput>msgpack = require('msgpack')</userinput> --- ... -tarantool> y = msgpack.encode({'a',1,'b',2}) +<prompt>tarantool></prompt> <userinput> y = msgpack.encode({'a',1,'b',2})</userinput> --- ... -tarantool> z = msgpack.decode(y) +<prompt>tarantool></prompt> <userinput> z = msgpack.decode(y)</userinput> --- ... -tarantool> z[1],z[2],z[3],z[4] +<prompt>tarantool></prompt> <userinput> z[1],z[2],z[3],z[4]</userinput> --- - a - 1 - b - 2 ... -tarantool> box.space.tester:insert{20,msgpack.NULL,20} +<prompt>tarantool></prompt> <userinput> box.space.tester:insert{20,msgpack.NULL,20}</userinput> --- - [20, null, 20] ... @@ -1439,7 +1439,7 @@ the status is dead because the cancel worked.<programlisting> </varlistentry> </variablelist> <para> - <bridgehead renderas="sect4">Example</bridgehead><programlisting> + <bridgehead renderas="sect4">Example</bridgehead><programlisting><userinput> fiber = require('fiber') channel = fiber.channel(10) @@ -1497,7 +1497,7 @@ function producer2_fiber() end end end -</programlisting> +</userinput></programlisting> </para> </section> @@ -2290,7 +2290,7 @@ get expirationd through the test. </para> <para> 3. Execute these requests: -<programlisting> +<programlisting><userinput> box.cfg{} a = box.schema.create_space('origin') a:create_index('first', {type = 'tree', parts = {1, 'NUM'}}) @@ -2300,7 +2300,7 @@ get expirationd through the test. expd._debug = true expd.do_test('origin', 'archive') os.exit() -</programlisting> +</userinput></programlisting> The database-specific requests (cfg, create_space, create_index) should already be familiar. The key for getting the rock rolling is <code>expd = require('expirationd')</code>. diff --git a/doc/user/triggers.xml b/doc/user/triggers.xml index cafeff29d0..26d2f3d1b6 100644 --- a/doc/user/triggers.xml +++ b/doc/user/triggers.xml @@ -30,7 +30,7 @@ <variablelist> <varlistentry> <term> - <emphasis role="lua">box.session.on_connect(chunk) </emphasis> + <emphasis role="lua">box.session.on_connect(<replaceable>chunk</replaceable>) </emphasis> </term> <listitem><para> Set a callback (trigger) for invoking on each connected session. @@ -51,7 +51,7 @@ <varlistentry> <term> - <emphasis role="lua">box.session.on_disconnect(chunk)</emphasis> + <emphasis role="lua">box.session.on_disconnect(<replaceable>chunk</replaceable>)</emphasis> </term> <listitem><simpara>Set a trigger invoked after a client has disconnected. Returns the old value of the trigger. If diff --git a/doc/user/tutorial.xml b/doc/user/tutorial.xml index fce58d40be..97017c1abe 100644 --- a/doc/user/tutorial.xml +++ b/doc/user/tutorial.xml @@ -75,6 +75,7 @@ forthcoming "Jessie". Add the tarantool.org repository to your apt sources list. $release is an environment variable which will contain the Debian version code e.g. "Wheezy": <programlisting> +<userinput> <command>wget</command> http://tarantool.org/dist/public.key <command>sudo apt-key add</command> <filename>./public.key</filename> release=`lsb_release -c -s` @@ -86,6 +87,7 @@ release=`lsb_release -c -s` # install <command>sudo apt-get update</command> <command>sudo apt-get install</command> tarantool +</userinput> </programlisting> </para> </simplesect> @@ -102,6 +104,7 @@ $release is an environment variable which will contain the Ubuntu version code e.g. "precise". If you want the version that comes with Ubuntu, start with the lines that follow the '# install' comment: <programlisting> +<userinput> <command>cd</command> ~ <command>wget</command> http://tarantool.org/dist/public.key <command>sudo apt-key add</command> <filename>./public.key</filename> @@ -114,6 +117,7 @@ release=`lsb_release -c -s` # install <command>sudo apt-get update</command> <command>sudo apt-get install</command> tarantool +</userinput> </programlisting> </para> </simplesect> @@ -145,15 +149,16 @@ Add the following section to your yum repository list version must be either 5 or 6 and $basearch i.e. base architecture must be either i386 or x86_64): <programlisting> +<userinput> # [tarantool] name=CentOS-<replaceable>$releasever</replaceable> - Tarantool baseurl=http://tarantool.org/dist/master/centos/<replaceable>$releasever</replaceable>/os/<replaceable>$basearch</replaceable>/ enabled=1 gpgcheck=0 -</programlisting> +</userinput></programlisting> For example, if you have CentOS version 6 and x86-64, you can add the new section thus: -<programlisting> +<programlisting><userinput> <command>echo</command> "[tarantool]" | \ <command>sudo tee</command> <filename>/etc/yum.repos.d/tarantool.repo</filename> <command>echo</command> "name=CentOS-6 - Tarantool"| <command>sudo tee</command> <option>-a</option> <filename>/etc/yum.repos.d/tarantool.repo</filename> @@ -161,6 +166,7 @@ add the new section thus: <command>sudo tee</command> <option>-a</option> <filename>/etc/yum.repos.d/tarantool.repo</filename> <command>echo</command> "enabled=1" | <command>sudo tee</command> <option>-a</option> <filename>/etc/yum.repos.d/tarantool.repo</filename> <command>echo</command> "gpgcheck=0" | <command>sudo tee</command> <option>-a</option> <filename>/etc/yum.repos.d/tarantool.repo</filename> +</userinput> </programlisting> </para> </simplesect> @@ -175,14 +181,17 @@ Add the following section to your yum repository list (in the following instructions, $releasever i.e. Fedora release version must be 2 and $basearch i.e. base architecture must be x86_64): <programlisting> +<userinput> [tarantool] name=Fedora-<replaceable>$releasever</replaceable> - Tarantool baseurl=http://tarantool.org/dist/master/fedora/<replaceable>$releasever</replaceable><replaceable>$basearch</replaceable>/ enabled=1 gpgcheck=0 +</userinput> </programlisting> For example, if you have Fedora version 20, you can add the new section thus: <programlisting> +<userinput> <command>echo</command> "[tarantool]" | \ <command>sudo tee</command> <filename>/etc/yum.repos.d/tarantool.repo</filename> <command>echo</command> "name=Fedora - Tarantool"| <command>sudo tee</command> <option>-a</option> <filename>/etc/yum.repos.d/tarantool.repo</filename> @@ -190,6 +199,7 @@ For example, if you have Fedora version 20, you can add the new section thus: <command>sudo tee</command> <option>-a</option> <filename>/etc/yum.repos.d/tarantool.repo</filename> <command>echo</command> "enabled=1" | <command>sudo tee</command> <option>-a</option> <filename>/etc/yum.repos.d/tarantool.repo</filename> <command>echo</command> "gpgcheck=0" | <command>sudo tee</command> <option>-a</option> <filename>/etc/yum.repos.d/tarantool.repo</filename> +</userinput> </programlisting> </para> </simplesect> @@ -200,9 +210,11 @@ For example, if you have Fedora version 20, you can add the new section thus: Tarantool is available from tarantool portage overlay. Use layman to add the overlay to your system: <programlisting> +<userinput> <command>layman</command> <option>-S</option> <command>layman</command> <option>-a</option> tarantool <command>emerge</command> <filename>dev-db/tarantool</filename> <option>-av</option> +</userinput> </programlisting> </para> </simplesect> @@ -226,9 +238,11 @@ First upgrade Clang (the C compiler) to version 3.2 or later using Command Line Tools for Xcode disk image version 4.6+ from Apple Developer web-site. Then use <command>brew</command>: <programlisting> +<userinput> <command>brew install</command> --use-clang https://raw.githubusercontent.com/tarantool/tarantool/master/extra/tarantool.rb # or <command>brew install</command> https://raw.githubusercontent.com/tarantool/tarantool/master/extra/tarantool.rb +</userinput> </programlisting> </para> </simplesect> @@ -259,14 +273,14 @@ github.com, and from github one gets with git. <listitem> <para> A C/C++ compiler. - Ordinarily the compiler is <productname>GCC</productname> version 4.6 or later, + Ordinarily the compiler is <productname>GCC</productname> version 4.6 or later, on Mac OS X it should be <productname>Clang</productname> version 3.2 or later. </para> </listitem> <listitem> <para> A program for managing the build process. - This is always <productname>CMake</productname> for GNU/Linux and FreeBSD. + This is always <productname>CMake</productname> for GNU/Linux and FreeBSD. The CMake version should be 2.8 or later. </para> </listitem> @@ -310,10 +324,12 @@ ones unless you intend to work on the documentation.</para> ... You should see that the python version is greater than 2.6 -- preferably 2.7 -- and less than 3.</para> <para>On Ubuntu you can get modules from the repository: <programlisting> +<userinput> # For test suite <command>sudo apt-get install</command> python-daemon python-yaml python-argparse # For documentation <command>sudo apt-get install</command> python-jinja2 python-markdown +</userinput> </programlisting></para> <para>On CentOS too you can get modules from the repository:<programlisting><command>sudo yum install</command> python26 python26-PyYAML python26-argparse</programlisting></para> <para>But in general it is best to set up the modules by getting @@ -321,35 +337,43 @@ ones unless you intend to work on the documentation.</para> <programlisting># python module for parsing YAML (pyYAML): For test suite: # (If wget fails, check the <citetitle xlink:href="http://pyyaml.org/wiki/PyYAML" xlink:title="Python YAML parser">PyYAML</citetitle> web site # to see what the current version is.) +<userinput> <command>cd</command> ~ <command>wget</command> http://pyyaml.org/download/pyyaml/PyYAML-3.10.tar.gz <command>tar</command> <option>-xzf</option> PyYAML-3.10.tar.gz <command>cd</command> PyYAML-3.10 <command>sudo python</command> setup.py install +</userinput> # python module for helping programs become daemons (daemon): For test suite: # (if wget fails, check the <citetitle xlink:href="http://pypi.python.org/pypi/python-daemon" xlink:title="Python daemon">python-daemon</citetitle> web site # to see what the current version is.) +<userinput> <command>cd</command> ~ <command>wget</command> http://pypi.python.org/packages/source/p/python-daemon/python-daemon-1.5.5.tar.gz <command>tar</command> <option>-xzvf</option> python-daemon-1.5.5.tar.gz <command>cd</command> python-daemon-1.5.5 <command>sudo python</command> setup.py install +</userinput> # python module for template engine (jinja2): For documentation: # (If wget fails, check the <citetitle xlink:href="https://pypi.python.org/pypi/Jinja2" xlink:title="Python Jinja2">python-jinja2</citetitle> web site # to see what the current version is.) +<userinput> <command>cd</command> ~ <command>wget</command> https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.2.tar.gz <command>tar</command> <option>-xzvf</option> Jinja2-2.7.2.tar.gz <command>cd</command> Jinja2-2.7.2 <command>sudo python</command> setup.py install +</userinput> # python module for text-to-html conversion (markdown): For documentation: # (If wget fails, check the <citetitle xlink:href="http://pypi.python.org/pypi/Markdown/" xlink:title="Python implementation of Markdown">python-markdown</citetitle> web site # to see what the current version is.) +<userinput> <command>cd</command> ~ <command>wget</command> https://pypi.python.org/packages/source/M/Markdown/Markdown-2.3.1.tar.gz <command>tar</command> <option>-xzvf</option> Markdown-2.3.1.tar.gz <command>cd</command> Markdown-2.3.1 <command>sudo python</command> setup.py install +</userinput> </programlisting> </para> @@ -360,9 +384,9 @@ the tarantool download will go inside it, as <computeroutput><filename>~/taranto </para> <para> -4. Use <productname>git</productname> to download from github.com.<programlisting> +4. Use <productname>git</productname> to download from github.com.<programlisting><userinput> <command>cd</command> ~ -<command>git clone</command> <option>-b master</option> https://github.com/tarantool/tarantool.git <option>tarantool</option></programlisting> +<command>git clone</command> <option>-b master</option> https://github.com/tarantool/tarantool.git <option>tarantool</option></userinput></programlisting> The optional argument <quote>-b master</quote> causes download from the master branch instead of the stable branch, and the optional last word on the line, <quote>tarantool</quote>, means download is to <computeroutput>~/tarantool</computeroutput>. </para> @@ -371,34 +395,34 @@ and the optional last word on the line, <quote>tarantool</quote>, means download 5. Use <productname>git</productname> again so that third-party contributions will be seen as well. This step is only necessary once, the first time you do a download. There is an alternative -- say <quote><computeroutput><command>git clone</command> --recursive</computeroutput></quote> in step 3 -- -but we prefer this method because it works with older versions of <productname>git</productname>.<programlisting><command>cd</command> ~/tarantool +but we prefer this method because it works with older versions of <productname>git</productname>.<programlisting><userinput><command>cd</command> ~/tarantool <command>git submodule init</command> <command>git submodule update</command> -<command>cd</command> ../</programlisting> +<command>cd</command> ../</userinput></programlisting> On rare occasions, the submodules will need to be updated again with the command: <userinput>git submodule update --init</userinput>. </para> <para> -6. Use CMake to initiate the build.<programlisting><command>cd</command> ~/tarantool +6. Use CMake to initiate the build.<programlisting><userinput><command>cd</command> ~/tarantool <command>make clean</command> # unnecessary, added for good luck <command>rm CMakeCache.txt</command> # unnecessary, added for good luck -<command>cmake .</command> # Start build with build type=Debug, no doc</programlisting> +<command>cmake .</command> # Start build with build type=Debug, no doc</userinput></programlisting> The option for specifying build type is <option>-DCMAKE_BUILD_TYPE=</option><replaceable>type</replaceable> where type = {None | Debug | Release | RelWithDebInfo | MinSizeRel} and a reasonable - choice for production is <option>-DCMAKE_BUILD_TYPE=RelWithDebInfo</option> (<quote>Debug</quote> - is used only by project maintainers and <quote>Release</quote> is used only when the + choice for production is <option>-DCMAKE_BUILD_TYPE=RelWithDebInfo</option> (<quote>Debug</quote> + is used only by project maintainers and <quote>Release</quote> is used only when the highest performance is required). - The option for asking to build documentation is <computeroutput><option>-DENABLE_DOC=</option><replaceable>{true|false}</replaceable></computeroutput> + The option for asking to build documentation is <computeroutput><option>-DENABLE_DOC=</option><replaceable>{true|false}</replaceable></computeroutput> and the assumption is that only a minority will need to rebuild the documentation (such as what you're reading now), so details about documentation are in the developer manual, and the reasonable choice - is <computeroutput><option>-DENABLE_DOC=false</option></computeroutput> or just don't use the <computeroutput><option>-DENABLE_DOC</option></computeroutput> clause at all. + is <computeroutput><option>-DENABLE_DOC=false</option></computeroutput> or just don't use the <computeroutput><option>-DENABLE_DOC</option></computeroutput> clause at all. </para> <para> - 7. Use make to complete the build.<programlisting><command>make</command></programlisting> - It's possible to say <quote><computeroutput><command>make install</command></computeroutput></quote> too, but that's not generally done. + 7. Use make to complete the build.<programlisting><userinput><command>make</command></userinput></programlisting> + It's possible to say <quote><computeroutput><command>make install</command></computeroutput></quote> too, but that's not generally done. </para> <para> @@ -408,10 +432,10 @@ The option for specifying build type is <option>-DCMAKE_BUILD_TYPE=</option><rep Tarantool's developers always run the test suite before they publish new versions. You should run the test suite too, if you make any changes in the code. Assuming you downloaded to <filename>~/tarantool</filename>, -the principal steps are:<programlisting><command>mkdir</command> ~/tarantool/bin # make a subdirectory named <filename>bin</filename> +the principal steps are:<programlisting><userinput><command>mkdir</command> ~/tarantool/bin # make a subdirectory named <filename>bin</filename> <command>ln</command> /usr/bin/python ~/tarantool/bin/python # link python to bin (this may require superuser privilege) <command>cd</command> ~/tarantool/test #get on the test subdirectory -PATH=~/tarantool/bin:$PATH ./run #run tests using python</programlisting> +PATH=~/tarantool/bin:$PATH ./run #run tests using python</userinput></programlisting> The output should contain reassuring reports, for example @@ -427,9 +451,9 @@ box/auth_access.test.lua [ pass ] ... etc.</computeroutput></programlisting> There are more than 70 tests in the suite. - To prevent later confusion, clean up what's in the <filename>bin</filename> -subdirectory:<programlisting><command>rm</command> ~/tarantool/bin/python -<command>rmdir</command> ~/tarantool/bin</programlisting> +To prevent later confusion, clean up what's in the <filename>bin</filename> +subdirectory:<programlisting><userinput><command>rm</command> ~/tarantool/bin/python +<command>rmdir</command> ~/tarantool/bin</userinput></programlisting> </para> @@ -471,20 +495,20 @@ Here is how to create a simple test database after installing. </para> <para> -1. Create a new directory. It's just for tests, you can delete it when the tests are over.<programlisting> -<command>mkdir</command> ~/tarantool_sandbox -<command>cd</command> ~/tarantool_sandbox </programlisting> +1. Create a new directory. It's just for tests, you can delete it when the tests are over.<programlisting><userinput> +<command>mkdir</command> <replaceable>~/tarantool_sandbox</replaceable> +<command>cd</command> <replaceable>~/tarantool_sandbox</replaceable> </userinput></programlisting> </para> <para> 2. Start the server. -The server name is <computeroutput><filename>tarantool</filename></computeroutput>.<programlisting> +The server name is <computeroutput><filename>tarantool</filename></computeroutput>.<programlisting><userinput> #if you downloaded a binary with apt-get or yum, say this: <command>/usr/bin/tarantool</command> #if you downloaded and untarred a binary tarball to ~/tarantool, say this: <command>~/tarantool/bin/tarantool</command> #if you built from a source download, say this: - <command>~/tarantool/src/tarantool</command> </programlisting> + <command>~/tarantool/src/tarantool</command> </userinput></programlisting> </para> <para> @@ -495,7 +519,7 @@ The server name is <computeroutput><filename>tarantool</filename></computeroutpu </para> <para> -If all goes well, you will see the server displaying progress as it initializes, something like this:<programlisting> +If all goes well, you will see the server displaying progress as it initializes, something like this:<programlisting><computeroutput> tarantool> box.cfg{listen=3301} 2014-08-07 09:41:41.077 ... version 1.6.0-1691-g95435d4 2014-08-07 09:41:41.077 ... log level 5 @@ -508,7 +532,7 @@ tarantool> box.cfg{listen=3301} 2014-08-07 09:41:41.095 ... saving snapshot `./00000000000000000000.snap.inprogress' 2014-08-07 09:41:41.127 ... done 2014-08-07 09:41:41.128 ... bound to primary port 0.0.0.0:3301 -2014-08-07 09:41:41.128 ... ready to accept requests</programlisting> +2014-08-07 09:41:41.128 ... ready to accept requests</computeroutput></programlisting> </para> <para> @@ -547,7 +571,7 @@ try this:<programlisting><prompt>tarantool> </prompt><userinput>t = s:insert( To select a tuple from the first space of the database, using the first defined key, try this:<programlisting><prompt>tarantool> </prompt><userinput>s:select{3}</userinput></programlisting> -Your terminal screen should now look like this:<programlisting> +Your terminal screen should now look like this:<programlisting><computeroutput> tarantool> s = box.schema.create_space('tester') 2014-06-10 12:04:18.158 ... creating `./00000000000000000002.xlog.inprogress' --- @@ -569,7 +593,7 @@ tarantool> s:select{3} - - [3, 'Length', 93] ... -tarantool></programlisting> +tarantool></computeroutput></programlisting> </para> <para> -- GitLab