一. NameNode概述
* The NameNode controls two critical tables:
* 1) filename->blocksequence (namespace)
* 2) block->machinelist ("inodes")
*
* The first table is stored on disk and is very precious.
* The second table is rebuilt every time the NameNode comes
* up.
- 上面这段其实就和FSNameSystem作用一样,因为NameNode的功能基本就是靠FSNameSystem实现的。
- 当然,同DataNode一样,NameNode也是一个RPC Server。
- NameNode也要提供Http服务。
二. NameNode成员变量
//一个文件系统 一个NameNode 一个FSNamesystem 一个FSDirectory public FSNamesystem namesystem; // TODO: This should private. Use getNamesystem() instead. //BackupNode, Datanodes and all other services与serviceRpcServer通信 private Server serviceRpcServer; //Clients 与server通信 private Server server; //serviceRpcServer ip port protected InetSocketAddress serviceRPCAddress = null; //server ip port private InetSocketAddress serverAddress = null; //NameNode可以提供http服务 private HttpServer httpServer; //http服务 ip port private InetSocketAddress httpAddress = null; //暂时不知道做什么 后面看把 private Thread emptier;