hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ChiaPing Tsai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-12931) The existing KeyValues in memstroe are not removed completely after inserting cell into memStore
Date Fri, 30 Jan 2015 12:44:34 GMT

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

ChiaPing Tsai commented on HBASE-12931:
---------------------------------------

Sorry for my improper test. Now it's amended as following:

{code:title=Bar.java|borderStyle=solid}
    Configuration conf = HBaseConfiguration.create();
    memstore = new DefaultMemStore(conf, KeyValue.COMPARATOR);
    
    List<Cell> l = new ArrayList<Cell>();
    KeyValue kv1 = KeyValueTestUtil.create("r", "f", "q", 100, "v");
    KeyValue kv2 = KeyValueTestUtil.create("r", "f", "q", 101, "v");
    KeyValue kv3 = KeyValueTestUtil.create("r", "f", "q", 102, "v");

    kv1.setSequenceId(1); kv2.setSequenceId(1);kv3.setSequenceId(3);
    l.add(kv1); l.add(kv2); l.add(kv3);
    
    memstore.upsert(l, 2);
    assert(memstore.cellSet.size() == 2);
{code}
The scenario is the kv2 should be seen by scanner and the kv1 should be removed. (the max
version for this CF is 1)
So I think that the size of cellSet should be 2. Did I say it right? Thanks again.

> The existing KeyValues in memstroe are not removed completely after inserting cell into
memStore 
> -------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-12931
>                 URL: https://issues.apache.org/jira/browse/HBASE-12931
>             Project: HBase
>          Issue Type: Bug
>            Reporter: ChiaPing Tsai
>            Priority: Minor
>
> If I'm not wrong, the UPSERT method of memStore should remove all existing KeyValues
except the newer version.
> In memStore,
> {code:title=DefaultMemStore.java|borderStyle=solid}
> int versIionsVisible = 0;
> ...
> if (cur.getTypeByte() == KeyValue.Type.Put.getCode() &&
>             cur.getSequenceId() <= readpoint) {
>           if (versionsVisible > 1) {
>             // if we get here we have seen at least one version visible to the oldest
scanner,
>             // which means we can prove that no scanner will see this version
>             // false means there was a change, so give us the size.
>             long delta = heapSizeChange(cur, true);
>             addedSize -= delta;
>             this.size.addAndGet(-delta);
>             it.remove();
>             setOldestEditTimeToNow();
>           } else {
>             versionsVisible++;
>           }
> {code}
> Does "versionsVisible > 1" should be changed to "versionsVisible >= 1" ?
> thanks.



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

Mime
View raw message