It is totally internal to HDFS. However, I'm working on a test which has to be in server.namenode package but is needed an access to a block's replica info (which is accessible through a server.datanode call).
Also, this new getter is kept withing tests' source code and isn't a part of application source code. I'm opposing any public API's put into the production code merely for the testing purposes: it's bad. In fact, this was one of the reasons to have injection framework in Hadoop (
JSR 294 might help address the issue. However, the last time I checked it was in 'Inactive' state, so...