You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Attila Doroszlai (Jira)" <ji...@apache.org> on 2025/05/04 08:11:00 UTC

[jira] [Created] (HDDS-12966) DBDefinitionFactory should not throw InvalidArnException

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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org