Repository: hbase Updated Branches: refs/heads/branch-2.0 586f1ea0e -> 89e977dbc
HBASE-20299 Update MOB in hbase refguide Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/89e977db Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/89e977db Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/89e977db Branch: refs/heads/branch-2.0 Commit: 89e977dbc3cfd4e61f2e5fc26d7b4d5e8a7cc0b1 Parents: 586f1ea Author: Huaxiang Sun <[email protected]> Authored: Tue Apr 3 13:12:45 2018 -0700 Committer: Huaxiang Sun <[email protected]> Committed: Tue Apr 3 13:29:40 2018 -0700 ---------------------------------------------------------------------- src/main/asciidoc/_chapters/hbase_mob.adoc | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/89e977db/src/main/asciidoc/_chapters/hbase_mob.adoc ---------------------------------------------------------------------- diff --git a/src/main/asciidoc/_chapters/hbase_mob.adoc b/src/main/asciidoc/_chapters/hbase_mob.adoc index 5da0343..9730529 100644 --- a/src/main/asciidoc/_chapters/hbase_mob.adoc +++ b/src/main/asciidoc/_chapters/hbase_mob.adoc @@ -46,6 +46,12 @@ configure the MOB file reader's cache settings for each RegionServer (see Client code does not need to change to take advantage of HBase MOB support. The feature is transparent to the client. +MOB compaction + +MOB data is flushed into MOB files after MemStore flush. There will be lots of MOB files +after some time. To reduce MOB file count, there is a periodic task which compacts +small MOB files into a large one (MOB compaction). + === Configuring Columns for MOB You can configure columns to support MOB during table creation or alteration, @@ -75,6 +81,42 @@ hcd.setMobThreshold(102400L); ---- ==== +=== Configure MOB Compaction Policy + +By default, MOB files for one specific day are compacted into one large MOB file. +To reduce MOB file count more, there are other MOB Compaction policies supported. + +daily policy - compact MOB Files for one day into one large MOB file (default policy) +weekly policy - compact MOB Files for one week into one large MOB file +montly policy - compact MOB Files for one month into one large MOB File + +.Configure MOB compaction policy Using HBase Shell +==== +---- +hbase> create 't1', {NAME => 'f1', IS_MOB => true, MOB_THRESHOLD => 102400, MOB_COMPACT_PARTITION_POLICY => 'daily'} +hbase> create 't1', {NAME => 'f1', IS_MOB => true, MOB_THRESHOLD => 102400, MOB_COMPACT_PARTITION_POLICY => 'weekly'} +hbase> create 't1', {NAME => 'f1', IS_MOB => true, MOB_THRESHOLD => 102400, MOB_COMPACT_PARTITION_POLICY => 'monthly'} + +hbase> alter 't1', {NAME => 'f1', IS_MOB => true, MOB_THRESHOLD => 102400, MOB_COMPACT_PARTITION_POLICY => 'daily'} +hbase> alter 't1', {NAME => 'f1', IS_MOB => true, MOB_THRESHOLD => 102400, MOB_COMPACT_PARTITION_POLICY => 'weekly'} +hbase> alter 't1', {NAME => 'f1', IS_MOB => true, MOB_THRESHOLD => 102400, MOB_COMPACT_PARTITION_POLICY => 'monthly'} +---- +==== + +=== Configure MOB Compaction mergeable threshold + +If the size of a mob file is less than this value, it's regarded as a small file and needs to +be merged in mob compaction. The default value is 1280MB. + +==== +[source,xml] +---- +<property> + <name>hbase.mob.compaction.mergeable.threshold</name> + <value>10000000000</value> +</property> +---- +==== === Testing MOB
