private void initialize(String address, Configuration conf) throws IOException {
InetSocketAddress socAddr = NameNode.getAddress(address);
this.supportAppends = conf.getBoolean("dfs.support.append", true);
this.handlerCount = conf.getInt("dfs.namenode.handler.count", 10);
this.server = RPC.getServer(this, socAddr.getHostName(), socAddr.getPort(),handlerCount, false, conf);
this.nameNodeAddress = this.server.getListenerAddress();
FileSystem.setDefaultUri(conf, getUri(nameNodeAddress));
LOG.info("Namenode up at: " + this.nameNodeAddress);
myMetrics = new NameNodeMetrics(conf, this);
this.namesystem = new FSNamesystem(this, conf);
this.server.start(); //start RPC server
this.emptier = new Thread(new Trash(conf).getEmptier(), "Trash Emptier");
this.emptier.setDaemon(true);
this.emptier.start();
}
|