FSDirectory implements Closeable { void reset() { writeLock(); try { setReady(false); rootDir = createRoot(getFSNamesystem()); inodeMap.clear(); addToInodeMap(rootDir); nameCache.reset(); } finally { writeUnlock(); } } FSDirectory(FSImage fsImage, FSNamesystem ns, Configuration conf); int getReadHoldCount(); int getWriteHoldCount(); INodeDirectory getRoot(); @Override void close(); INode getINode(String src); INodesInPath getLastINodeInPath(String src); INodesInPath getINodesInPath4Write(String src
      ); INode getINode4Write(String src); @VisibleForTesting long getYieldCount(); INodeMap getINodeMap(); final void addToInodeMap(INode inode); final void removeFromInodeMap(List<? extends INode> inodes); INode getInode(long id); static boolean isReservedName(INode inode); static boolean isReservedName(String src); final static String DOT_RESERVED_STRING; final static String DOT_RESERVED_PATH_PREFIX; final static byte[] DOT_RESERVED; final static String DOT_INODES_STRING; final static byte[] DOT_INODES; }
@Test public void testReset() throws Exception { fsdir.reset(); Assert.assertFalse(fsdir.isReady()); final INodeDirectory root = (INodeDirectory) fsdir.getINode("/"); Assert.assertTrue(root.getChildrenList(Snapshot.CURRENT_STATE_ID).isEmpty()); fsdir.imageLoadComplete(); Assert.assertTrue(fsdir.isReady()); }