Repository: hbase Updated Branches: refs/heads/branch-1 1f1a2c514 -> d93b5ce04
HBASE-11784 Document global configuration for maxVersion Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d93b5ce0 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d93b5ce0 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d93b5ce0 Branch: refs/heads/branch-1 Commit: d93b5ce04f245bb482b4b911fa3554adf39bd852 Parents: 1f1a2c5 Author: Misty Stanley-Jones <mstanleyjo...@cloudera.com> Authored: Tue Sep 16 13:04:28 2014 +1000 Committer: Misty Stanley-Jones <mstanleyjo...@cloudera.com> Committed: Tue Sep 16 13:04:28 2014 +1000 ---------------------------------------------------------------------- src/main/docbkx/book.xml | 31 +++++++++++++++++++++++++++++++ src/main/docbkx/schema_design.xml | 11 ++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/d93b5ce0/src/main/docbkx/book.xml ---------------------------------------------------------------------- diff --git a/src/main/docbkx/book.xml b/src/main/docbkx/book.xml index b8247b9..50aa0d9 100644 --- a/src/main/docbkx/book.xml +++ b/src/main/docbkx/book.xml @@ -652,6 +652,37 @@ try { <emphasis>Overwriting values at existing timestamps</emphasis> mentioned in the article no longer holds in HBase. This section is basically a synopsis of this article by Bruno Dumon.</para> + + <section xml:id="specify.number.of.versions"> + <title>Specifying the Number of Versions to Store</title> + <para>The maximum number of versions to store for a given column is part of the column + schema and is specified at table creation, or via an <command>alter</command> command, via + <code>HColumnDescriptor.DEFAULT_VERSIONS</code>. Prior to HBase 0.96, the default number + of versions kept was <literal>3</literal>, but in 0.96 and newer has been changed to + <literal>1</literal>.</para> + <example> + <title>Modify the Maximum Number of Versions for a Column</title> + <para>This example uses HBase Shell to keep a maximum of 5 versions of column + <code>f1</code>. You could also use <link + xlink:href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HColumnDescriptor.html" + >HColumnDescriptor</link>.</para> + <screen><![CDATA[hbase> alter ât1â², NAME => âf1â², VERSIONS => 5]]></screen> + </example> + <example> + <title>Modify the Minimum Number of Versions for a Column</title> + <para>You can also specify the minimum number of versions to store. By default, this is + set to 0, which means the feature is disabled. The following example sets the minimum + number of versions on field <code>f1</code> to <literal>2</literal>, via HBase Shell. + You could also use <link + xlink:href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HColumnDescriptor.html" + >HColumnDescriptor</link>.</para> + <screen><![CDATA[hbase> alter ât1â², NAME => âf1â², MIN_VERSIONS => 2]]></screen> + </example> + <para>Starting with HBase 0.98.2, you can specify a global default for the maximum number of + versions kept for all newly-created columns, by setting + <option>hbase.column.max.version</option> in <filename>hbase-site.xml</filename>. See + <xref linkend="hbase.column.max.version"/>.</para> + </section> <section xml:id="versions.ops"> http://git-wip-us.apache.org/repos/asf/hbase/blob/d93b5ce0/src/main/docbkx/schema_design.xml ---------------------------------------------------------------------- diff --git a/src/main/docbkx/schema_design.xml b/src/main/docbkx/schema_design.xml index e4d3baa..9f3f350 100644 --- a/src/main/docbkx/schema_design.xml +++ b/src/main/docbkx/schema_design.xml @@ -439,15 +439,18 @@ public static byte[][] getHexSplits(String startKey, String endKey, int numRegio xml:id="schema.versions.max"> <title>Maximum Number of Versions</title> <para>The maximum number of row versions to store is configured per column family via <link - xlink:href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HColumnDescriptor.html">HColumnDescriptor</link>. - The default for max versions is 1. This is an important parameter because as described in <xref - linkend="datamodel" /> section HBase does <emphasis>not</emphasis> overwrite row values, + xlink:href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HColumnDescriptor.html" + >HColumnDescriptor</link>. The default for max versions is 3 prior to HBase 0.96.x, and 1 + in newer versions. This is an important parameter because as described in <xref + linkend="datamodel"/> section HBase does <emphasis>not</emphasis> overwrite row values, but rather stores different values per row by time (and qualifier). Excess versions are removed during major compactions. The number of max versions may need to be increased or decreased depending on application needs. </para> <para>It is not recommended setting the number of max versions to an exceedingly high level (e.g., hundreds or more) unless those old values are very dear to you because this will greatly increase StoreFile size. </para> + <para>See <xref linkend="specify.number.of.versions"/> for examples for setting the maximum + number of versions on a given column or globally.</para> </section> <section xml:id="schema.minversions"> @@ -462,6 +465,8 @@ public static byte[][] getHexSplits(String startKey, String endKey, int numRegio around</emphasis>" (where M is the value for minimum number of row versions, M<N). This parameter should only be set when time-to-live is enabled for a column family and must be less than the number of row versions. </para> + <para>See <xref linkend="specify.number.of.versions"/> for examples for setting the minimum + number of versions on a given column.</para> </section> </section> <section