From c8e17c603c13e1ab89d988282819405f553c76d0 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov <kostja.osipov@gmail.com> Date: Sat, 28 May 2011 02:48:57 +0400 Subject: [PATCH] User manual: namespace configuration. Explain how to configure a namespace. Tweak some error messages on the way. --- cfg/tarantool_feeder_cfg.cfg | 13 +-- cfg/tarantool_feeder_cfg.h | 17 ++-- doc/user/CMakeLists.txt | 21 ++++- doc/user/configuration-reference.xml | 115 ++++++++++++++++++++------- doc/user/html-highlight.xsl | 73 +++++++++++++++++ doc/user/language-reference.xml | 18 ++++- doc/user/namespace.xml | 89 +++++++++++++++++++++ doc/user/target.db | 2 +- doc/user/tnt-html.xsl | 7 +- doc/user/tnt.css | 10 +++ include/errcode.h | 2 +- mod/box/box.m | 4 +- mod/box/index.m | 2 +- 13 files changed, 324 insertions(+), 49 deletions(-) create mode 100644 doc/user/html-highlight.xsl create mode 100644 doc/user/namespace.xml diff --git a/cfg/tarantool_feeder_cfg.cfg b/cfg/tarantool_feeder_cfg.cfg index f6c7690bdd..c8407c3fb5 100644 --- a/cfg/tarantool_feeder_cfg.cfg +++ b/cfg/tarantool_feeder_cfg.cfg @@ -3,6 +3,7 @@ username = NULL # save core on abort/assert +# deprecated; use ulimit instead coredump = 0 # admin port @@ -12,13 +13,13 @@ admin_port = 0 # Log verbosity, possible values: ERROR=1, CRIT=2, WARN=3, INFO=4(default), DEBUG=5 log_level = 4 -# Size of slab arena in GiBs +# Size of slab arena in GB slab_alloc_arena = 1 # Size of minimal allocation unit slab_alloc_minimal = 64 -# Growth factor, each subsecuent unit size is factor * prev unit size +# Growth factor, each subsequent unit size is factor * prev unit size slab_alloc_factor = 2 # working directory (daemon will chdir(2) to it) @@ -28,15 +29,15 @@ work_dir = NULL pid_file = "tarantool.pid" # logger command will be executed via /bin/sh -c {} -# example: 'exec cronolog /var/log/taranul/%Y-%m/%Y-%m-%d/tarantool.log' -# example: 'exec extra/logger.pl /var/log/taranul/tarantool.log' +# example: 'exec cronolog /var/log/tarantool/%Y-%m/%Y-%m-%d/tarantool.log' +# example: 'exec extra/logger.pl /var/log/tarantool/tarantool.log' # when logger is not configured all logging going to STDERR logger = NULL -# make logging nonblocking, this potentially can loss some logging data +# make logging nonblocking, this potentially can lose some logging data logger_nonblock = 1 -# delay between loop iteraions +# delay between loop iterations io_collect_interval = 0 # size of listen backlog diff --git a/cfg/tarantool_feeder_cfg.h b/cfg/tarantool_feeder_cfg.h index f65ae646dd..20a2349bed 100644 --- a/cfg/tarantool_feeder_cfg.h +++ b/cfg/tarantool_feeder_cfg.h @@ -15,7 +15,10 @@ typedef struct tarantool_cfg { /* username to switch to */ char* username; - /* save core on abort/assert */ + /* + * save core on abort/assert + * deprecated; use ulimit instead + */ int32_t coredump; /* @@ -27,13 +30,13 @@ typedef struct tarantool_cfg { /* Log verbosity, possible values: ERROR=1, CRIT=2, WARN=3, INFO=4(default), DEBUG=5 */ int32_t log_level; - /* Size of slab arena in GiBs */ + /* Size of slab arena in GB */ double slab_alloc_arena; /* Size of minimal allocation unit */ int32_t slab_alloc_minimal; - /* Growth factor, each subsecuent unit size is factor * prev unit size */ + /* Growth factor, each subsequent unit size is factor * prev unit size */ double slab_alloc_factor; /* working directory (daemon will chdir(2) to it) */ @@ -44,16 +47,16 @@ typedef struct tarantool_cfg { /* * logger command will be executed via /bin/sh -c {} - * example: 'exec cronolog /var/log/taranul/%Y-%m/%Y-%m-%d/tarantool.log' - * example: 'exec extra/logger.pl /var/log/taranul/tarantool.log' + * example: 'exec cronolog /var/log/tarantool/%Y-%m/%Y-%m-%d/tarantool.log' + * example: 'exec extra/logger.pl /var/log/tarantool/tarantool.log' * when logger is not configured all logging going to STDERR */ char* logger; - /* make logging nonblocking, this potentially can loss some logging data */ + /* make logging nonblocking, this potentially can lose some logging data */ int32_t logger_nonblock; - /* delay between loop iteraions */ + /* delay between loop iterations */ double io_collect_interval; /* size of listen backlog */ diff --git a/doc/user/CMakeLists.txt b/doc/user/CMakeLists.txt index d6059029be..b48472a876 100644 --- a/doc/user/CMakeLists.txt +++ b/doc/user/CMakeLists.txt @@ -1,9 +1,28 @@ add_custom_target(html ALL - COMMAND ${XSLTPROC} + COMMAND ${XSLTPROC} --nonet --stringparam collect.xref.targets "all" --xinclude -o tarantool_user_guide.html tnt-html.xsl user.xml) + +add_custom_target(relink + COMMAND ${XSLTPROC} --nonet + --stringparam collect.xref.targets "only" + --xinclude -o tarantool_user_guide.html + tnt-html.xsl + user.xml) + +add_custom_target(html-saxon + COMMAND java -cp "/usr/share/java/saxon.jar:/usr/share/java/xml-commons-resolver-1.1.jar:/usr/share/java/docbook-xsl-saxon.jar:/usr/share/java/xercesImpl.jar:/etc/xml/resolver:/usr/share/java/xslthl.jar" + -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl + -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl + -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration + com.icl.saxon.StyleSheet + -x org.apache.xml.resolver.tools.ResolvingXMLReader + -y org.apache.xml.resolver.tools.ResolvingXMLReader + -r org.apache.xml.resolver.tools.CatalogResolver + -u -o tarantool_user_guide.html user.xml tnt-html.xsl) + # XMLLINT is not able to validate SCHEMATRON constraints, and # therefore is not a good validation tool for DocBook 5. However, # it can validate the entire document, following xinclude diff --git a/doc/user/configuration-reference.xml b/doc/user/configuration-reference.xml index 091567780c..0aae2c2488 100644 --- a/doc/user/configuration-reference.xml +++ b/doc/user/configuration-reference.xml @@ -3,6 +3,7 @@ %tnt; ]> <chapter xmlns="http://docbook.org/ns/docbook" version="5.0" + xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="configuration-reference"> @@ -206,6 +207,14 @@ lsn:4 tm:1301572313.691 t:65534 127.0.0.1:52728 UPDATE_FIELDS n:0flags:00000000 <para> Not all configuration file settings are changeable at runtime: such settings will be highlighted in this reference. + If the same setting is given more than once, the latest occurrence + takes effect. + You can always invoke <emphasis role="tntadmin" + xlink:href="tarantool-user-guide#show-configuration" + xlink:title="show configuration" + xlink:role="http://docbook.org/xlink/role/olink">show + configuration</emphasis> from the administrative + console to show the current configuration. </para> <para> Tarantool maintains a set of all allowed configuration @@ -362,6 +371,85 @@ tarantool: box:primary@sessions pri:33013 sec:33014 adm:33015</programlisting> </tgroup> </table> + <table frame='all'> + <title>Configuring the storage</title> + <tgroup cols='6' colsep='1' rowsep='1'> + + <thead> + <row> + <entry>Name</entry> + <entry>Type</entry> + <entry>Default</entry> + <entry>Required?</entry> + <entry>Dynamic?</entry> + <entry>Description</entry> + </row> + </thead> + + <tbody> + + <row> + <entry>slab_alloc_arena</entry> + <entry>float</entry> + <entry>1.0</entry> + <entry>no</entry> + <entry>no</entry> + <entry>How much memory Tarantool allocates to actually + store tuples, <emphasis role="strong">in + gigabytes</emphasis>. When the limit is reached, INSERT + or UPDATE requests begin failing with error + ERR_CODE_MEMORY_ISSUE. While the server does not go + beyond the defined limit to allocate tuples, there is + additional memory used to store indexes and connection + information. Depending on actual configuration and + workload, Tarantool can consume up to 20-40% of the + limit set here.</entry> + </row> + + <row> + <entry>slab_alloc_minimal</entry> + <entry>integer</entry> + <entry>64</entry> + <entry>no</entry> + <entry>no</entry> + <entry>Size of the smallest allocation unit. It can be + tuned down if most of the tuples are very small.</entry> + </row> + + <row> + <entry>slab_alloc_factor</entry> + <entry>float</entry> + <entry>2.0</entry> + <entry>no</entry> + <entry>no</entry> + <entry>Use slab_alloc_factor as the multiplier for + computing the sizes of memory chunks that tuples are + stored in. A lower value may result in less wasted + memory depending on the total amount of memory available + and the distribution of item sizes.</entry> + </row> + + <row> + <entry>namespace</entry> + <entry>array of objects</entry> + <entry>none</entry> + <entry><emphasis role="strong">yes</emphasis></entry> + <entry><emphasis role="strong">no</emphasis></entry> + <entry>This is the main Tarantool parameter, describing + the data structure that users get access to via + client/server protocol. It holds an array of + entries, and each entry represents a tuple set + served by the server. Every entry is a composite object, + best seen as a C programming language "struct" + <footnote><xi:include href="namespace.xml"/></footnote>. + </entry> + </row> + + + </tbody> + </tgroup> + </table> + <!-- Storage parameters. @@ -370,33 +458,6 @@ Storage parameters. ## BOX -# Size of slab arena in GiBs -slab_alloc_arena=1.0, ro -# Size of minimal allocation unit -slab_alloc_minimal=64, ro -# Growth factor, each subsecuent unit size is factor * prev unit size -slab_alloc_factor=2.0, ro - -namespace = [ - { - enabled = -1, required - cardinality = -1 - estimated_rows = 0 - index = [ - { - type = "", required - unique = -1, required - key_field = [ - { - fieldno = -1, required - type = "", required - }, ro, required - ], required - }, ro, required - ], required - }, ro -], ro, required - # panic if where is error reading snap or wal # be default panic any snapshot reading error and ignore errors then reading wals panic_on_snap_error=1, ro diff --git a/doc/user/html-highlight.xsl b/doc/user/html-highlight.xsl new file mode 100644 index 0000000000..30943c01d8 --- /dev/null +++ b/doc/user/html-highlight.xsl @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="ASCII"?> +<!--This file was created automatically by html2xhtml--> +<!--from the HTML stylesheets.--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook" +xmlns:xslthl="http://xslthl.sf.net" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xslthl d" version="1.0"> + +<!-- ******************************************************************** + $Id: highlight.xsl 8419 2009-04-29 20:37:52Z kosek $ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://docbook.sf.net/release/xsl/current/ for + and other information. + + ******************************************************************** --> + +<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/highlighting/common.xsl"/> + +<xsl:template match="xslthl:keyword" mode="xslthl"> + <b class="hl-keyword"><xsl:apply-templates mode="xslthl"/></b> +</xsl:template> + +<xsl:template match="xslthl:string" mode="xslthl"> + <b class="hl-string"><i style="color:red"><xsl:apply-templates mode="xslthl"/></i></b> +</xsl:template> + +<xsl:template match="xslthl:comment" mode="xslthl"> + <i class="hl-comment" style="color: blue"><xsl:apply-templates mode="xslthl"/></i> +</xsl:template> + +<xsl:template match="xslthl:directive" mode="xslthl"> + <span class="hl-directive" style="color: maroon"><xsl:apply-templates mode="xslthl"/></span> +</xsl:template> + +<xsl:template match="xslthl:tag" mode="xslthl"> + <b class="hl-tag" style="color: #000096"><xsl:apply-templates mode="xslthl"/></b> +</xsl:template> + +<xsl:template match="xslthl:attribute" mode="xslthl"> + <span class="hl-attribute" style="color: #F5844C"><xsl:apply-templates mode="xslthl"/></span> +</xsl:template> + +<xsl:template match="xslthl:value" mode="xslthl"> + <span class="hl-value" style="color: #993300"><xsl:apply-templates mode="xslthl"/></span> +</xsl:template> + +<xsl:template match="xslthl:html" mode="xslthl"> + <b><i style="color: red"><xsl:apply-templates mode="xslthl"/></i></b> +</xsl:template> + +<xsl:template match="xslthl:xslt" mode="xslthl"> + <b style="color: #0066FF"><xsl:apply-templates mode="xslthl"/></b> +</xsl:template> + +<!-- Not emitted since XSLTHL 2.0 --> +<xsl:template match="xslthl:section" mode="xslthl"> + <b><xsl:apply-templates mode="xslthl"/></b> +</xsl:template> + +<xsl:template match="xslthl:number" mode="xslthl"> + <span class="hl-number"><xsl:apply-templates mode="xslthl"/></span> +</xsl:template> + +<xsl:template match="xslthl:annotation" mode="xslthl"> + <i><span class="hl-annotation" style="color: gray"><xsl:apply-templates mode="xslthl"/></span></i> +</xsl:template> + +<!-- Not sure which element will be in final XSLTHL 2.0 --> +<xsl:template match="xslthl:doccomment|xslthl:doctype" mode="xslthl"> + <b class="hl-tag" style="color: blue"><xsl:apply-templates mode="xslthl"/></b> +</xsl:template> + +</xsl:stylesheet> diff --git a/doc/user/language-reference.xml b/doc/user/language-reference.xml index 89036005ff..5e29a3c843 100644 --- a/doc/user/language-reference.xml +++ b/doc/user/language-reference.xml @@ -70,9 +70,23 @@ --> <section> <title>Administrative console</title> - <para>YAML output. Provide command reference</para> + <para> + The administrative console uses a simple text protocol, so you + can connect to it using any <command>telnet</command> client, + or a tool like <command>rlwrap</command>, if access to + readline features is desired. Additionally, Tarantool features + its own Python-based client, located in directory <filename>test</filename>, <command>tarantool</command>. + Tarantool replies to administrative command in YAML. + </para> + <para><emphasis xml:id="reload-configuration" role="tntadmin">reload - configuration</emphasis></para> + configuration</emphasis>Re-read the configuration file. If the + file contains changes to dynamic parameters, update the runtime + settings. If configuration syntax is incorrect, or a read-only parameter is changed, produce an error and do nothing.</para> + <para><emphasis xml:id="show-configuration" role="tntadmin">show + configuration</emphasis> Show the current settings. Displays all + settings, including those that have default values and thus are + not necessarily present in the configuration file.</para> </section> </chapter> diff --git a/doc/user/namespace.xml b/doc/user/namespace.xml new file mode 100644 index 0000000000..ef4b25d630 --- /dev/null +++ b/doc/user/namespace.xml @@ -0,0 +1,89 @@ +<para xmlns="http://docbook.org/ns/docbook" version="5.0" + xmlns:xi="http://www.w3.org/2001/XInclude" + xmlns:xlink="http://www.w3.org/1999/xlink" + xml:id="namespace"> +<bridgehead>Namespace settings explained</bridgehead> +Namespace is a composite setting, i.e. it has a number +of properties. +<programlisting language="cpp"> +/* + * Each tuple consists of fields. Three field types are + * supported. + */ + +enum { STR, NUM, NUM64 } field_type; + +/* + * Tarantool is interested in field types only inasmuch as + * it needs to build indexes on fields. An index + * can cover one or more fields. + */ + +struct index_field_t { + unsigned int fieldno; + enum field_type type; +}; + +/* + * HASH and TREE index types are supported. + */ + +enum { HASH, TREE } index_type; + +struct index_t { + + enum index_type type; + bool unique; + index_field_t key_field[]; +}; + +struct namespace_t +{ + /* A namespace can be quickly disabled and re-enabled at run time. */ + bool enabled; + /* + * A limit on tuple cardinality can be set, to prevent too large tuples + * from coming in. + */ + unsigned int cardinality; + /* Only used for HASH indexes, to preallocate memory. */ + unsigned int estimated_rows; + struct index_t index[]; +}; + +/* You can define up to 255 namespaces. */ +struct namespace_t namespace[]; +</programlisting> +The way a namespace is defined in a configuration file is similar to how +you would initialize a C structure in a program. For example, +a minimal storage configuration looks like below: +<programlisting language="c"> +namespace[0].enabled = 1 +namespace[0].index[0].type = HASH +namespace[0].index[0].key_field[0].fieldno = 0 +namespace[0].index[0].key_field[0].type = NUM64 +</programlisting> +Other namespace properties are set in the same way. +When defining a namespace, please be aware of these restrictions: +<itemizedlist> + <listitem><simpara>at least one namespace must be + configured,</simpara></listitem> + <listitem><simpara>each configured namespace needs at least one + unique index of type HASH, + </simpara></listitem> + <listitem><simpara>"unique" property doesn't have a default, and + must be set explicitly, + </simpara></listitem> + <listitem><simpara>namespace configuration can not be changed + dynamically, currently you need to restart the server even to + disable or enable a namespace, + </simpara></listitem> + <listitem><simpara>HASH indexes may cover only one field and can + not be non-unique. + </simpara></listitem> +</itemizedlist> +</para> +<!-- +vim: tw=66 syntax=docbk +vim: spell spelllang=en_us +--> diff --git a/doc/user/target.db b/doc/user/target.db index 7080cd3db8..0968f9fae8 100644 --- a/doc/user/target.db +++ b/doc/user/target.db @@ -1 +1 @@ -<div element="book" href="#tarantool-user-guide" number="" targetptr="tarantool-user-guide"><ttl>Tarantool/Box User Guide, version 1.4.0-69-g21aaa81</ttl><xreftext>Tarantool/Box User Guide, version 1.4.0-69-g21aaa81</xreftext><div element="chapter" href="#id77162" number="1"><ttl>Preface</ttl><xreftext>Chapter 1, <i>Preface</i></xreftext><div element="section" href="#preface" number="" targetptr="preface"><ttl>Tarantool/Box: an overview</ttl><xreftext>the section called “Tarantool/Box: an overviewâ€</xreftext></div><div element="section" href="#id284163" number=""><ttl>Conventions</ttl><xreftext>the section called “Conventionsâ€</xreftext></div><div element="section" href="#id283612" number=""><ttl>Reporting bugs</ttl><xreftext>the section called “Reporting bugsâ€</xreftext></div></div><div element="chapter" href="#id283358" number="2"><ttl>Getting started</ttl><xreftext>Chapter 2, <i>Getting started</i></xreftext></div><div element="chapter" href="#id285778" number="3"><ttl>Dynamic data model</ttl><xreftext>Chapter 3, <i>Dynamic data model</i></xreftext></div><div element="chapter" href="#language-reference" number="4" targetptr="language-reference"><ttl>Language reference</ttl><xreftext>Chapter 4, <i>Language reference</i></xreftext><div element="section" href="#id286284" number=""><ttl>Administrative console</ttl><xreftext>the section called “Administrative consoleâ€</xreftext><obj element="emphasis" href="#reload-configuration" number="" targetptr="reload-configuration"><ttl>???TITLE???</ttl><xreftext>???</xreftext></obj></div></div><div element="chapter" href="#configuration-reference" number="5" targetptr="configuration-reference"><ttl>Configuration reference</ttl><xreftext>Chapter 5, <i>Configuration reference</i></xreftext><div element="section" href="#id286637" number=""><ttl>Command line options</ttl><xreftext>the section called “Command line optionsâ€</xreftext><obj element="listitem" href="#help-option" number="" targetptr="help-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#version-option" number="" targetptr="version-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#config-option" number="" targetptr="config-option"><ttl>???TITLE???</ttl><xreftext/></obj></div><div element="section" href="#id286190" number=""><ttl>The option file</ttl><xreftext>the section called “The option fileâ€</xreftext></div></div></div> +<div element="book" href="#tarantool-user-guide" number="" targetptr="tarantool-user-guide"><ttl>Tarantool/Box User Guide, version 1.4.1-29-gde07102</ttl><xreftext>Tarantool/Box User Guide, version 1.4.1-29-gde07102</xreftext><div element="chapter" href="#id286512" number="1"><ttl>Preface</ttl><xreftext>Chapter 1, <i>Preface</i></xreftext><div element="section" href="#preface" number="" targetptr="preface"><ttl>Tarantool/Box: an overview</ttl><xreftext>the section called “Tarantool/Box: an overviewâ€</xreftext></div><div element="section" href="#id285445" number=""><ttl>Conventions</ttl><xreftext>the section called “Conventionsâ€</xreftext></div><div element="section" href="#id285520" number=""><ttl>Reporting bugs</ttl><xreftext>the section called “Reporting bugsâ€</xreftext></div></div><div element="chapter" href="#id285410" number="2"><ttl>Getting started</ttl><xreftext>Chapter 2, <i>Getting started</i></xreftext></div><div element="chapter" href="#id287670" number="3"><ttl>Dynamic data model</ttl><xreftext>Chapter 3, <i>Dynamic data model</i></xreftext></div><div element="chapter" href="#language-reference" number="4" targetptr="language-reference"><ttl>Language reference</ttl><xreftext>Chapter 4, <i>Language reference</i></xreftext><div element="section" href="#id288016" number=""><ttl>Administrative console</ttl><xreftext>the section called “Administrative consoleâ€</xreftext><obj element="emphasis" href="#reload-configuration" number="" targetptr="reload-configuration"><ttl>???TITLE???</ttl><xreftext>???</xreftext></obj><obj element="emphasis" href="#show-configuration" number="" targetptr="show-configuration"><ttl>???TITLE???</ttl><xreftext>???</xreftext></obj></div></div><div element="chapter" href="#configuration-reference" number="5" targetptr="configuration-reference"><ttl>Configuration reference</ttl><xreftext>Chapter 5, <i>Configuration reference</i></xreftext><div element="section" href="#id285844" number=""><ttl>Command line options</ttl><xreftext>the section called “Command line optionsâ€</xreftext><obj element="listitem" href="#help-option" number="" targetptr="help-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#version-option" number="" targetptr="version-option"><ttl>???TITLE???</ttl><xreftext/></obj><obj element="listitem" href="#config-option" number="" targetptr="config-option"><ttl>???TITLE???</ttl><xreftext/></obj></div><div element="section" href="#id289585" number=""><ttl>The option file</ttl><xreftext>the section called “The option fileâ€</xreftext><obj element="table" href="#id289684" number="5.1"><ttl>Basic parameters</ttl><xreftext>Table 5.1, “Basic parametersâ€</xreftext></obj><obj element="table" href="#id290026" number="5.2"><ttl>Configuring the storage</ttl><xreftext>Table 5.2, “Configuring the storageâ€</xreftext></obj><obj element="para" href="#namespace" number="" targetptr="namespace"><ttl>???TITLE???</ttl><xreftext>the section called “The option fileâ€</xreftext></obj><obj element="table" href="#id290263" number="5.3"><ttl>Logging</ttl><xreftext>Table 5.3, “Loggingâ€</xreftext></obj><obj element="table" href="#id290450" number="5.4"><ttl>Memcached protocol support</ttl><xreftext>Table 5.4, “Memcached protocol supportâ€</xreftext></obj></div></div></div> diff --git a/doc/user/tnt-html.xsl b/doc/user/tnt-html.xsl index 107ef6681c..acb58dd99c 100644 --- a/doc/user/tnt-html.xsl +++ b/doc/user/tnt-html.xsl @@ -1,9 +1,14 @@ <?xml version='1.0'?> <xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:xslthl="http://xslthl.sf.net"> <xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/html/docbook.xsl"/> +<xsl:import href="html-highlight.xsl"/> + <xsl:param name="html.stylesheet" select="'tnt.css'"/> +<xsl:param name="highlight.source" select="1"/> +<xsl:param name="highlight.xslthl.config">file:////usr/share/xml/docbook/stylesheet/docbook-xsl-ns/highlighting/xslthl-config.xml</xsl:param> </xsl:stylesheet> diff --git a/doc/user/tnt.css b/doc/user/tnt.css index fbf0df02eb..28bf7088da 100644 --- a/doc/user/tnt.css +++ b/doc/user/tnt.css @@ -4,3 +4,13 @@ text-transform: uppercase; color: green; } + +.hl-keyword { + color: green; + font-weight: bold; +} + +.hl-comment{ + color: blue; + font-weight: bold; +} diff --git a/include/errcode.h b/include/errcode.h index 71d239557a..220cee4b7a 100644 --- a/include/errcode.h +++ b/include/errcode.h @@ -72,7 +72,7 @@ struct errcode_record { /* 53 */_(ERR_CODE_UNUSED53, 0, "Unused53") \ /* 54 */_(ERR_CODE_UNUSED54, 0, "Unused54") \ /* 55 */_(ERR_CODE_NODE_FOUND, 2, "Node is found") \ - /* 56 */_(ERR_CODE_INDEX_VIOLATION, 2, "Some index violation occur") \ + /* 56 */_(ERR_CODE_INDEX_VIOLATION, 2, "Constraint violation") \ /* 57 */_(ERR_CODE_NO_SUCH_NAMESPACE, 2, "There is no such namespace") \ _(ERR_CODE_NO_SUCH_INDEX, 2, "No index with the given id is defined") diff --git a/mod/box/box.m b/mod/box/box.m index 357030487e..16b1674bb1 100644 --- a/mod/box/box.m +++ b/mod/box/box.m @@ -1067,7 +1067,7 @@ custom_init(void) before_commit_update_hook = calloc(1, sizeof(box_hook_t)); if (cfg.namespace == NULL) - panic("at least one namespace should be configured"); + panic("at least one namespace must be configured"); for (int i = 0; i < namespace_count; i++) { if (cfg.namespace[i] == NULL) @@ -1163,7 +1163,7 @@ custom_init(void) if (strcmp(cfg.namespace[i]->index[j]->type, "HASH") == 0) { if (index->key_cardinality != 1) panic("(namespace = %" PRIu32 " index = %" PRIu32 ") " - "hash index must have single-filed key", i, j); + "hash index must have a single-field key", i, j); if (index->unique == false) panic("(namespace = %" PRIu32 " index = %" PRIu32 ") " diff --git a/mod/box/index.m b/mod/box/index.m index 3267729430..df74b4d2b2 100644 --- a/mod/box/index.m +++ b/mod/box/index.m @@ -490,7 +490,7 @@ validate_indexes(struct box_txn *txn) if (tuple != NULL && tuple != txn->old_tuple) tnt_raise(tnt_BoxException, - reason:"unique index violation" + reason:"duplicate key in a unique index" errcode:ERR_CODE_INDEX_VIOLATION); } } -- GitLab