[ https://issues.apache.org/jira/browse/HDFS-16338?focusedWorklogId=690460&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-690460 ]
ASF GitHub Bot logged work on HDFS-16338: ----------------------------------------- Author: ASF GitHub Bot Created on: 04/Dec/21 07:30 Start Date: 04/Dec/21 07:30 Worklog Time Spent: 10m Work Description: ayushtkn commented on a change in pull request #3684: URL: https://github.com/apache/hadoop/pull/3684#discussion_r762397398 ########## File path: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSImage.java ########## @@ -275,6 +276,29 @@ public void testSaveAndLoadStripedINodeFile() throws IOException{ } } + @Test + public void testImportCheckpoint() { + Configuration conf = new Configuration(); + conf.set(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_EDITS_DIR_KEY, ""); + MiniDFSCluster cluster = null; + try { Review comment: Can use try with resources for cluster ########## File path: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSImage.java ########## @@ -275,6 +276,29 @@ public void testSaveAndLoadStripedINodeFile() throws IOException{ } } + @Test + public void testImportCheckpoint() { + Configuration conf = new Configuration(); + conf.set(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_EDITS_DIR_KEY, ""); + MiniDFSCluster cluster = null; + try { + cluster = new MiniDFSCluster.Builder(conf).build(); + cluster.waitActive(); + FSNamesystem fsn = cluster.getNamesystem(); + FSImage fsImage= new FSImage(conf); + fsImage.doImportCheckpoint(fsn); + fail("Expect to throw IOException."); + } catch (IOException e) { + GenericTestUtils.assertExceptionContains( + "Cannot import image from a checkpoint. " + + "\"dfs.namenode.checkpoint.edits.dir\" is not set.", e); Review comment: Use LambdaTestUtils instead of try-catch-assert -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 690460) Time Spent: 2h 20m (was: 2h 10m) > Fix error configuration message in FSImage > ------------------------------------------ > > Key: HDFS-16338 > URL: https://issues.apache.org/jira/browse/HDFS-16338 > Project: Hadoop HDFS > Issue Type: Improvement > Components: hdfs > Affects Versions: 3.3.1 > Reporter: guophilipse > Priority: Minor > Labels: pull-request-available > Time Spent: 2h 20m > Remaining Estimate: 0h > > `dfs.namenode.checkpoint.edits.dir` may be different from > `dfs.namenode.checkpoint.dir` , if `checkpointEditsDirs` is null or empty, > error message should warn the edit dir configuration, we can fix it. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org