From d93b5ce04f245bb482b4b911fa3554adf39bd852 Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Tue, 16 Sep 2014 13:04:28 +1000 Subject: [PATCH] HBASE-11784 Document global configuration for maxVersion --- src/main/docbkx/book.xml | 31 +++++++++++++++++++++++++++++++ src/main/docbkx/schema_design.xml | 11 ++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/main/docbkx/book.xml b/src/main/docbkx/book.xml index b8247b90ac2..50aa0d9caf3 100644 --- a/src/main/docbkx/book.xml +++ b/src/main/docbkx/book.xml @@ -652,6 +652,37 @@ try { Overwriting values at existing timestamps mentioned in the article no longer holds in HBase. This section is basically a synopsis of this article by Bruno Dumon. + +
+ Specifying the Number of Versions to Store + 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 alter command, via + HColumnDescriptor.DEFAULT_VERSIONS. Prior to HBase 0.96, the default number + of versions kept was 3, but in 0.96 and newer has been changed to + 1. + + Modify the Maximum Number of Versions for a Column + This example uses HBase Shell to keep a maximum of 5 versions of column + f1. You could also use HColumnDescriptor. + alter ‘t1′, NAME => ‘f1′, VERSIONS => 5]]> + + + Modify the Minimum Number of Versions for a Column + 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 f1 to 2, via HBase Shell. + You could also use HColumnDescriptor. + alter ‘t1′, NAME => ‘f1′, MIN_VERSIONS => 2]]> + + 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 + in hbase-site.xml. See + . +
diff --git a/src/main/docbkx/schema_design.xml b/src/main/docbkx/schema_design.xml index e4d3baa3cdf..9f3f3504057 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"> Maximum Number of Versions The maximum number of row versions to store is configured per column family via HColumnDescriptor. - The default for max versions is 1. This is an important parameter because as described in section HBase does not overwrite row values, + xlink:href="http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HColumnDescriptor.html" + >HColumnDescriptor. 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 section HBase does not 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. 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. + See for examples for setting the maximum + number of versions on a given column or globally.
@@ -462,6 +465,8 @@ public static byte[][] getHexSplits(String startKey, String endKey, int numRegio around" (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. + See for examples for setting the minimum + number of versions on a given column.