There is one member variable which called dfs in DistributedFileSystem
class,
The type of dfs is DFSClient class.
All of the file system operation in DistributedFileSystem class
is transferred to the corresponding operation  of dfs.
And the dfs will communicate with NameNode server by the meaning of RPC,
the proxy in the DFSClient is namenode and rpcNameNode, which are the
ClientProtocol type.
So I think that there is no way to obtain the NameNode class via  the
DistributedFileSystem  class.
Because that the member variable namenode and rpcNameNode is just proxy in
the client side.
Can you explain that why you will do this?

2012/2/13 Harsh J <ha...@cloudera.com>

> If you want to use the many methods of DFS, that is how you may check
> for it and use it. However, the use of DistributedFileSystem directly
> is discouraged as well (its not an interface, and is not meant to be
> used directly by users at least).
>
> What are you looking to do with it exactly Michael, and which method
> inside DFS particularly interests you that FS itself does not provide?
>
> If you can tell me your reasons, I can be a better judge, but in any
> case it could turn out to be a problem to maintain as the framework
> gives you no guarantee of it breaking/remaining stable in future (but
> you are mostly okay if you are sticking to one version).
>
> On Mon, Feb 13, 2012 at 2:59 PM, Michael Lok <fula...@gmail.com> wrote:
> > Hi folks,
> >
> > I'm using the FileSystem class to connect to a HDFS installation.  I'm
> also
> > checking the instance if it's of DistributedFileSystem.
> >
> >> FileSystem fs = FileSystem.get(uri, conf, "hadoop");
> >>
> >> DistributedFileSystem dfs = null;
> >>
> >> if (fs instanceof DistributedFileSystem) {
> >> ...
> >
> >
> > Was wondering if there's a way to obtain an instance of the NameNode
> class
> > via the DistributedFileSystem or do I need to use ClientProtocol (which
> > doesn't seem likely as the InterfaceAudience is set to Private)?
> >
> >
> > Thanks!
>
>
>
> --
> Harsh J
> Customer Ops. Engineer
> Cloudera | http://tiny.cloudera.com/about
>

Reply via email to