hdfs oiv分析调试篇

public class FsimageOIV {
	@Test
	public void oiv() throws Exception{
		String[] args = {"-p","Delimited", "-i", "/Users/didi/Work/test/fsimage_0000000000000029436",
				"-o","/Users/didi/Work/test/fsimage_0000000000000029436.csv"};
		
		OfflineImageViewerPB.main(args);
	}
}
[hadoop@hadoop1 current]$
[hadoop@hadoop1 current]$ hdfs oiv -p Delimited -delimiter "," -i fsimage_0000000000000029436 -o fsimage_0000000000000029436.csv
2020-03-09 12:15:28,169 DEBUG util.Shell: setsid exited with exit code 0
2020-03-09 12:15:28,228 INFO offlineImageViewer.PBImageTextWriter: Loading string table
2020-03-09 12:15:28,237 INFO offlineImageViewer.FSImageHandler: Loading 7 strings
2020-03-09 12:15:28,239 INFO offlineImageViewer.PBImageTextWriter: Loading inode references
2020-03-09 12:15:28,239 INFO offlineImageViewer.FSImageHandler: Loading inode references
2020-03-09 12:15:28,247 INFO offlineImageViewer.FSImageHandler: Loaded 0 inode references
2020-03-09 12:15:28,248 INFO offlineImageViewer.PBImageTextWriter: Loading directories
2020-03-09 12:15:28,251 INFO offlineImageViewer.PBImageTextWriter: Loading directories in INode section.
2020-03-09 12:15:28,278 DEBUG offlineImageViewer.PBImageTextWriter: Scanned 0 inodes.
2020-03-09 12:15:28,309 INFO offlineImageViewer.PBImageTextWriter: Found 440 directories in INode section.
2020-03-09 12:15:28,310 INFO offlineImageViewer.PBImageTextWriter: Finished loading directories in 61ms
2020-03-09 12:15:28,310 INFO offlineImageViewer.PBImageTextWriter: Loading INode directory section.
2020-03-09 12:15:28,318 INFO offlineImageViewer.PBImageTextWriter: Scanned 398 INode directories to build namespace.
2020-03-09 12:15:28,318 INFO offlineImageViewer.PBImageTextWriter: Finished loading INode directory section in 8ms
2020-03-09 12:15:28,337 INFO offlineImageViewer.PBImageTextWriter: Found 2104 INodes in the INode section
2020-03-09 12:15:28,359 DEBUG offlineImageViewer.PBImageTextWriter: Outputted 0 INodes.
2020-03-09 12:15:28,678 INFO offlineImageViewer.PBImageTextWriter: Outputted 2104 INodes.
2020-03-09 12:15:28,678 DEBUG offlineImageViewer.PBImageTextWriter: Time to output inodes: 360ms

hdfs oiv分析调试篇_第1张图片
有对应的visit方法。

hdfs oiv分析调试篇_第2张图片
遍历sessions,一共10个session

NS_INFO
STRING_TABLE
ERASURE_CODING
INODE
INODE_REFERENCE
SNAPSHOT
INODE_DIR
FILES_UNDERCONSTRUCTION
SECRET_MANAGER
CACHE_MANAGER

你可能感兴趣的:(HDFS)