Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-2181

JsonToBean has some missing and incorrect mappings

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.0
    • Component/s: client
    • Labels:
      None

      Description

      JsonToBean has code to map from Bundle Job, Coordinator Job, etc JSON into the associated BundleJob, CoordinatorJob, etc classes.

      If a mapping is missing, and you try to call a getter, the code will compile but you'll get a RuntimeException. For example; the mapping for BundleJob.getAcl() is missing. Specifically, when you use this code:

      BundleJob job = client.getBundleJobInfo(jobId);
      String acl = job.getAcl();
      

      you get this exception:

      Exception in thread "main" java.lang.RuntimeException: Undefined method mapping: getAcl
      	at org.apache.oozie.client.rest.JsonToBean$JsonInvocationHandler.invoke(JsonToBean.java:217)
      	at com.sun.proxy.$Proxy4.getAcl(Unknown Source)
              ...
      

      There are a few inconsistencies including extra mappings, missing mappings, and missing information from the server.

      We should:

      1. Fix these inconsistencies.
      2. Write tests to prevent this sort of thing from happening in the future.

        Attachments

        1. OOZIE-2181.patch
          12 kB
          Robert Kanter

          Issue Links

            Activity

              People

              • Assignee:
                rkanter Robert Kanter
                Reporter:
                rkanter Robert Kanter
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: