Likkey commented on PR #4848: URL: https://github.com/apache/hadoop/pull/4848#issuecomment-1240156332
> @Likkey Thank you very much for your contribution. Can we provide the stack before and after modification ? @slfan1989 Thank you very much for your reply!!!! In fact, the stack information before and after the change is essentially unchanged. I think that since the constructor of the ShortCircuitCache class in ShortCircuitCache.java in the source code already uses Preconditions.checkArgument() to check whether the configuration item value is greater than or equal to zero.So when set to a negative number, it will lead to the creation of ShortCircuitCache class object in ClientContext.java failed. https://github.com/apache/hadoop/blob/42c8f61fecd89d63af3f91d06bd5702a7f8791b3/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/ClientContext.java#L170 But due to Preconditions.checkArgument () in the lack of error information, resulting in the terminal using hdfs dfsadmin script appears as follows: ``` hadoop@ljq1:~/hadoop-3.1.3-work/sbin$ hdfs dfsadmin -safemode leave safemode: null Usage: hdfs dfsadmin [-safemode enter | leave | get | wait | forceExit] hadoop@ljq1:~/hadoop-3.1.3-work/sbin$ hdfs dfsadmin -safemode enter safemode: null Usage: hdfs dfsadmin [-safemode enter | leave | get | wait | forceExit] hadoop@ljq1:~/hadoop-3.1.3-work/sbin$ hdfs dfsadmin -safemode get safemode: null Usage: hdfs dfsadmin [-safemode enter | leave | get | wait | forceExit] hadoop@ljq1:~/hadoop-3.1.3-work/sbin$ hdfs dfsadmin -safemode forceExit safemode: null Usage: hdfs dfsadmin [-safemode enter | leave | get | wait | forceExit] ``` And hdfs logs and terminal are not related to the exception thrown. Therefore, the cause of the situation can be found directly after adding an error message to the original Preconditions.checkArgument(), as follows: ``` hadoop@ljq1:~/hadoop-3.1.3-work/sbin$ hdfs dfsadmin -safemode leave safemode: Invalid argument: dfs.client.mmap.cache.size must be greater than zero. Usage: hdfs dfsadmin [-safemode enter | leave | get | wait | forceExit] ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
