HBASE-11784 Document global configuration for maxVersion
This commit is contained in:
parent
1f1a2c514e
commit
d93b5ce04f
@ -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">
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user