hadoop-zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mahadev Konar <maha...@yahoo-inc.com>
Subject Re: Accessing internal variables in DataNode and synchronization.
Date Fri, 11 Sep 2009 21:35:56 GMT
Hi Erik,
  There is no such reason for accessing variable without acess and getters.
We should not be doing that. Its good to have getters and setters.

The synchronization on DataNode is a safe lock that would prevent developers
being concerned about finer locks and maintaining them. In our performance
experiments we havent ever seen any problems with these. So, we did not want
to make it more complex with finer granularity locks,

Thanks
mahadev

On 9/11/09 2:14 PM, "Erik Holstad" <erikholstad@gmail.com> wrote:

> In most places in the server side code, internal variables are accessed
> directly via something like, node.parent... instead of making the variable
> private and using getters and setters, what is the purpose of this?
> 
> Another question is why the synchronization on for example the DataNode is
> done on the node itself and not on the variables access, it seems reasonable
> to me that 2 different threads would be allowed to modify for example the
> data and the children at the same time, or is there something that I'm
> missing here, watchers?
> 
> Erik


Mime
View raw message