SnapshotManager implements SnapshotStatsMXBean { public int getMaxSnapshotID() { return ((1 << SNAPSHOT_ID_BIT_WIDTH) - 1); } SnapshotManager(final Configuration conf, final FSDirectory fsdir); void initThreadLocals(); boolean isSnapshotDeletionOrdered(); boolean getSkipCaptureAccessTimeOnlyChange(); boolean isAllowNestedSnapshots(); void setSnapshottable(final String path, boolean checkNestedSnapshottable); void addSnapshottable(INodeDirectory dir); void removeSnapshottable(List<INodeDirectory> toRemove); void resetSnapshottable(final String path); INodeDirectory getSnapshottableRoot(final INodesInPath iip); void assertMarkedAsDeleted(INodesInPath iip, String snapshotName); INodeDirectory checkAndGetSnapshottableAncestorDir(
      final INodesInPath iip); INodeDirectory getSnapshottableAncestorDir(final INodesInPath iip); boolean isDescendantOfSnapshotRoot(INodeDirectory dir); String createSnapshot(final LeaseManager leaseManager,
      final INodesInPath iip, String snapshotRoot, String snapshotName,
      long mtime); void deleteSnapshot(final INodesInPath iip, final String snapshotName,
      INode.ReclaimContext reclaimContext, long now); void renameSnapshot(final INodesInPath iip, final String snapshotRoot,
      final String oldSnapshotName, final String newSnapshotName, long now); int getNumSnapshottableDirs(); int getNumSnapshots(); void write(DataOutput out); Map<Integer, Snapshot> read(DataInput in, FSImageFormat.Loader loader
      ); SnapshottableDirectoryStatus[] getSnapshottableDirListing(
      String userName); SnapshotStatus[] getSnapshotListing(INodesInPath iip); SnapshotDiffReport diff(final INodesInPath iip,
      final String snapshotPath, final String from,
      final String to); SnapshotDiffReportListing diff(final INodesInPath iip,
      final String snapshotPath, final String from, final String to,
      byte[] startPath, int index, int snapshotDiffReportLimit); void clearSnapshottableDirs(); int getMaxSnapshotID(); static XAttr buildXAttr(); void registerMXBean(); void shutdown(); @Override // SnapshotStatsMXBean SnapshottableDirectoryStatus.Bean[] getSnapshottableDirectories(); @Override // SnapshotStatsMXBean SnapshotInfo.Bean[] getSnapshots(); static SnapshottableDirectoryStatus.Bean toBean(INodeDirectory d); static SnapshotInfo.Bean toBean(Snapshot s); static final Logger LOG; }
@Test public void testValidateSnapshotIDWidth() throws Exception { FSDirectory fsdir = mock(FSDirectory.class); SnapshotManager snapshotManager = new SnapshotManager(new Configuration(), fsdir); Assert.assertTrue(snapshotManager. getMaxSnapshotID() < Snapshot.CURRENT_STATE_ID); }