You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2011/09/08 19:45:09 UTC

[jira] [Created] (CASSANDRA-3162) use weak references to SlabAllocator regions

use weak references to SlabAllocator regions
--------------------------------------------

                 Key: CASSANDRA-3162
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3162
             Project: Cassandra
          Issue Type: Improvement
    Affects Versions: 1.0
            Reporter: Jonathan Ellis
            Assignee: Jonathan Ellis
            Priority: Minor
             Fix For: 1.0


Yang points out on CASSANDRA-2252,

"Conceivably, one region would contain bytebuffer values of similar age. as more updates come in, all the columns in older regions are likely to have all died out, thus allowing us to free the entire region before flushing happens."

So it's a bit of a corner case optimization, but easy to do and safe.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3162) use weak references to SlabAllocator regions

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

Jonathan Ellis updated CASSANDRA-3162:
--------------------------------------

    Attachment: 3162.txt

Patch to use a set built on MapMaker.weakKeys.

Also reduces region size to 1MB to make the overhead lower for the "lots of small CFs" use case.

> use weak references to SlabAllocator regions
> --------------------------------------------
>
>                 Key: CASSANDRA-3162
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3162
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.0
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: 3162.txt
>
>
> Yang points out on CASSANDRA-2252,
> "Conceivably, one region would contain bytebuffer values of similar age. as more updates come in, all the columns in older regions are likely to have all died out, thus allowing us to free the entire region before flushing happens."
> So it's a bit of a corner case optimization, but easy to do and safe.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3162) use weak references to SlabAllocator regions

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

Jonathan Ellis commented on CASSANDRA-3162:
-------------------------------------------

But then you have no way of knowing whether to include it in size().

> use weak references to SlabAllocator regions
> --------------------------------------------
>
>                 Key: CASSANDRA-3162
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3162
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.0
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: 3162.txt
>
>
> Yang points out on CASSANDRA-2252,
> "Conceivably, one region would contain bytebuffer values of similar age. as more updates come in, all the columns in older regions are likely to have all died out, thus allowing us to free the entire region before flushing happens."
> So it's a bit of a corner case optimization, but easy to do and safe.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3162) use weak references to SlabAllocator regions

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

Hudson commented on CASSANDRA-3162:
-----------------------------------

Integrated in Cassandra #1092 (See [https://builds.apache.org/job/Cassandra/1092/])
    use weak references to track slab regions
patch by jbellis; reviewed by stuhood for CASSANDRA-3162

jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1166876
Files : 
* /cassandra/trunk/src/java/org/apache/cassandra/utils/SlabAllocator.java


> use weak references to SlabAllocator regions
> --------------------------------------------
>
>                 Key: CASSANDRA-3162
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3162
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.0
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: 3162.txt
>
>
> Yang points out on CASSANDRA-2252,
> "Conceivably, one region would contain bytebuffer values of similar age. as more updates come in, all the columns in older regions are likely to have all died out, thus allowing us to free the entire region before flushing happens."
> So it's a bit of a corner case optimization, but easy to do and safe.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3162) use weak references to SlabAllocator regions

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

Stu Hood edited comment on CASSANDRA-3162 at 9/8/11 6:22 PM:
-------------------------------------------------------------

I'm not sure I like using this many WeakReferences in the common case: couldn't we get approximately the same effect by just nulling the 'data' field of the Region immediately after it has been retired? Then the filledRegions list would be an empty shell of regions.

      was (Author: stuhood):
    I'm not sure I like using this many WeakReferences in the common case: couldn't we get approximately the same effect by just nulling the 'data' field of the Region immediately after it has been retired? Then the filledRegions list would be an empty shell of references.
  
> use weak references to SlabAllocator regions
> --------------------------------------------
>
>                 Key: CASSANDRA-3162
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3162
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.0
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: 3162.txt
>
>
> Yang points out on CASSANDRA-2252,
> "Conceivably, one region would contain bytebuffer values of similar age. as more updates come in, all the columns in older regions are likely to have all died out, thus allowing us to free the entire region before flushing happens."
> So it's a bit of a corner case optimization, but easy to do and safe.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3162) use weak references to SlabAllocator regions

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

Stu Hood commented on CASSANDRA-3162:
-------------------------------------

That's true, but I didn't think that was the goal of this ticket.

> use weak references to SlabAllocator regions
> --------------------------------------------
>
>                 Key: CASSANDRA-3162
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3162
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.0
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: 3162.txt
>
>
> Yang points out on CASSANDRA-2252,
> "Conceivably, one region would contain bytebuffer values of similar age. as more updates come in, all the columns in older regions are likely to have all died out, thus allowing us to free the entire region before flushing happens."
> So it's a bit of a corner case optimization, but easy to do and safe.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3162) use weak references to SlabAllocator regions

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

Stu Hood commented on CASSANDRA-3162:
-------------------------------------

I'm not sure I like using this many WeakReferences in the common case: couldn't we get approximately the same effect by just nulling the 'data' field of the Region immediately after it has been retired? Then the filledRegions list would be an empty shell of references.

> use weak references to SlabAllocator regions
> --------------------------------------------
>
>                 Key: CASSANDRA-3162
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3162
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.0
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: 3162.txt
>
>
> Yang points out on CASSANDRA-2252,
> "Conceivably, one region would contain bytebuffer values of similar age. as more updates come in, all the columns in older regions are likely to have all died out, thus allowing us to free the entire region before flushing happens."
> So it's a bit of a corner case optimization, but easy to do and safe.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3162) use weak references to SlabAllocator regions

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

Stu Hood edited comment on CASSANDRA-3162 at 9/8/11 7:19 PM:
-------------------------------------------------------------

That's true, but I didn't think that was the goal of this ticket.

EDIT: I'm fine either way, so +1 if you prefer the WeakReference approach.

      was (Author: stuhood):
    That's true, but I didn't think that was the goal of this ticket.
  
> use weak references to SlabAllocator regions
> --------------------------------------------
>
>                 Key: CASSANDRA-3162
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3162
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.0
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: 3162.txt
>
>
> Yang points out on CASSANDRA-2252,
> "Conceivably, one region would contain bytebuffer values of similar age. as more updates come in, all the columns in older regions are likely to have all died out, thus allowing us to free the entire region before flushing happens."
> So it's a bit of a corner case optimization, but easy to do and safe.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira