You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2011/01/05 16:44:45 UTC

[jira] Created: (CASSANDRA-1937) Keep partitioned counters ("contexts") sorted

Keep partitioned counters ("contexts") sorted
---------------------------------------------

                 Key: CASSANDRA-1937
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1937
             Project: Cassandra
          Issue Type: Improvement
          Components: Core
            Reporter: Sylvain Lebresne
            Assignee: Sylvain Lebresne
             Fix For: 0.8


In the value of CounterColumns, the code keep the subpart unsorted, but sort
them 'on the fly' when needed (in diff() and merge()). It will be more
efficient to keep the parts always sorted (it will also be easier in that it
will remove the need of the ad-hoc in-place quicksort in CounterContext).

NOTE: this breaks the on-disk file format (for counters)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-1937) Keep partitioned counters ("contexts") sorted

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12979986#action_12979986 ] 

Sylvain Lebresne commented on CASSANDRA-1937:
---------------------------------------------

Looks good to me, thanks

> Keep partitioned counters ("contexts") sorted
> ---------------------------------------------
>
>                 Key: CASSANDRA-1937
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1937
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.8
>
>         Attachments: 0001-Keep-counter-partitioned-context-sorted.patch, CASSANDRA-1937-ALT-0001.patch
>
>   Original Estimate: 4h
>          Time Spent: 4h
>  Remaining Estimate: 0h
>
> In the value of CounterColumns, the code keep the subpart unsorted, but sort
> them 'on the fly' when needed (in diff() and merge()). It will be more
> efficient to keep the parts always sorted (it will also be easier in that it
> will remove the need of the ad-hoc in-place quicksort in CounterContext).
> NOTE: this breaks the on-disk file format (for counters)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-1937) Keep partitioned counters ("contexts") sorted

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980229#action_12980229 ] 

Hudson commented on CASSANDRA-1937:
-----------------------------------

Integrated in Cassandra #665 (See [https://hudson.apache.org/hudson/job/Cassandra/665/])
    

> Keep partitioned counters ("contexts") sorted
> ---------------------------------------------
>
>                 Key: CASSANDRA-1937
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1937
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.8
>
>         Attachments: 0001-Keep-counter-partitioned-context-sorted.patch, CASSANDRA-1937-ALT-0001.patch
>
>   Original Estimate: 4h
>          Time Spent: 4h
>  Remaining Estimate: 0h
>
> In the value of CounterColumns, the code keep the subpart unsorted, but sort
> them 'on the fly' when needed (in diff() and merge()). It will be more
> efficient to keep the parts always sorted (it will also be easier in that it
> will remove the need of the ad-hoc in-place quicksort in CounterContext).
> NOTE: this breaks the on-disk file format (for counters)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-1937) Keep partitioned counters ("contexts") sorted

Posted by "Kelvin Kakugawa (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kelvin Kakugawa updated CASSANDRA-1937:
---------------------------------------

    Attachment: CASSANDRA-1937-ALT-0001.patch

The logic refactor looks good.

Fixed an edge case in the attached patch.  In merge(), we don't check whether the right offset exceeds the right length.

> Keep partitioned counters ("contexts") sorted
> ---------------------------------------------
>
>                 Key: CASSANDRA-1937
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1937
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.8
>
>         Attachments: 0001-Keep-counter-partitioned-context-sorted.patch, CASSANDRA-1937-ALT-0001.patch
>
>   Original Estimate: 4h
>          Time Spent: 4h
>  Remaining Estimate: 0h
>
> In the value of CounterColumns, the code keep the subpart unsorted, but sort
> them 'on the fly' when needed (in diff() and merge()). It will be more
> efficient to keep the parts always sorted (it will also be easier in that it
> will remove the need of the ad-hoc in-place quicksort in CounterContext).
> NOTE: this breaks the on-disk file format (for counters)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CASSANDRA-1937) Keep partitioned counters ("contexts") sorted

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-1937:
----------------------------------------

    Attachment: 0001-Keep-counter-partitioned-context-sorted.patch

Patch attached. Most notable change: thanks to the sorting, I rewrote CounterContext.merge() to avoid creating a hashmap and thus keep garbage to a minimum.

> Keep partitioned counters ("contexts") sorted
> ---------------------------------------------
>
>                 Key: CASSANDRA-1937
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1937
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.8
>
>         Attachments: 0001-Keep-counter-partitioned-context-sorted.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> In the value of CounterColumns, the code keep the subpart unsorted, but sort
> them 'on the fly' when needed (in diff() and merge()). It will be more
> efficient to keep the parts always sorted (it will also be easier in that it
> will remove the need of the ad-hoc in-place quicksort in CounterContext).
> NOTE: this breaks the on-disk file format (for counters)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-1937) Keep partitioned counters ("contexts") sorted

Posted by "Kelvin Kakugawa (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977953#action_12977953 ] 

Kelvin Kakugawa commented on CASSANDRA-1937:
--------------------------------------------

Definitely agree.  I made the trade-off to keep them in update order.  i.e. the order in which the node was last updated.  However, keeping them in node id sorted order did cross my mind.

> Keep partitioned counters ("contexts") sorted
> ---------------------------------------------
>
>                 Key: CASSANDRA-1937
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1937
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.8
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> In the value of CounterColumns, the code keep the subpart unsorted, but sort
> them 'on the fly' when needed (in diff() and merge()). It will be more
> efficient to keep the parts always sorted (it will also be easier in that it
> will remove the need of the ad-hoc in-place quicksort in CounterContext).
> NOTE: this breaks the on-disk file format (for counters)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.