/** * Load the {@link SnapshotDiff} list for the INodeDirectoryWithSnapshot * directory. * @param dir The snapshottable directory for loading. * @param in The {@link DataInput} instance to read. * @param loader The {@link Loader} instance that this loading procedure is * using. */ public static void loadDirectoryDiffList(INodeDirectory dir, DataInput in, FSImageFormat.Loader loader) throws IOException { final int size = in.readInt(); if (dir instanceof INodeDirectoryWithSnapshot) { INodeDirectoryWithSnapshot withSnapshot = (INodeDirectoryWithSnapshot)dir; DirectoryDiffList diffs = withSnapshot.getDiffs(); for (int i = 0; i < size; i++) { diffs.addFirst(loadDirectoryDiff(withSnapshot, in, loader)); } } }