You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2025/05/15 01:30:00 UTC

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

    [ https://issues.apache.org/jira/browse/HDDS-12966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17951551#comment-17951551 ] 

Tsz-wo Sze commented on HDDS-12966:
-----------------------------------

This is caused by HDDS-4675 but not HDDS-3773..

> DBDefinitionFactory should not throw InvalidArnException
> --------------------------------------------------------
>
>                 Key: HDDS-12966
>                 URL: https://issues.apache.org/jira/browse/HDDS-12966
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: Tools
>    Affects Versions: 1.0.0
>            Reporter: Attila Doroszlai
>            Assignee: Attila Doroszlai
>            Priority: Minor
>              Labels: GoodForNewContributors
>             Fix For: 2.1.0
>
>
> 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