You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by Tiger Hu <hu...@gmail.com> on 2016/08/25 15:54:07 UTC

Question about ReplicaMap's mutex.

Hi all,

 I am reading HDFS source code and got one question about FsDatasetImpl. In FsDatasetImpl#FsDatasetImpl(), we use the statement to create global ReplicaMap object,

        volumeMap = new ReplicaMap(this);

“this” is passed as input and is assigned to volumeMap.mutex for synchronization.

In private FsDatasetImpl#addVolume(), "this" object is used for synchronization as well.

        ReplicaMap tempVolumeMap = new ReplicaMap(this);

but in public addVolume(), “fsVolume” is passed as input.
        final ReplicaMap tempVolumeMap = new ReplicaMap(fsVolume);

I am wondering if we can replace “this” with a smaller object, just like fsVolume in the third case, so that we can improve performance. Any comments? 

Regards,
Fenghua
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org