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

Erik Holstad updated ZOOKEEPER-472:
-----------------------------------

    Attachment: zookeeper-472.patch

I decided to take a lesser approach and just do what this Jira originally said, 
so basically creating two new methods, addChild() and removeChild() and making 
the variable children in DataNode private. The children set in DataNode is not 
instantiated at node creation but instead the first time addChild() is being 
called.

No synchronization is done one the calls addChild and removeChild since it 
looks like most other calls are synchronized on the node itself. 
Not really sure why getChildren is synchronized though, since as far as I can 
see it all the uses of it are also synchronized on the node.

According to the docs it says that 2 spaces should be used instead of 4. Is 
that a miss in the docs or is that what is really being used?
I'm using 2 for this patch.



> Making DataNode not instantiate a HashMap when the node is ephmeral
> -------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-472
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-472
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: server
>    Affects Versions: 3.1.1, 3.2.0
>            Reporter: Erik Holstad
>            Assignee: Erik Holstad
>            Priority: Minor
>             Fix For: 3.3.0
>
>         Attachments: zookeeper-472.patch
>
>
> Looking at the code, there is an overhead of a HashSet object for that nodes 
> children, even though the node might be an ephmeral node and cannot have 
> children.

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

Reply via email to