private void processINode ( DataInputStream in , ImageVisitor v , boolean skipBlocks , String parentName ) throws IOException { checkInterruption ( ) ; v . visitEnclosingElement ( ImageElement . INODE ) ; String pathName = FSImageSerialization . readString ( in ) ; if ( parentName != null ) { // local name pathName = "/" + pathName ; if ( ! "/" . equals ( parentName ) ) { // children of non-root directory pathName = parentName + pathName ; } } v . visit ( ImageElement . INODE_PATH , pathName ) ; if ( LayoutVersion . supports ( Feature . ADD_INODE_ID , imageVersion ) ) { v . visit ( ImageElement . INODE_ID , in . readLong ( ) ) ; } if ( LayoutVersion . supports ( Feature . HARDLINK , imageVersion ) ) { byte inodeType = in . readByte ( ) ; if ( inodeType == INode . INodeType . HARDLINKED_INODE . type ) { v . visit ( ImageElement . INODE_TYPE , INode . INodeType . HARDLINKED_INODE . toString ( ) ) ; long hardlinkID = WritableUtils . readVLong ( in ) ; v . visit ( ImageElement . INODE_HARDLINK_ID , hardlinkID ) ; } else if ( inodeType == INode . INodeType . RAIDED_INODE . type ) { v . visit ( ImageElement . INODE_TYPE , INode . INodeType . RAIDED_INODE . toString ( ) ) ; String codecId = WritableUtils . readString ( in ) ; v . visit ( ImageElement . RAID_CODEC_ID , codecId ) ; } else { v . visit ( ImageElement . INODE_TYPE , INode . INodeType . REGULAR_INODE . toString ( ) ) ; } } v . visit ( ImageElement . REPLICATION , in . readShort ( ) ) ; v . visit ( ImageElement . MODIFICATION_TIME , in . readLong ( ) ) ; if ( LayoutVersion . supports ( Feature . FILE_ACCESS_TIME , imageVersion ) ) v . visit ( ImageElement . ACCESS_TIME , in . readLong ( ) ) ; v . visit ( ImageElement . BLOCK_SIZE , in . readLong ( ) ) ; int numBlocks = in . readInt ( ) ; processBlocks ( in , v , numBlocks , skipBlocks ) ; // File or directory if ( numBlocks > 0 || numBlocks == - 1 ) { v . visit ( ImageElement . NS_QUOTA , numBlocks == - 1 ? in . readLong ( ) : - 1 ) ; if ( LayoutVersion . supports ( Feature . DISKSPACE_QUOTA , imageVersion ) ) v . visit ( ImageElement . DS_QUOTA , numBlocks == - 1 ? in . readLong ( ) : - 1 ) ; } if ( numBlocks == - 2 ) { v . visit ( ImageElement . SYMLINK , Text . readString ( in ) ) ; } processPermission ( in , v ) ; v . leaveEnclosingElement ( ) ; // INode }
Process an INode