You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Dmitriy V. Ryaboy (JIRA)" <ji...@apache.org> on 2012/09/17 06:18:07 UTC

[jira] [Updated] (PIG-2923) Lazily register bags with SpillableMemoryManager

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

Dmitriy V. Ryaboy updated PIG-2923:
-----------------------------------

    Attachment: bagspill_delayed_register.patch

This patch introduces the following changes:

1) Make SpillableMemoryManager a real singleton (before, it was assumed to be a singleton, but the assumption was not enforced)

2) deprecates BagFactory's registerBag() method, as it is no longer a Factory's job to do this. Also removes calls to this method from the default implementation.

3) gets rid of some redundant code for addAll() methods in various databag implementations

4) introduces a markSpillableIfNecessary method in AbstractDataBag, which will register with the SMM if necessary (upon reaching a memory threshold of 100K).

5) adds markSpillableIfNecessary calls to all spillable DataBags' add() methods.

TestDataBag passes, test-commit passes, TestDataBagAccess passes.

While testing this, I discovered the fun fact that calling _size() on a DistinctDataBag causes it to stop being distinct_. But that's for a different jira...
                
> Lazily register bags with SpillableMemoryManager
> ------------------------------------------------
>
>                 Key: PIG-2923
>                 URL: https://issues.apache.org/jira/browse/PIG-2923
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Dmitriy V. Ryaboy
>            Assignee: Dmitriy V. Ryaboy
>         Attachments: bagspill_delayed_register.patch
>
>
> Currently, all Spillable DataBags get registered by the BagFactory at the moment of creation. In practice, a lot of these bags will not get large enough to be worth spilling; we can avoid a lot of memory overhead and cheapen the process of finding a bag to spill when we do need it, by allowing Bags themselves to register when they grow to some respectable threshold.
> Related JIRAs: PIG-2917, PIG-2918

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira