增加注释

This commit is contained in:
LingZhaoHui 2024-06-28 21:27:15 +08:00
parent 1c64c6aa3c
commit affa2ee36c
Signed by: zeekling
GPG Key ID: D96E4E75267CA2CC
4 changed files with 8 additions and 1 deletions

View File

@ -1121,6 +1121,7 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
DFS_SHORT_CIRCUIT_SHARED_MEMORY_WATCHER_INTERRUPT_CHECK_MS_DEFAULT =
HdfsClientConfigKeys
.DFS_SHORT_CIRCUIT_SHARED_MEMORY_WATCHER_INTERRUPT_CHECK_MS_DEFAULT;
// namenode 启动的keytab
public static final String DFS_NAMENODE_KEYTAB_FILE_KEY = "dfs.namenode.keytab.file";
public static final String DFS_NAMENODE_KERBEROS_PRINCIPAL_KEY =
HdfsClientConfigKeys.DFS_NAMENODE_KERBEROS_PRINCIPAL_KEY;

View File

@ -1772,7 +1772,10 @@ private void addCacheCommands(String blockPoolId, DatanodeDescriptor nodeinfo,
}
}
/** Handle heartbeat from datanodes. */
/**
* Handle heartbeat from datanodes.
* 万恶的heartbeat啥都干
* */
public DatanodeCommand[] handleHeartbeat(DatanodeRegistration nodeReg,
StorageReport[] reports, final String blockPoolId,
long cacheCapacity, long cacheUsed, int xceiverCount,

View File

@ -225,6 +225,7 @@ public void load(File file, boolean requireSameLayoutVersion)
FSImageFormatProtobuf.Loader loader = new FSImageFormatProtobuf.Loader(
conf, fsn, requireSameLayoutVersion);
impl = loader;
// 开始加载fsimage
loader.load(file);
} else {
Loader loader = new Loader(conf, fsn);

View File

@ -360,6 +360,7 @@ private void loadInternal(RandomAccessFile raFile, FileInputStream fin)
if (!FSImageUtil.checkFileFormat(raFile)) {
throw new IOException("Unrecognized file format");
}
// 加载summary
FileSummary summary = FSImageUtil.loadSummary(raFile);
if (requireSameLayoutVersion && summary.getLayoutVersion() !=
HdfsServerConstants.NAMENODE_LAYOUT_VERSION) {
@ -399,6 +400,7 @@ public int compare(FileSummary.Section s1, FileSummary.Section s2) {
* a particular step to be started for once.
*/
Step currentStep = null;
// 是否开启并发加载
boolean loadInParallel = enableParallelSaveAndLoad(conf);
ExecutorService executorService = null;