XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.2, 3.2.4
    • None

    Description

      As part In order to replace Guava Preconditions, we need to implement our own versions of the API.
      This Jira is to create checkNotNull in a new package dubbed unguava.

       The plan is as follows

      • create a new package org.apache.hadoop.util.unguava;
      • create class Validate
      • implement  package org.apache.hadoop.util.unguava.Validate; with the following interface
        • checkNotNull(final T obj)
        • checkNotNull(final T reference, final Object errorMessage)
        • checkNotNull(final T obj, final String message, final Object... values)
        • checkNotNull(final T obj,final Supplier<String> msgSupplier)
      • guava.preconditions used String.lenientformat which suppressed exceptions caused by string formatting of the exception message . So, in order to avoid changing the behavior, the implementation catches Exceptions triggered by building the message (IllegalFormat, InsufficientArg, NullPointer..etc)
      • After merging the new class, we can replace guava.Preconditions.checkNotNull by {{unguava.Validate.checkNotNull}}
      • We need the change to go into trunk, 3.1, 3.2, and 3.3

       

      Similar Jiras will be created to implement checkState, checkArgument, checkIndex

      Attachments

        1. HADOOP-17126.001.patch
          13 kB
          Ahmed Hussein
        2. HADOOP-17126.002.patch
          13 kB
          Ahmed Hussein

        Issue Links

          Activity

            People

              ahussein Ahmed Hussein
              ahussein Ahmed Hussein
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 20m
                  3h 20m