Erik Holstad commented on ZOOKEEPER-472:

Did some more coding today and created 3 classes and 1 inteface:
Interface Node

Class EphemeralNode
Class PersistentNode
Class PersistentSortedNode

The problem is that a lot of the class variables from the old DataNode class 
are being used like node.data = {}, instead of getting and setting it, which 
leads to some weirdness
when the node is no longer a class, but an interface. So the way I see it we 
can take two approaches.
1. Having the nodes subclass and override methods from a base class or
2. Start using getters and setters for all variables in the nodes. 

Just want to check before I do anything more since this might turn out to be a 
quite big change of how the nodes are being used internally.


> 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