[ 
https://issues.apache.org/jira/browse/HBASE-14468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vladimir Rodionov updated HBASE-14468:
--------------------------------------
    Description: 
h2. FIFO Compaction

h3. Introduction
FIFO compaction policy selects only files which have all cells expired. The 
column family MUST have non-default TTL. One of the use cases for this policy 
is when we need to store raw data which will be post-processed later and 
discarded completely after quite short period of time. Raw time-series vs. 
time-based rollup aggregates and compacted time-series. We collect raw 
time-series and store them into CF with FIFO compaction policy, periodically we 
run  task which creates rollup aggregates and compacts time-series, the 
original raw data can be discarded after that.

See: https://github.com/facebook/rocksdb/wiki/FIFO-compaction-style

h3. To enable FIFO compaction policy

For table:
{code}
HTableDescriptor desc = new HTableDescriptor(tableName);
    
desc.setConfiguration(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY, 
      FIFOCompactionPolicy.class.getName());
{code} 

For CF:
{code}
HColumnDescriptor desc = new HColumnDescriptor(family);
    
desc.setConfiguration(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY, 
      FIFOCompactionPolicy.class.getName());
{code}

h3. Limitations

Do not use FIFO compaction if :
* table/CF has MIN_VERSION > 0
* table/CF has TTL = FOREVER (HColumnDescriptor.DEFAULT_TTL)
* Table/CF is MOB 



  was:
FIFO compaction policy selects only files which have all cells expired. The 
column family MUST have non-default TTL. One of the use cases for this policy 
is when we need to store raw data which will be post-processed later and 
discarded completely after quite short period of time. Raw time-series vs. 
time-based rollup aggregates and compacted time-series. We collect raw 
time-series and store them into CF with FIFO compaction policy, periodically we 
run  task which creates rollup aggregates and compacts time-series, the 
original raw data can be discarded after that.

See: https://github.com/facebook/rocksdb/wiki/FIFO-compaction-style


> Compaction improvements: FIFO compaction policy
> -----------------------------------------------
>
>                 Key: HBASE-14468
>                 URL: https://issues.apache.org/jira/browse/HBASE-14468
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Vladimir Rodionov
>            Assignee: Vladimir Rodionov
>             Fix For: 2.0.0
>
>         Attachments: HBASE-14468-v1.patch, HBASE-14468-v2.patch
>
>
> h2. FIFO Compaction
> h3. Introduction
> FIFO compaction policy selects only files which have all cells expired. The 
> column family MUST have non-default TTL. One of the use cases for this policy 
> is when we need to store raw data which will be post-processed later and 
> discarded completely after quite short period of time. Raw time-series vs. 
> time-based rollup aggregates and compacted time-series. We collect raw 
> time-series and store them into CF with FIFO compaction policy, periodically 
> we run  task which creates rollup aggregates and compacts time-series, the 
> original raw data can be discarded after that.
> See: https://github.com/facebook/rocksdb/wiki/FIFO-compaction-style
> h3. To enable FIFO compaction policy
> For table:
> {code}
> HTableDescriptor desc = new HTableDescriptor(tableName);
>     
> desc.setConfiguration(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY, 
>       FIFOCompactionPolicy.class.getName());
> {code} 
> For CF:
> {code}
> HColumnDescriptor desc = new HColumnDescriptor(family);
>     
> desc.setConfiguration(DefaultStoreEngine.DEFAULT_COMPACTION_POLICY_CLASS_KEY, 
>       FIFOCompactionPolicy.class.getName());
> {code}
> h3. Limitations
> Do not use FIFO compaction if :
> * table/CF has MIN_VERSION > 0
> * table/CF has TTL = FOREVER (HColumnDescriptor.DEFAULT_TTL)
> * Table/CF is MOB 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to