Class SnapshotFSImageFormat
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotFSImageFormat
A helper class defining static methods for reading/writing snapshot related
information from/to FSImage.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA reference map for fsimage serialization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic INodeloadCreated(byte[] createdNodeName, INodeDirectory parent) Load a node stored in the created list from fsimage.static voidloadDirectoryDiffList(INodeDirectory dir, DataInput in, FSImageFormat.Loader loader) Load theSnapshotDifflist for the INodeDirectoryWithSnapshot directory.static FileDiffListloadFileDiffList(DataInput in, FSImageFormat.Loader loader) static voidloadSnapshotList(INodeDirectory snapshottableParent, int numSnapshots, DataInput in, FSImageFormat.Loader loader) Load snapshots and snapshotQuota for a Snapshottable directory.static voidsaveDirectoryDiffList(INodeDirectory dir, DataOutput out, SnapshotFSImageFormat.ReferenceMap referenceMap) static voidsaveFileDiffList(INodeFile file, DataOutput out) static voidsaveSnapshots(INodeDirectory current, DataOutput out) Save snapshots and snapshot quota for a snapshottable directory.
-
Constructor Details
-
SnapshotFSImageFormat
public SnapshotFSImageFormat()
-
-
Method Details
-
saveSnapshots
Save snapshots and snapshot quota for a snapshottable directory.- Parameters:
current- The directory that the snapshots belongs to.out- TheDataOutputto write.- Throws:
IOException
-
saveDirectoryDiffList
public static void saveDirectoryDiffList(INodeDirectory dir, DataOutput out, SnapshotFSImageFormat.ReferenceMap referenceMap) throws IOException - Throws:
IOException
-
saveFileDiffList
- Throws:
IOException
-
loadFileDiffList
public static FileDiffList loadFileDiffList(DataInput in, FSImageFormat.Loader loader) throws IOException - Throws:
IOException
-
loadCreated
Load a node stored in the created list from fsimage.- Parameters:
createdNodeName- The name of the created node.parent- The directory that the created list belongs to.- Returns:
- The created node.
- Throws:
IOException
-
loadSnapshotList
public static void loadSnapshotList(INodeDirectory snapshottableParent, int numSnapshots, DataInput in, FSImageFormat.Loader loader) throws IOException Load snapshots and snapshotQuota for a Snapshottable directory.- Parameters:
snapshottableParent- The snapshottable directory for loading.numSnapshots- The number of snapshots that the directory has.loader- The loader- Throws:
IOException
-
loadDirectoryDiffList
public static void loadDirectoryDiffList(INodeDirectory dir, DataInput in, FSImageFormat.Loader loader) throws IOException Load theSnapshotDifflist for the INodeDirectoryWithSnapshot directory.- Parameters:
dir- The snapshottable directory for loading.in- TheDataInputinstance to read.loader- The loader- Throws:
IOException
-