[ 
https://issues.apache.org/jira/browse/HBASE-17081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15702133#comment-15702133
 ] 

Eshcar Hillel commented on HBASE-17081:
---------------------------------------

It would be wrong to move the responsibility for the list of segments to 
memstore. Memstore should not be aware of this.
The method getAllSegments() is required since memstore has a public method 
which returns list of all segments.

The CompositeSegment is an implementation of the [composite 
pattern|https://en.wikipedia.org/wiki/Composite_pattern] where ImmutableSegment 
is the component and CompositeSegment is the composite which inherits from 
component and has a collection of components.
To make this pattern complete we need a leaf. 
This means making ImmutableSegment an abstract class, add LeafSegment class to 
inherit from ImmutableSegment. All common code will be in ImmutableSegment, 
while LeafSegment and CompositeSegment implement different behaviour.
Then we can also make the adjustments in SegmentFactory so it creates either 
CompositeSegment or LeafSegment based on the context and parameters (list or a 
single segment).

The use of getAllSegments() within the method getNextRow() is indeed cumbersome 
 but this is due to historical reasons which can be fixed in a different Jira. 
Anyway getAllSegments() method is needed and will not be removed.


> Flush the entire CompactingMemStore content to disk
> ---------------------------------------------------
>
>                 Key: HBASE-17081
>                 URL: https://issues.apache.org/jira/browse/HBASE-17081
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Anastasia Braginsky
>            Assignee: Anastasia Braginsky
>         Attachments: HBASE-17081-V01.patch, HBASE-17081-V02.patch, 
> HBASE-17081-V03.patch, Pipelinememstore_fortrunk_3.patch
>
>
> Part of CompactingMemStore's memory is held by an active segment, and another 
> part is divided between immutable segments in the compacting pipeline. Upon 
> flush-to-disk request we want to flush all of it to disk, in contrast to 
> flushing only tail of the compacting pipeline.



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

Reply via email to