You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by Andras Salamon <an...@melda.info> on 2018/08/01 10:48:10 UTC

Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/
-----------------------------------------------------------

Review request for oozie, András Piros and Kinga Marton.


Repository: oozie-git


Description
-------

Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.


Diffs
-----

  client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
  core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
  core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
  docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
  webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
  webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
  webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 


Diff: https://reviews.apache.org/r/68140/diff/1/


Testing
-------


Thanks,

Andras Salamon


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.

> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Line 66 (original), 91 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068368#file2068368line94>
> >
> >     Can we please apply some kind of object-oriented design pattern, like Builder, here? One huge builder with multiple child builders.
> >     
> >     I feel that too many `if-then-else` and too long methods are disturbing beyond readability / comprehension.
> >     
> >     I also would separate out different responsibilities to different, maybe nested, classes - and test them separately.

I created a separate SelectBuilder class and test it separately.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
> > Lines 69-78 (original), 68-94 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068369#file2068369line69>
> >
> >     This looks pretty terrible, please extract / restructure for better maintainability.

Removed this listing of the filter fields from here.


- Andras


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review206880
-----------------------------------------------------------


On Aug. 14, 2018, 9:22 a.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Aug. 14, 2018, 9:22 a.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SelectQuery.java PRE-CREATION 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSelectQuery.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/3/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.

> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > client/src/main/java/org/apache/oozie/client/OozieClient.java
> > Lines 177-204 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068364#file2068364line177>
> >
> >     Can you please structure that a bit more? Like having not `String` but `enum` instances, having a nested wrapper class...

Removed the filter field listing from this class.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/conf/action-conf/hive.xml
> > Line 28 (original), 28 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068365#file2068365line28>
> >
> >     Please revert this change.

Ooops. Missing git merge. Reverted.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/action/ActionExecutor.java
> > Line 606 (original), 606 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068366#file2068366line606>
> >
> >     Please revert this change.

Ooops. Missing git merge. Reverted.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
> > Line 1780 (original), 1780 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068367#file2068367line1780>
> >
> >     Please revert this change.

Ooops. Missing git merge. Reverted.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
> > Lines 1831-1834 (original)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068367#file2068367line1831>
> >
> >     Please revert this change.

Ooops. Missing git merge. Reverted.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 51-78 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068368#file2068368line52>
> >
> >     Can we extract that to a state object? Too many fields here, we're far away from Single Responsibility Principle.

Instead of using lots of fields, I store the (converted) values in a HashMap, which means we don't have to add a new field if we add additional filter fields.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 267-277 (original), 294-311 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068368#file2068368line340>
> >
> >     Please extract method.

jobExists variable has been eliminated. Most of this code moved to the SQL builder class.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 425-426 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068368#file2068368line475>
> >
> >     Here we're changing existing behavior. Any chance to create separate test for the change, plus document that?

I think the existing behaviour was incorrect, the second set call should overwrite the value and not only modify it. I've created a test method to check this. Same applies for the eventStatus field.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
> > Line 115 (original), 131 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068369#file2068369line132>
> >
> >     Can we please apply some kind of object-oriented design pattern, like Builder, here? One huge builder with multiple child builders.
> >     
> >     I feel that too many `if-then-else` and too long methods are disturbing beyond readability / comprehension.
> >     
> >     I also would separate out different responsibilities to different, maybe nested, classes - and test them separately.

I simplified the V2SLAServet class, it does not deal with the filter fields directly anymore. Adding a new field will be possible without modifing this class.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
> > Lines 136-141 (original), 153-175 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068369#file2068369line154>
> >
> >     This looks pretty terrible, again. What about applying some design pattern / restructuring the code?

I removed this whole part, this was not too useful.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
> > Lines 144-147 (original), 178-198 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068369#file2068369line179>
> >
> >     This looks pretty terrible, again. What about applying some design pattern / restructuring the code?

I also removed this part.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/action/hadoop/LauncherMainTester.java
> > Line 16 (original), 16 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068370#file2068370line16>
> >
> >     Please revert this change.

Reverted.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/action/oozie/TestSubWorkflowActionExecutor.java
> > Line 19 (original), 19 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068372#file2068372line19>
> >
> >     Please revert this change.

Reverted.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java
> > Lines 111-115 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068373#file2068373line111>
> >
> >     Please extract to separate test methods to provide an even more maintainable piece of code :)

Even more? :) 

I separated the test methods.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > docs/src/site/twiki/DG_SLAMonitoring.twiki
> > Lines 173-182 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068374#file2068374line173>
> >
> >     We'd need also `curl` based examples with sample JSON output for better user insight.

I've added samples similar to the already existing samples.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > release-log.txt
> > Lines 3-4 (original)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068375#file2068375line3>
> >
> >     Please revert this change.

Reverted.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > webapp/src/main/webapp/console/sla/js/oozie-sla.js
> > Line 29 (original), 29 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068377#file2068377line29>
> >
> >     Any chance to restructure? Too many `if-then-else` without providing readable code.

I replaced the if-then-else block with a for cycle. Only kept a couple of ifs because of the special handling of some of the fields.


> On Aug. 6, 2018, 12:14 p.m., András Piros wrote:
> > webapp/src/main/webapp/console/sla/js/oozie-sla.js
> > Lines 30-35 (original), 30-54 (patched)
> > <https://reviews.apache.org/r/68140/diff/2/?file=2068377#file2068377line30>
> >
> >     Any chance to restructure?

Eliminated most of the fields, only kept 2 because of the special handling.


- Andras


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review206880
-----------------------------------------------------------


On Aug. 14, 2018, 9:22 a.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Aug. 14, 2018, 9:22 a.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SelectQuery.java PRE-CREATION 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSelectQuery.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/3/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by András Piros via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review206880
-----------------------------------------------------------




client/src/main/java/org/apache/oozie/client/OozieClient.java
Lines 177-204 (patched)
<https://reviews.apache.org/r/68140/#comment289991>

    Can you please structure that a bit more? Like having not `String` but `enum` instances, having a nested wrapper class...



core/src/main/conf/action-conf/hive.xml
Line 28 (original), 28 (patched)
<https://reviews.apache.org/r/68140/#comment289985>

    Please revert this change.



core/src/main/java/org/apache/oozie/action/ActionExecutor.java
Line 606 (original), 606 (patched)
<https://reviews.apache.org/r/68140/#comment289986>

    Please revert this change.



core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
Line 1780 (original), 1780 (patched)
<https://reviews.apache.org/r/68140/#comment289987>

    Please revert this change.



core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
Lines 1831-1834 (original)
<https://reviews.apache.org/r/68140/#comment289988>

    Please revert this change.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 51-78 (patched)
<https://reviews.apache.org/r/68140/#comment289992>

    Can we extract that to a state object? Too many fields here, we're far away from Single Responsibility Principle.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 66 (original), 91 (patched)
<https://reviews.apache.org/r/68140/#comment289994>

    Can we please apply some kind of object-oriented design pattern, like Builder, here? One huge builder with multiple child builders.
    
    I feel that too many `if-then-else` and too long methods are disturbing beyond readability / comprehension.
    
    I also would separate out different responsibilities to different, maybe nested, classes - and test them separately.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 267-277 (original), 294-311 (patched)
<https://reviews.apache.org/r/68140/#comment289993>

    Please extract method.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 425-426 (patched)
<https://reviews.apache.org/r/68140/#comment289995>

    Here we're changing existing behavior. Any chance to create separate test for the change, plus document that?



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Lines 69-78 (original), 68-94 (patched)
<https://reviews.apache.org/r/68140/#comment289996>

    This looks pretty terrible, please extract / restructure for better maintainability.



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Line 115 (original), 131 (patched)
<https://reviews.apache.org/r/68140/#comment289999>

    Can we please apply some kind of object-oriented design pattern, like Builder, here? One huge builder with multiple child builders.
    
    I feel that too many `if-then-else` and too long methods are disturbing beyond readability / comprehension.
    
    I also would separate out different responsibilities to different, maybe nested, classes - and test them separately.



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Lines 136-141 (original), 153-175 (patched)
<https://reviews.apache.org/r/68140/#comment289997>

    This looks pretty terrible, again. What about applying some design pattern / restructuring the code?



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Lines 144-147 (original), 178-198 (patched)
<https://reviews.apache.org/r/68140/#comment289998>

    This looks pretty terrible, again. What about applying some design pattern / restructuring the code?



core/src/test/java/org/apache/oozie/action/hadoop/LauncherMainTester.java
Line 16 (original), 16 (patched)
<https://reviews.apache.org/r/68140/#comment289989>

    Please revert this change.



core/src/test/java/org/apache/oozie/action/oozie/TestSubWorkflowActionExecutor.java
Line 19 (original), 19 (patched)
<https://reviews.apache.org/r/68140/#comment289990>

    Please revert this change.



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java
Lines 111-115 (patched)
<https://reviews.apache.org/r/68140/#comment290000>

    Please extract to separate test methods to provide an even more maintainable piece of code :)



docs/src/site/twiki/DG_SLAMonitoring.twiki
Lines 173-182 (patched)
<https://reviews.apache.org/r/68140/#comment290001>

    We'd need also `curl` based examples with sample JSON output for better user insight.



release-log.txt
Lines 3-4 (original)
<https://reviews.apache.org/r/68140/#comment289984>

    Please revert this change.



webapp/src/main/webapp/console/sla/js/oozie-sla.js
Line 29 (original), 29 (patched)
<https://reviews.apache.org/r/68140/#comment290003>

    Any chance to restructure? Too many `if-then-else` without providing readable code.



webapp/src/main/webapp/console/sla/js/oozie-sla.js
Lines 30-35 (original), 30-54 (patched)
<https://reviews.apache.org/r/68140/#comment290002>

    Any chance to restructure?


- András Piros


On Aug. 6, 2018, 7:35 a.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Aug. 6, 2018, 7:35 a.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/conf/action-conf/hive.xml fc02e25b 
>   core/src/main/java/org/apache/oozie/action/ActionExecutor.java 1770b973 
>   core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java 8f0f2440 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/action/hadoop/LauncherMainTester.java ada7005e 
>   core/src/test/java/org/apache/oozie/action/hadoop/SleepMapperReducerForTest.java 846441fd 
>   core/src/test/java/org/apache/oozie/action/oozie/TestSubWorkflowActionExecutor.java 893405e3 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   release-log.txt 5100d97d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review207886
-----------------------------------------------------------



I'm not yet finished, but I save a few comments.


core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 67-69 (patched)
<https://reviews.apache.org/r/68140/#comment291501>

    static is redundant for inner enums



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 71 (patched)
<https://reviews.apache.org/r/68140/#comment291502>

    static is redundant for inner enums



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 98 (patched)
<https://reviews.apache.org/r/68140/#comment291655>

    I eliminated the field, but use the fact that the name of the filter is the lower case version of the enum name.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 99-100 (patched)
<https://reviews.apache.org/r/68140/#comment291689>

    dbFieldName can only be calculated for the simple filter fields (like app_name). There are lots of exceptions like _START, _END, _MIN, _MAX fields and the very special fields like ID, PARENT_ID, BUNDLE.
    
    I've started to implement db type reading, but I reverted it. The code was not too nice, and later I realized that enum fields (SLAStatus, EventStatus) are stored as simple String fields.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 134-139 (patched)
<https://reviews.apache.org/r/68140/#comment291654>

    Since we already use the fact (based on your previous suggestion) that the filter name is the lower case version of the enum name, a simple valueOf is enough here (plus a few checks).



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 202 (original), 190 (patched)
<https://reviews.apache.org/r/68140/#comment291498>

    Ooops. try-catch is no longer needed here.



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 40 (patched)
<https://reviews.apache.org/r/68140/#comment291653>

    We are expecting this exception, so I only added comment here.



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 53 (patched)
<https://reviews.apache.org/r/68140/#comment291652>

    We are expecting this exception, so I only added a comment here.



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 165 (patched)
<https://reviews.apache.org/r/68140/#comment291656>

    We are expecting this exception, so I only added a comment here.


- Andras Salamon


On Aug. 23, 2018, 3:27 p.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Aug. 23, 2018, 3:27 p.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/4/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.

> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 68-164 (original), 156-183 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076537#file2076537line170>
> >
> >     I feel the need to extract the creation of the `CriteriaQuery` to another, maybe nested, class - for the sake of better testability.

There are so many references to FilterField enum, that the new class would not be too useful here. I've created smaller methods to make the code a little bit easier to understand.


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 342-354 (original), 317-326 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076537#file2076537line537>
> >
> >     Part of a nested class, maybe?

I created a nested class FilterCollection to store the hashmap and the get and set filterfield methods. After our discussion I wanted to put the FilterField enum into this class, but I cannot put a static class (enum) into a non-static inner class.


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
> > Lines 222-229 (original), 152-178 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076538#file2076538line222>
> >
> >     Part of a nested class, for better testability

I've created a FilterParser class (+unit tests for this class). Later other parts of oozie should also use this class (OOZIE-3335).


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > webapp/src/main/webapp/console/sla/css/oozie-sla.css
> > Line 45 (original), 45 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076542#file2076542line45>
> >
> >     Did you test that on a pseudo-distributed Oozie?

Yes, I tested it when I modified the css/html/js. I'd like to test it one more time before commit.


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > webapp/src/main/webapp/console/sla/js/oozie-sla.js
> > Lines 29-31 (original), 25-41 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076543#file2076543line29>
> >
> >     Did you test that on a pseudo-distributed Oozie?

Yes, I tested it when I modified the css/html/js. I'd like to test it one more time before commit.


- Andras


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review207874
-----------------------------------------------------------


On Aug. 23, 2018, 3:27 p.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Aug. 23, 2018, 3:27 p.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/4/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.

> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 67-69 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076537#file2076537line80>
> >
> >     Could be `static`

static is redundant for inner enums


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 71 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076537#file2076537line84>
> >
> >     Could be `static`

static is redundant for inner enums


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 98 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076537#file2076537line111>
> >
> >     I'd rather calculate `getColumnName()` as `this.name().toLowerCase()`.

eliminated the field, but use the fact that the name of the filter is the lower case version of the enum name.


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 99-100 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076537#file2076537line112>
> >
> >     Aren't `type` and `dbFieldName` somehow computable / readable via reflection from the actual `Entity` classes?
> >     
> >     This would provide a single reason for change as in SRP, single point being only the `Entity` classes' field definitions.

dbFieldName can only be calculated for the simple filter fields (like app_name). There are lots of exceptions like _START, _END, _MIN, _MAX fields and the very special fields like ID, PARENT_ID, BUNDLE.

I've started to implement db type reading, but I reverted it. The code was not too nice, and later I realized that enum fields (SLAStatus, EventStatus) are stored as simple String fields.


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 134-139 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076537#file2076537line147>
> >
> >     Isn't Guava's `Lists#newArrayList(Iterables#filter(original, predicate))` a better option?

Since we already use the fact (based on your previous suggestion) that the filter name is the lower case version of the enum name, a simple valueOf is enough here (plus a few checks).


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Line 202 (original), 190 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076537#file2076537line307>
> >
> >     We should list the possible `Exception` subclasses rather than one single general `catch` clause.

Ooops. try-catch is no longer needed here.


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
> > Lines 40 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076539#file2076539line40>
> >
> >     `ignored`

We are expecting this exception, so I only added comment here.


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
> > Lines 53 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076539#file2076539line53>
> >
> >     `ignored`

We are expecting this exception, so I only added comment here.


> On Aug. 24, 2018, 2:05 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
> > Lines 165 (patched)
> > <https://reviews.apache.org/r/68140/diff/4/?file=2076539#file2076539line165>
> >
> >     `ignored`

We are expecting this exception, so I only added comment here.


- Andras


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review207874
-----------------------------------------------------------


On Aug. 23, 2018, 3:27 p.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Aug. 23, 2018, 3:27 p.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/4/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by András Piros via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review207874
-----------------------------------------------------------




core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 67-69 (patched)
<https://reviews.apache.org/r/68140/#comment291431>

    Could be `static`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 71 (patched)
<https://reviews.apache.org/r/68140/#comment291432>

    Could be `static`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 98 (patched)
<https://reviews.apache.org/r/68140/#comment291433>

    I'd rather calculate `getColumnName()` as `this.name().toLowerCase()`.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 99-100 (patched)
<https://reviews.apache.org/r/68140/#comment291434>

    Aren't `type` and `dbFieldName` somehow computable / readable via reflection from the actual `Entity` classes?
    
    This would provide a single reason for change as in SRP, single point being only the `Entity` classes' field definitions.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 112-130 (patched)
<https://reviews.apache.org/r/68140/#comment291437>

    Shouldn't we use the Criteria API to return the appropriate type (after conversion if needed) instead?



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 134-139 (patched)
<https://reviews.apache.org/r/68140/#comment291436>

    Isn't Guava's `Lists#newArrayList(Iterables#filter(original, predicate))` a better option?



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 68-164 (original), 156-183 (patched)
<https://reviews.apache.org/r/68140/#comment291439>

    I feel the need to extract the creation of the `CriteriaQuery` to another, maybe nested, class - for the sake of better testability.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 200 (original), 188 (patched)
<https://reviews.apache.org/r/68140/#comment291440>

    You can use placeholder like `{0}` instead of `String` concatenation. Otherwise, big thumbs up :)



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 202 (original), 190 (patched)
<https://reviews.apache.org/r/68140/#comment291441>

    We should list the possible `Exception` subclasses rather than one single general `catch` clause.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 214-217 (original), 196-200 (patched)
<https://reviews.apache.org/r/68140/#comment291442>

    Needs better, more intuitive naming



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 202 (patched)
<https://reviews.apache.org/r/68140/#comment291443>

    Needs better, more intuitive naming



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 245 (original), 220 (patched)
<https://reviews.apache.org/r/68140/#comment291444>

    Needs better, more intuitive naming



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 330 (original), 238 (patched)
<https://reviews.apache.org/r/68140/#comment291445>

    Needs better, more intuitive naming



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 246-249 (patched)
<https://reviews.apache.org/r/68140/#comment291446>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 253-257 (patched)
<https://reviews.apache.org/r/68140/#comment291447>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 259-261 (patched)
<https://reviews.apache.org/r/68140/#comment291448>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 266-268 (patched)
<https://reviews.apache.org/r/68140/#comment291449>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 273-275 (patched)
<https://reviews.apache.org/r/68140/#comment291450>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 278 (patched)
<https://reviews.apache.org/r/68140/#comment291451>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 283-285 (patched)
<https://reviews.apache.org/r/68140/#comment291452>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 290-292 (patched)
<https://reviews.apache.org/r/68140/#comment291453>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 295-297 (patched)
<https://reviews.apache.org/r/68140/#comment291454>

    Extract magic `String`s to constant values



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 302 (patched)
<https://reviews.apache.org/r/68140/#comment291455>

    Extract to a well-named method so that it's understandable



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 332 (original), 308-311 (patched)
<https://reviews.apache.org/r/68140/#comment291456>

    We should also `LOG.error()` and look that we have at least the filter `name` in the log message.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 342-354 (original), 317-326 (patched)
<https://reviews.apache.org/r/68140/#comment291457>

    Part of a nested class, maybe?



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Line 140 (original), 111 (patched)
<https://reviews.apache.org/r/68140/#comment291458>

    Need to extract `value.get(0)` to a well-named variable



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Lines 222-229 (original), 152-178 (patched)
<https://reviews.apache.org/r/68140/#comment291459>

    Part of a nested class, for better testability



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Line 223 (original), 153 (patched)
<https://reviews.apache.org/r/68140/#comment291463>

    Well-named variable



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Lines 161-162 (patched)
<https://reviews.apache.org/r/68140/#comment291461>

    Extract method



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Lines 164 (patched)
<https://reviews.apache.org/r/68140/#comment291465>

    Well-named variable



core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java
Lines 172-173 (patched)
<https://reviews.apache.org/r/68140/#comment291462>

    Reuse extracted method



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 31 (patched)
<https://reviews.apache.org/r/68140/#comment291483>

    Nice job in general.
    
    I'd rather separately test the extracted `CriteriaQuery` construction related nested class in a test class which doesn't necessarily needs to `extend XDataTestCase`, and here only test the integration part, calling `entityManager` w/ mock `CriteriaQuery` instances.



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 34-35 (patched)
<https://reviews.apache.org/r/68140/#comment291471>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 40 (patched)
<https://reviews.apache.org/r/68140/#comment291470>

    `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 47-48 (patched)
<https://reviews.apache.org/r/68140/#comment291472>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 53 (patched)
<https://reviews.apache.org/r/68140/#comment291485>

    `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 60-61 (patched)
<https://reviews.apache.org/r/68140/#comment291473>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 63-83 (patched)
<https://reviews.apache.org/r/68140/#comment291487>

    Those `setFilterField()` / `assertEquals()` pairs could well be extracted to a method



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 91-92 (patched)
<https://reviews.apache.org/r/68140/#comment291474>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 94-105 (patched)
<https://reviews.apache.org/r/68140/#comment291488>

    Those `setFilterField()` / `assertEquals()` pairs could well be extracted to a method



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 113-114 (patched)
<https://reviews.apache.org/r/68140/#comment291475>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 120-151 (patched)
<https://reviews.apache.org/r/68140/#comment291489>

    Those `setFilterField()` / `assertEquals()` pairs could well be extracted to a method



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 159-160 (patched)
<https://reviews.apache.org/r/68140/#comment291476>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 165 (patched)
<https://reviews.apache.org/r/68140/#comment291486>

    `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 173-174 (patched)
<https://reviews.apache.org/r/68140/#comment291477>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 188-189 (patched)
<https://reviews.apache.org/r/68140/#comment291478>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 204-205 (patched)
<https://reviews.apache.org/r/68140/#comment291479>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 220-221 (patched)
<https://reviews.apache.org/r/68140/#comment291480>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 236-237 (patched)
<https://reviews.apache.org/r/68140/#comment291481>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 253-254 (patched)
<https://reviews.apache.org/r/68140/#comment291482>

    Should rather be a field initialized in `setUp()`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 265-266 (patched)
<https://reviews.apache.org/r/68140/#comment291490>

    Formatting errors



docs/src/site/twiki/DG_SLAMonitoring.twiki
Lines 173-186 (patched)
<https://reviews.apache.org/r/68140/#comment291491>

    Would need even more examples here covering single aspects and a mix of those.



docs/src/site/twiki/DG_SLAMonitoring.twiki
Lines 450 (patched)
<https://reviews.apache.org/r/68140/#comment291492>

    `,` to be placed to the end of the previous line



webapp/src/main/webapp/console/sla/css/oozie-sla.css
Line 45 (original), 45 (patched)
<https://reviews.apache.org/r/68140/#comment291494>

    Did you test that on a pseudo-distributed Oozie?



webapp/src/main/webapp/console/sla/js/oozie-sla.js
Lines 29-31 (original), 25-41 (patched)
<https://reviews.apache.org/r/68140/#comment291493>

    Did you test that on a pseudo-distributed Oozie?


- András Piros


On Aug. 23, 2018, 3:27 p.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Aug. 23, 2018, 3:27 p.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/4/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by András Piros via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review208701
-----------------------------------------------------------



Great work thus far! Only a couple of thingies left.


core/src/main/java/org/apache/oozie/FilterParser.java
Lines 44-45 (patched)
<https://reviews.apache.org/r/68140/#comment292832>

    What about using Guava's [SortedSetMultimap](https://google.github.io/guava/releases/21.0/api/docs/com/google/common/collect/SortedSetMultimap.html) instead?



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 101-108 (patched)
<https://reviews.apache.org/r/68140/#comment292833>

    Would need a short example of a bundle ID here, to better see what's this regexp all about.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 68-75 (original), 123-130 (patched)
<https://reviews.apache.org/r/68140/#comment292834>

    Any ideas of better names here? The format `*START_START` and `*END_END` isn't easily understandable.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 115 (original), 202 (patched)
<https://reviews.apache.org/r/68140/#comment292840>

    Should be `static class` if possible.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 116 (original), 203 (patched)
<https://reviews.apache.org/r/68140/#comment292841>

    `LinkedHashMap` would be a better choice, for maintaining the insertion order.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 268 (patched)
<https://reviews.apache.org/r/68140/#comment292835>

    Why not use `SLASummaryGetForFilterJPAExecutor.class.getSimpleName()` instead?



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 32 (patched)
<https://reviews.apache.org/r/68140/#comment292836>

    Why not use `@Test` annotations and not `extends TestCase` instead?



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 83-86 (patched)
<https://reviews.apache.org/r/68140/#comment292837>

    This stuff would be also simpler using Guava's `OrderedSetMultimap`.



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 91-96 (patched)
<https://reviews.apache.org/r/68140/#comment292838>

    This stuff would be also simpler using Guava's `OrderedSetMultimap`.



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 101-104 (patched)
<https://reviews.apache.org/r/68140/#comment292839>

    This stuff would be also simpler using Guava's `OrderedSetMultimap`.



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 58-60 (patched)
<https://reviews.apache.org/r/68140/#comment292842>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 69-71 (patched)
<https://reviews.apache.org/r/68140/#comment292843>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 80-82 (patched)
<https://reviews.apache.org/r/68140/#comment292844>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 90-92 (patched)
<https://reviews.apache.org/r/68140/#comment292845>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 136-138 (patched)
<https://reviews.apache.org/r/68140/#comment292846>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 147-149 (patched)
<https://reviews.apache.org/r/68140/#comment292847>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 193-195 (patched)
<https://reviews.apache.org/r/68140/#comment292848>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 207-209 (patched)
<https://reviews.apache.org/r/68140/#comment292849>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 221-223 (patched)
<https://reviews.apache.org/r/68140/#comment292850>

    Is it still needed as we use `ExpectedException`?



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 232-234 (patched)
<https://reviews.apache.org/r/68140/#comment292851>

    Is it still needed as we use `ExpectedException`?



webapp/src/main/webapp/console/sla/js/oozie-sla.js
Lines 36 (patched)
<https://reviews.apache.org/r/68140/#comment292852>

    Please insert spaces around Javascript string concatenation.



webapp/src/main/webapp/console/sla/js/oozie-sla.js
Lines 38 (patched)
<https://reviews.apache.org/r/68140/#comment292853>

    Please insert spaces around Javascript string concatenation.



webapp/src/main/webapp/console/sla/js/oozie-sla.js
Line 54 (original), 54 (patched)
<https://reviews.apache.org/r/68140/#comment292854>

    Please insert spaces around Javascript string concatenation.


- András Piros


On Sept. 18, 2018, 7:46 a.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Sept. 18, 2018, 7:46 a.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532f 
>   client/src/main/java/org/apache/oozie/client/rest/RestConstants.java 9873ff3ad 
>   core/src/main/java/org/apache/oozie/FilterParser.java PRE-CREATION 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e98 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e06 
>   core/src/test/java/org/apache/oozie/TestFilterParser.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225b 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletIntegration.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletSLAJSONResponse.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java PRE-CREATION 
>   docs/src/site/markdown/DG_SLAMonitoring.md 0831b93bd 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deeec 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228a 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275a 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/6/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by András Piros via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review208795
-----------------------------------------------------------


Ship it!




Ship It!

- András Piros


On Sept. 19, 2018, 4:07 p.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Sept. 19, 2018, 4:07 p.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532f 
>   client/src/main/java/org/apache/oozie/client/rest/RestConstants.java 9873ff3ad 
>   core/src/main/java/org/apache/oozie/FilterParser.java PRE-CREATION 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e98 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e06 
>   core/src/test/java/org/apache/oozie/TestFilterParser.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225b 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletIntegration.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletSLAJSONResponse.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java PRE-CREATION 
>   docs/src/site/markdown/DG_SLAMonitoring.md 0831b93bd 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deeec 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228a 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275a 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/7/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/
-----------------------------------------------------------

(Updated Sept. 19, 2018, 4:07 p.m.)


Review request for oozie, András Piros and Kinga Marton.


Changes
-------

Adressing reviewer issues.


Repository: oozie-git


Description
-------

Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.


Diffs (updated)
-----

  client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532f 
  client/src/main/java/org/apache/oozie/client/rest/RestConstants.java 9873ff3ad 
  core/src/main/java/org/apache/oozie/FilterParser.java PRE-CREATION 
  core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e98 
  core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e06 
  core/src/test/java/org/apache/oozie/TestFilterParser.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225b 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletIntegration.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletSLAJSONResponse.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java PRE-CREATION 
  docs/src/site/markdown/DG_SLAMonitoring.md 0831b93bd 
  webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deeec 
  webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228a 
  webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275a 


Diff: https://reviews.apache.org/r/68140/diff/7/

Changes: https://reviews.apache.org/r/68140/diff/6-7/


Testing
-------


Thanks,

Andras Salamon


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/
-----------------------------------------------------------

(Updated Sept. 18, 2018, 7:46 a.m.)


Review request for oozie, András Piros and Kinga Marton.


Repository: oozie-git


Description
-------

Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.


Diffs (updated)
-----

  client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532f 
  client/src/main/java/org/apache/oozie/client/rest/RestConstants.java 9873ff3ad 
  core/src/main/java/org/apache/oozie/FilterParser.java PRE-CREATION 
  core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e98 
  core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e06 
  core/src/test/java/org/apache/oozie/TestFilterParser.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225b 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletIntegration.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletSLAJSONResponse.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java PRE-CREATION 
  docs/src/site/markdown/DG_SLAMonitoring.md 0831b93bd 
  webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deeec 
  webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228a 
  webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275a 


Diff: https://reviews.apache.org/r/68140/diff/6/

Changes: https://reviews.apache.org/r/68140/diff/5-6/


Testing
-------


Thanks,

Andras Salamon


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.

> On Sept. 4, 2018, 12:25 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 218 (patched)
> > <https://reviews.apache.org/r/68140/diff/5/?file=2082094#file2082094line430>
> >
> >     Always `ORDER BY NOMINAL_TIME`?

Added sortby and order parameters similar to job filter. To avoid undefined ordering I always add a second order by nominal_time. I'm not sure about this.


> On Sept. 4, 2018, 12:25 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 228-239 (patched)
> > <https://reviews.apache.org/r/68140/diff/5/?file=2082094#file2082094line440>
> >
> >     I'm thinking whether `fieldName LIKE '%fieldValue%'` can / should be supported.

Added support for like. I'm not sure if % and _ is suitable for the users. Maybe we should allow only * (and convert it to %) instead.


> On Sept. 4, 2018, 12:25 p.m., András Piros wrote:
> > core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
> > Lines 296-354 (patched)
> > <https://reviews.apache.org/r/68140/diff/5/?file=2082094#file2082094line512>
> >
> >     Isn't it possible to use the Visitor design pattern instead? Or, at the very least, extract the `case` contents to well named methods?

Create an enum based strategy like solution.


> On Sept. 4, 2018, 12:25 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletRun.java
> > Lines 30 (patched)
> > <https://reviews.apache.org/r/68140/diff/5/?file=2082101#file2082101line30>
> >
> >     `TestIntegrationV2SLAServlet` might be a better name

Using TestV2SLAServletIntegration instead, to keep it similar to the other test class names.


> On Sept. 4, 2018, 12:25 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java
> > Lines 38 (patched)
> > <https://reviews.apache.org/r/68140/diff/5/?file=2082102#file2082102line38>
> >
> >     I'm wondering why we have to `extends XDataTestCase` and why this class has to be extended instead of being a composite in the caller class.

We need createBundleJob method for instance.

I created two classes because half of the methods were using one type of setup method, the other half was using a different type of setup method.


> On Sept. 4, 2018, 12:25 p.m., András Piros wrote:
> > core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java
> > Lines 45-46 (patched)
> > <https://reviews.apache.org/r/68140/diff/5/?file=2082102#file2082102line45>
> >
> >     Sure it isn't handled by ancestors?

Yes, I've tested without this.


- Andras


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review208294
-----------------------------------------------------------


On Sept. 18, 2018, 7:46 a.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Sept. 18, 2018, 7:46 a.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532f 
>   client/src/main/java/org/apache/oozie/client/rest/RestConstants.java 9873ff3ad 
>   core/src/main/java/org/apache/oozie/FilterParser.java PRE-CREATION 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e98 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e06 
>   core/src/test/java/org/apache/oozie/TestFilterParser.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225b 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletIntegration.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletSLAJSONResponse.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java PRE-CREATION 
>   docs/src/site/markdown/DG_SLAMonitoring.md 0831b93bd 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deeec 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228a 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275a 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/6/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by András Piros via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review208294
-----------------------------------------------------------




core/src/main/java/org/apache/oozie/FilterParser.java
Lines 49 (patched)
<https://reviews.apache.org/r/68140/#comment292030>

    Use `PARAMETER_EQUALS`



core/src/main/java/org/apache/oozie/FilterParser.java
Lines 56 (patched)
<https://reviews.apache.org/r/68140/#comment292031>

    `Strings.isNullOrEmpty()`



core/src/main/java/org/apache/oozie/FilterParser.java
Lines 74-78 (patched)
<https://reviews.apache.org/r/68140/#comment292032>

    Here we could give a bit more context to the caller, we already have that



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 57 (original), 85 (patched)
<https://reviews.apache.org/r/68140/#comment292033>

    Javadoc comment on this `Pattern`, plus I think the Ascii part (`oozie-${USER_NAME_TRUNCATED_TO_$_CHARS}`) cannot be of arbitrary length.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 118-120 (patched)
<https://reviews.apache.org/r/68140/#comment292049>

    Could be `final`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 122 (patched)
<https://reviews.apache.org/r/68140/#comment292050>

    Could be `final`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 128 (patched)
<https://reviews.apache.org/r/68140/#comment292051>

    Can be `final`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 130 (patched)
<https://reviews.apache.org/r/68140/#comment292052>

    `field.type.equals()`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 133 (patched)
<https://reviews.apache.org/r/68140/#comment292053>

    `field.type.equals()`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 137 (patched)
<https://reviews.apache.org/r/68140/#comment292054>

    `field.type.equals()`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 213-214 (patched)
<https://reviews.apache.org/r/68140/#comment292055>

    Would extract to some method like `ensureCriteriaFields()`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 215-216 (patched)
<https://reviews.apache.org/r/68140/#comment292056>

    Extract to `createSelectFrom()`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 218 (patched)
<https://reviews.apache.org/r/68140/#comment292057>

    Always `ORDER BY NOMINAL_TIME`?



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 228-239 (patched)
<https://reviews.apache.org/r/68140/#comment292058>

    I'm thinking whether `fieldName LIKE '%fieldValue%'` can / should be supported.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 255 (patched)
<https://reviews.apache.org/r/68140/#comment292059>

    `FilterField.PARENT_ID.dbFieldName`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 273 (patched)
<https://reviews.apache.org/r/68140/#comment292060>

    Instead, code would be a bit cleaner if following would be used:
    ```
    if (bundle == null) {
      return;
    }
    ```



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 295 (patched)
<https://reviews.apache.org/r/68140/#comment292061>

    Special handling of unparseable `event_status` value



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 296-354 (patched)
<https://reviews.apache.org/r/68140/#comment292062>

    Isn't it possible to use the Visitor design pattern instead? Or, at the very least, extract the `case` contents to well named methods?



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 30 (patched)
<https://reviews.apache.org/r/68140/#comment292063>

    Needn't and shouldn't `extends XTestCase`



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 45 (patched)
<https://reviews.apache.org/r/68140/#comment292064>

    Rather use `ExpectedException`



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 47-50 (patched)
<https://reviews.apache.org/r/68140/#comment292068>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 57 (patched)
<https://reviews.apache.org/r/68140/#comment292065>

    Rather use `ExpectedException`



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 59-62 (patched)
<https://reviews.apache.org/r/68140/#comment292069>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 69 (patched)
<https://reviews.apache.org/r/68140/#comment292066>

    Rather use `ExpectedException`



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 71-74 (patched)
<https://reviews.apache.org/r/68140/#comment292070>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 81 (patched)
<https://reviews.apache.org/r/68140/#comment292067>

    Rather use `ExpectedException`



core/src/test/java/org/apache/oozie/TestFilterParser.java
Lines 83-86 (patched)
<https://reviews.apache.org/r/68140/#comment292071>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 31 (patched)
<https://reviews.apache.org/r/68140/#comment292096>

    I'm wondering whether `TestSLASummaryGetForFilterJPAExecutorFilterCollection` already covers that part of the code in sufficient detail



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 44-47 (patched)
<https://reviews.apache.org/r/68140/#comment292072>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 57-60 (patched)
<https://reviews.apache.org/r/68140/#comment292073>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 70-73 (patched)
<https://reviews.apache.org/r/68140/#comment292074>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 84-87 (patched)
<https://reviews.apache.org/r/68140/#comment292075>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 141-144 (patched)
<https://reviews.apache.org/r/68140/#comment292078>

    Instead of this comment, rather use a name like `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 152-161 (patched)
<https://reviews.apache.org/r/68140/#comment292079>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 165-175 (patched)
<https://reviews.apache.org/r/68140/#comment292080>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 179-189 (patched)
<https://reviews.apache.org/r/68140/#comment292081>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 193-203 (patched)
<https://reviews.apache.org/r/68140/#comment292082>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 207-218 (patched)
<https://reviews.apache.org/r/68140/#comment292083>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java
Lines 222-233 (patched)
<https://reviews.apache.org/r/68140/#comment292084>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 31 (patched)
<https://reviews.apache.org/r/68140/#comment292085>

    Use single class imports



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 33 (patched)
<https://reviews.apache.org/r/68140/#comment292088>

    Do we need `extends XTestCase`?
    
    I'm wondering whether `TestSLASummaryGetForFilterJPAExecutor` already covers that part of the code in sufficient detail



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 46 (patched)
<https://reviews.apache.org/r/68140/#comment292089>

    `ExpectedException`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 47-50 (patched)
<https://reviews.apache.org/r/68140/#comment292086>

    `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 59 (patched)
<https://reviews.apache.org/r/68140/#comment292090>

    `ExpectedException`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 60-63 (patched)
<https://reviews.apache.org/r/68140/#comment292087>

    `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 72 (patched)
<https://reviews.apache.org/r/68140/#comment292091>

    `ExpectedException`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 73-76 (patched)
<https://reviews.apache.org/r/68140/#comment292094>

    `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 85 (patched)
<https://reviews.apache.org/r/68140/#comment292092>

    `ExpectedException`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 87-90 (patched)
<https://reviews.apache.org/r/68140/#comment292095>

    `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 142 (patched)
<https://reviews.apache.org/r/68140/#comment292093>

    `ExpectedException`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 144-147 (patched)
<https://reviews.apache.org/r/68140/#comment292097>

    `ignored`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 155-164 (patched)
<https://reviews.apache.org/r/68140/#comment292098>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 168-178 (patched)
<https://reviews.apache.org/r/68140/#comment292099>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 182-192 (patched)
<https://reviews.apache.org/r/68140/#comment292100>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 196-205 (patched)
<https://reviews.apache.org/r/68140/#comment292101>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 209-219 (patched)
<https://reviews.apache.org/r/68140/#comment292102>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java
Lines 223-233 (patched)
<https://reviews.apache.org/r/68140/#comment292103>

    Could extract method `checkSetAndAssertFilterField(String, List<String>)`



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java
Lines 34 (patched)
<https://reviews.apache.org/r/68140/#comment292104>

    `TestV2SLAServletSLAJSONResponse` would be a better name



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 128 (patched)
<https://reviews.apache.org/r/68140/#comment292105>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 140-142 (patched)
<https://reviews.apache.org/r/68140/#comment292106>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 184-186 (patched)
<https://reviews.apache.org/r/68140/#comment292107>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 196 (patched)
<https://reviews.apache.org/r/68140/#comment292108>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 199 (patched)
<https://reviews.apache.org/r/68140/#comment292109>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 201 (patched)
<https://reviews.apache.org/r/68140/#comment292110>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 203 (patched)
<https://reviews.apache.org/r/68140/#comment292111>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 211 (patched)
<https://reviews.apache.org/r/68140/#comment292112>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 214 (patched)
<https://reviews.apache.org/r/68140/#comment292113>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 216 (patched)
<https://reviews.apache.org/r/68140/#comment292114>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 218 (patched)
<https://reviews.apache.org/r/68140/#comment292115>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 226 (patched)
<https://reviews.apache.org/r/68140/#comment292116>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 229 (patched)
<https://reviews.apache.org/r/68140/#comment292117>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 231-234 (patched)
<https://reviews.apache.org/r/68140/#comment292118>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 242 (patched)
<https://reviews.apache.org/r/68140/#comment292119>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 246 (patched)
<https://reviews.apache.org/r/68140/#comment292120>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 249 (patched)
<https://reviews.apache.org/r/68140/#comment292121>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 259 (patched)
<https://reviews.apache.org/r/68140/#comment292122>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 261-262 (patched)
<https://reviews.apache.org/r/68140/#comment292123>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java
Lines 264-269 (patched)
<https://reviews.apache.org/r/68140/#comment292124>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletRun.java
Lines 30 (patched)
<https://reviews.apache.org/r/68140/#comment292125>

    `TestIntegrationV2SLAServlet` might be a better name



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletRun.java
Lines 35-44 (patched)
<https://reviews.apache.org/r/68140/#comment292126>

    Extract method `callHttpEndpointAndAssertResponse(Map<String, String> filterParams, int expectedResponseCode)`



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletRun.java
Lines 48-58 (patched)
<https://reviews.apache.org/r/68140/#comment292127>

    Extract method `callHttpEndpointAndAssertResponse(Map<String, String> filterParams, int expectedResponseCode)`



core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletRun.java
Lines 62-72 (patched)
<https://reviews.apache.org/r/68140/#comment292128>

    Extract method `callHttpEndpointAndAssertResponse(Map<String, String> filterParams, int expectedResponseCode)`



core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java
Lines 38 (patched)
<https://reviews.apache.org/r/68140/#comment292132>

    I'm wondering why we have to `extends XDataTestCase` and why this class has to be extended instead of being a composite in the caller class.



core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java
Lines 45-46 (patched)
<https://reviews.apache.org/r/68140/#comment292133>

    Sure it isn't handled by ancestors?



core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java
Lines 112 (patched)
<https://reviews.apache.org/r/68140/#comment292130>

    Assertion message missing



core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java
Lines 121-133 (patched)
<https://reviews.apache.org/r/68140/#comment292131>

    Assertion message missing



docs/src/site/twiki/DG_SLAMonitoring.twiki
Lines 175 (patched)
<https://reviews.apache.org/r/68140/#comment292134>

    Login name? First / last name?



docs/src/site/twiki/DG_SLAMonitoring.twiki
Lines 176-182 (patched)
<https://reviews.apache.org/r/68140/#comment292135>

    Any checks between start and end timestamps?



docs/src/site/twiki/DG_SLAMonitoring.twiki
Lines 184 (patched)
<https://reviews.apache.org/r/68140/#comment292136>

    `=event_status=`, `=sla_status=`



docs/src/site/twiki/DG_SLAMonitoring.twiki
Lines 345 (patched)
<https://reviews.apache.org/r/68140/#comment292137>

    The latter `actualstart_start` has to be `actualstart_end`


- András Piros


On Sept. 4, 2018, 8:36 a.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Sept. 4, 2018, 8:36 a.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/FilterParser.java PRE-CREATION 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/TestFilterParser.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletRun.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java PRE-CREATION 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/5/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/
-----------------------------------------------------------

(Updated Sept. 4, 2018, 8:36 a.m.)


Review request for oozie, András Piros and Kinga Marton.


Changes
-------

I also separated TestV2SLAServlet into multiple classes: TestV2SLAServlet, TestV2SLAServletBundle, TestV2SLAServletRun


Repository: oozie-git


Description
-------

Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.


Diffs (updated)
-----

  client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
  core/src/main/java/org/apache/oozie/FilterParser.java PRE-CREATION 
  core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
  core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
  core/src/test/java/org/apache/oozie/TestFilterParser.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutorFilterCollection.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletBundle.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServletRun.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/V2SLAServletTestCase.java PRE-CREATION 
  docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
  webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
  webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
  webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 


Diff: https://reviews.apache.org/r/68140/diff/5/

Changes: https://reviews.apache.org/r/68140/diff/4-5/


Testing
-------


Thanks,

Andras Salamon


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by András Piros via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review207659
-----------------------------------------------------------




client/src/main/java/org/apache/oozie/client/OozieClient.java
Line 155 (original), 155 (patched)
<https://reviews.apache.org/r/68140/#comment291119>

    Dead code



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 9-11 (original), 9-11 (patched)
<https://reviews.apache.org/r/68140/#comment291121>

    Violates RAT license header checks



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Line 22 (original), 22 (patched)
<https://reviews.apache.org/r/68140/#comment291120>

    Please use single class imports only.



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 50-51 (patched)
<https://reviews.apache.org/r/68140/#comment291122>

    Can be `final`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 53 (patched)
<https://reviews.apache.org/r/68140/#comment291123>

    Can be `final`



core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java
Lines 55-70 (patched)
<https://reviews.apache.org/r/68140/#comment291124>

    Can be `static`


- András Piros


On Aug. 23, 2018, 3:27 p.m., Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated Aug. 23, 2018, 3:27 p.m.)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/4/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/
-----------------------------------------------------------

(Updated Aug. 23, 2018, 3:27 p.m.)


Review request for oozie, András Piros and Kinga Marton.


Changes
-------

Removing my SelectQuery (+builder) class, using JPA CriteriaAPI instead.


Repository: oozie-git


Description
-------

Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.


Diffs (updated)
-----

  client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
  core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
  core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
  core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
  docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
  webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
  webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
  webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 


Diff: https://reviews.apache.org/r/68140/diff/4/

Changes: https://reviews.apache.org/r/68140/diff/3-4/


Testing
-------


Thanks,

Andras Salamon


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/
-----------------------------------------------------------

(Updated Aug. 14, 2018, 9:22 a.m.)


Review request for oozie, András Piros and Kinga Marton.


Changes
-------

Refactored the code, to keep filter field listing in a single class (SLASummaryGetForFilterJPAExecutor).


Repository: oozie-git


Description
-------

Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.


Diffs (updated)
-----

  client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
  core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
  core/src/main/java/org/apache/oozie/executor/jpa/sla/SelectQuery.java PRE-CREATION 
  core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
  core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSLASummaryGetForFilterJPAExecutor.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/executor/jpa/sla/TestSelectQuery.java PRE-CREATION 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
  docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
  webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
  webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
  webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 


Diff: https://reviews.apache.org/r/68140/diff/3/

Changes: https://reviews.apache.org/r/68140/diff/2-3/


Testing
-------


Thanks,

Andras Salamon


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Andras Salamon <an...@melda.info>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/
-----------------------------------------------------------

(Updated Aug. 6, 2018, 7:35 a.m.)


Review request for oozie, András Piros and Kinga Marton.


Changes
-------

Moved some of the conversions to the set methods to make execute() cleaner


Repository: oozie-git


Description
-------

Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.


Diffs (updated)
-----

  client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
  core/src/main/conf/action-conf/hive.xml fc02e25b 
  core/src/main/java/org/apache/oozie/action/ActionExecutor.java 1770b973 
  core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java 8f0f2440 
  core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
  core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
  core/src/test/java/org/apache/oozie/action/hadoop/LauncherMainTester.java ada7005e 
  core/src/test/java/org/apache/oozie/action/hadoop/SleepMapperReducerForTest.java 846441fd 
  core/src/test/java/org/apache/oozie/action/oozie/TestSubWorkflowActionExecutor.java 893405e3 
  core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
  docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
  release-log.txt 5100d97d 
  webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
  webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
  webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 


Diff: https://reviews.apache.org/r/68140/diff/2/

Changes: https://reviews.apache.org/r/68140/diff/1-2/


Testing
-------


Thanks,

Andras Salamon


Re: Review Request 68140: OOZIE-3229 Improved filtering options in V2SLAServlet

Posted by Peter Bacsko via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68140/#review206747
-----------------------------------------------------------



I haven't written specific comments yet, but in general, there are a lot of repetitive parts: very long if condition or list of consecutive "if" branches. Would be great if this could be substituted with some design pattern to reduce the amount of code. Let's discuss it in person.

- Peter Bacsko


On aug. 1, 2018, 10:48 de, Andras Salamon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68140/
> -----------------------------------------------------------
> 
> (Updated aug. 1, 2018, 10:48 de)
> 
> 
> Review request for oozie, András Piros and Kinga Marton.
> 
> 
> Repository: oozie-git
> 
> 
> Description
> -------
> 
> Added lots of new filter fields, also refactored SLASummaryGetForFilterJPAExecutor class to eliminate FindBugs errors. I'm not sure about the filter field names.
> 
> 
> Diffs
> -----
> 
>   client/src/main/java/org/apache/oozie/client/OozieClient.java 949b4532 
>   core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryGetForFilterJPAExecutor.java b54161e9 
>   core/src/main/java/org/apache/oozie/servlet/V2SLAServlet.java 3982d1e0 
>   core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java aa633225 
>   docs/src/site/twiki/DG_SLAMonitoring.twiki c91c227d 
>   webapp/src/main/webapp/console/sla/css/oozie-sla.css d2f2deee 
>   webapp/src/main/webapp/console/sla/js/oozie-sla.js 2ecad228 
>   webapp/src/main/webapp/console/sla/oozie-sla.html e5bf6275 
> 
> 
> Diff: https://reviews.apache.org/r/68140/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andras Salamon
> 
>