NameNode启动源码分析 #7
@ -153,6 +153,7 @@ private void startCommonServices(Configuration conf) throws IOException {
|
||||
// 启动所有插件
|
||||
for (ServicePlugin p: plugins) {
|
||||
try {
|
||||
// 调用插件的start接口,需要插件自己实现,需要实现接口ServicePlugin
|
||||
p.start(this);
|
||||
} catch (Throwable t) {
|
||||
LOG.warn("ServicePlugin " + p + " could not be started", t);
|
||||
@ -202,8 +203,7 @@ void startCommonServices(Configuration conf, HAContext haContext) throws IOExcep
|
||||
// 注册快照管理器
|
||||
snapshotManager.registerMXBean();
|
||||
InetSocketAddress serviceAddress = NameNode.getServiceAddress(conf, true);
|
||||
this.nameNodeHostName = (serviceAddress != null) ?
|
||||
serviceAddress.getHostName() : "";
|
||||
this.nameNodeHostName = (serviceAddress != null) ? serviceAddress.getHostName() : "";
|
||||
}
|
||||
```
|
||||
|
||||
@ -219,6 +219,7 @@ void startCommonServices(Configuration conf, HAContext haContext) throws IOExcep
|
||||
```java
|
||||
public void activate(Configuration conf, long blockTotal) {
|
||||
pendingReconstruction.start();
|
||||
// 初始化datanodeManager
|
||||
datanodeManager.activate(conf);
|
||||
this.redundancyThread.setName("RedundancyMonitor");
|
||||
this.redundancyThread.start();
|
||||
@ -231,5 +232,3 @@ public void activate(Configuration conf, long blockTotal) {
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user