Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-3584

Add an explicit HadoopConfigurationException that extends RuntimeException

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 0.19.0
    • None
    • conf
    • None

    Description

      It is possible for a get() or set() operation to throw an exception today, especially if a security manager is blocking property access. As more complex cross-references are used, the likelihood for failure is higher.

      Yet there is no way for a Configuration or subclass to throw an exception today except by throwing a general purpose RuntimeException.

      I propose having a specific HadoopConfigurationException that extends RuntimeException. Classes that read in configurations can explicitly catch and handle these. The exception could

      • be raised on some parse error (a float attribute is not a parseable float, etc)
      • be raised on some error caused by an implementation of a configuration service API
      • wrap underlying errors from different implementations (like JNDI exceptions)
      • wrap security errors and other generic problems

      I'm not going to propose having specific errors for parsing problems versus undefined name,value pair though that may be useful feature creep. It certainly makes bridging from different back-ends trickier.

      This would not be incompatible with the existing code, at least from my current experiments. What is more likely to cause problems is having the get() operations failing, as that is not something that is broadly tested (yet). If we do want to test it, we could have a custom mock back-end that could be configured to fail on a get() of a specific option.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            stevel@apache.org Steve Loughran
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment