You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mnemonic.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/03/06 19:30:33 UTC

[jira] [Commented] (MNEMONIC-208) Implement GET/PUT/DELETE Map operations

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

ASF GitHub Bot commented on MNEMONIC-208:
-----------------------------------------

GitHub user johnugeorge opened a pull request:

    https://github.com/apache/incubator-mnemonic/pull/29

    MNEMONIC-208: Adding PUT/GET/DELETE for durable maps.

    This pull request defines durable map data structure and basic operations- PUT, GET , DELETE and RESIZE.  
    
    Implementation details:
    
    Durable maps are implemented on memory chunks(buckets) where each memory allocated chunk stores a durable linkedlist.   Below figure shows a map with capacity 4 and size 3
    
          |_bucket 1_____|  --->null
          |_bucket 2_____| --->|______LinkedList elem1__|--->null
          |_bucket 3_____|---->null
          |_bucket 4_____|---->|______LinkedList elem1__|--->|______LinkedList elem2__|--->null
          
    
    During instantiation of a durable map data structure,  the user can opt to choose initialCapacity as a constructor parameter to specify the number of buckets to be allocated.  If it is not provided, default map capacity(16) number of buckets are initially allocated. If map size exceeds a configurable threshold, map is resized automatically to twice the current capacity.  This incurs reallocation cost and hence it is preferred to provide initialCapacity hint if user knows approximate size of the input dataset. 
    
    Map keys are hashed to buckets and GET/PUT/DELETE operations are executed on the corresponding LinkedList structure.
    
    The restore of durable maps is implemented in an indirect way. The handler of the buckets memory chunk is stored in a different memory chunk, which is returned to the user via getHandler() method. The handler of buckets memory chunk will be changed during resize operation and hence, it cannot be provided to the user directly.    
     
    Destroy will be revisited after the fix for [Jira: 215](https://issues.apache.org/jira/browse/MNEMONIC-215)
    
    The test cases are added that demonstrates the usage of Primitive/Generic Objects as Keys and Values in a durable map. 
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/johnugeorge/incubator-mnemonic master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-mnemonic/pull/29.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #29
    
----
commit 4be77912bff8343077a849f320ab32df27d90979
Author: Johnu George <jo...@cisco.com>
Date:   2017-03-06T18:38:27Z

    MNEMONIC-208: Adding PUT/GET/DELETE for durable maps.

----


> Implement GET/PUT/DELETE Map operations  
> -----------------------------------------
>
>                 Key: MNEMONIC-208
>                 URL: https://issues.apache.org/jira/browse/MNEMONIC-208
>             Project: Mnemonic
>          Issue Type: Sub-task
>          Components: Collection
>            Reporter: Johnu George
>            Assignee: Johnu George
>             Fix For: 0.5.0-incubating
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)