Attila Doroszlai created HDDS-12966:
---------------------------------------
Summary: DBDefinitionFactory should not throw InvalidArnException
Key: HDDS-12966
URL: https://issues.apache.org/jira/browse/HDDS-12966
Project: Apache Ozone
Issue Type: Bug
Components: Tools
Affects Versions: 1.1.0
Reporter: Attila Doroszlai
DBDefinitionFactory should throw built-in exception (IllegalArgumentException
or NullPointerException), not some unrelated exception from AWS
(InvalidArnException). Better replace it with {{Objects.requireNonNull}}.
{code:title=https://github.com/apache/ozone/blob/3201ca4e32b5f23b1ab41e72a3952ce6dac9b118/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBDefinitionFactory.java#L77-L80}
if (fileName == null) {
throw new InvalidArnException(
"Path is required to identify the used db scheme");
}
{code}
Also replace usage of {{Preconditions.checkNotNull}}:
{code:title=https://github.com/apache/ozone/blob/3201ca4e32b5f23b1ab41e72a3952ce6dac9b118/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBDefinitionFactory.java#L74-L75}
Preconditions.checkNotNull(dbPath,
"Path is required to identify the used db scheme");
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]