Branch-2802 Snapshot (Unreleased) HDFS-4076. Support snapshot of single files. (szetszwo) HDFS-4082. Add editlog opcodes for snapshot create and delete operations. (suresh via szetszwo) HDFS-4086. Add editlog opcodes to allow and disallow snapshots on a directory. (Brandon Li via suresh) HDFS-4083. Protocol changes for snapshots. (suresh) HDFS-4077. Add support for Snapshottable Directory. (szetszwo via suresh) HDFS-4087. Protocol changes for listSnapshots functionality. (Brandon Li via suresh) HDFS-4079. Add SnapshotManager which maintains a list for all the snapshottable directories and supports snapshot methods such as setting a directory to snapshottable and creating a snapshot. (szetszwo) HDFS-4078. Handle replication in snapshots. (szetszwo) HDFS-4084. Provide CLI support to allow and disallow snapshot on a directory. (Brondon Li via suresh) HDFS-4091. Add snapshot quota to limit the number of snapshots allowed. (szetszwo) HDFS-4097. Provide CLI support for createSnapshot. (Brandon Li via suresh) HDFS-4092. Update file deletion logic for snapshot so that the current inode is removed from the circular linked list; and if some blocks at the end of the block list no longer belong to any other inode, collect them and update the block list. (szetszwo) HDFS-4111. Support snapshot of subtrees. (szetszwo via suresh) HDFS-4119. Complete the allowSnapshot code and add a test for it. (szetszwo) HDFS-4133. Add testcases for testing basic snapshot functionalities. (Jing Zhao via suresh) HDFS-4116. Add auditlog for some snapshot operations. (Jing Zhao via suresh) HDFS-4095. Add some snapshot related metrics. (Jing Zhao via suresh) HDFS-4141. Support directory diff - the difference between the current state and a previous snapshot of an INodeDirectory. (szetszwo) HDFS-4146. Use getter and setter in INodeFileWithLink to access blocks and initialize root directory as snapshottable. (szetszwo) HDFS-4149. Implement the disallowSnapshot(..) in FSNamesystem and add resetSnapshottable(..) to SnapshotManager. (szetszwo) HDFS-4147. When there is a snapshot in a subtree, deletion of the subtree should fail. (Jing Zhao via szetszwo) HDFS-4150. Update the inode in the block map when a snapshotted file or a snapshot file is deleted. (Jing Zhao via szetszwo) HDFS-4159. Rename should fail when the destination directory is snapshottable and has snapshots. (Jing Zhao via szetszwo) HDFS-4170. Add snapshot information to INodesInPath. (szetszwo) HDFS-4177. Add a snapshot parameter to INodeDirectory.getChildrenList() for selecting particular snapshot children list views. (szetszwo) HDFS-4148. Disallow write/modify operations on files and directories in a snapshot. (Brandon Li via suresh) HDFS-4188. Add Snapshot.ID_COMPARATOR for comparing IDs and fix a bug in ReadOnlyList.Util.binarySearch(..). (szetszwo) HDFS-4187. Add tests for replication handling in snapshots. (Jing Zhao via szetszwo) HDFS-4196. Support renaming of snapshots. (Jing Zhao via szetszwo) HDFS-4175. Additional snapshot tests for more complicated directory structure and modifications. (Jing Zhao via suresh) HDFS-4293. Fix TestSnapshot failure. (Jing Zhao via suresh) HDFS-4317. Change INode and its subclasses to support HDFS-4103. (szetszwo) HDFS-4103. Support O(1) snapshot creation. (szetszwo) HDFS-4330. Support snapshots up to the snapshot limit. (szetszwo) HDFS-4357. Fix a bug that if an inode is replaced, further INode operations should apply to the new inode. (Jing Zhao via szetszwo) HDFS-4230. Support listing of all the snapshottable directories. (Jing Zhao via szetszwo) HDFS-4244. Support snapshot deletion. (Jing Zhao via szetszwo) HDFS-4245. Include snapshot related operations in TestOfflineEditsViewer. (Jing Zhao via szetszwo) HDFS-4098. Add FileWithLink, INodeFileUnderConstructionWithLink and INodeFileUnderConstructionSnapshot in order to support append to snapshotted files. (szetszwo)