[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741689#action_12741689
 ] 

Erik Holstad commented on ZOOKEEPER-472:
----------------------------------------

After the HBase meeting this weekend we might have a use case for a new node 
type which keeps the children sorted, so including that we would have 3 
different types of nodes, if this new node would be interesting for ZooKeeper 
in general. Tying that to this issue I came up with the following:
1. Make a Node interface that only have the following methods
copyStat(...)
deserialize(...)
serialize(...)
2. For the ephemeral nodes this would be it, they wouldn't have to have any 
notion about children.
3, For the regular nodes and the sorted ones would also have:
setChildren(...)
addChild(...)
getChildren(...)
where getChildren(...) could have different return types depending on the node.

4. For the nodes that can have children we also keep the structure 
uninstantiated until children are actually set or added to the parent. This 
part I have already done, jsut need to do some more testing on it.

Erik


> 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
>
>
> 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