Snapshot implements Comparable<byte[]> { Snapshot(int id, String name, INodeDirectory dir) { this(id, dir, dir); this.root.setLocalName(DFSUtil.string2Bytes(name)); } Snapshot(int id, String name, INodeDirectory dir);   Snapshot(int id, INodeDirectory dir, INodeDirectory parent); static String generateDefaultSnapshotName(); static String getSnapshotPath(String snapshottableDir,
      String snapshotRelativePath); static int getSnapshotId(Snapshot s); static int findLatestSnapshot(INode inode, final int anchor); int getId(); Root getRoot(); @Override int compareTo(byte[] bytes); @Override boolean equals(Object that); @Override int hashCode(); @Override String toString(); static final int CURRENT_STATE_ID; static final int NO_SNAPSHOT_ID; static final Comparator<Snapshot> ID_COMPARATOR; static final Comparator<Integer> ID_INTEGER_COMPARATOR; }
@Test public void testSnapshot() throws Throwable { try { runTestSnapshot(SNAPSHOT_ITERATION_NUMBER); } catch(Throwable t) { SnapshotTestHelper.LOG.info("FAILED", t); SnapshotTestHelper.dumpTree("FAILED", cluster); throw t; } }