-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18762/#review39790
-----------------------------------------------------------
looks good( 1 minor comment). Sorry for confusion about coord.actioncount.
I have tested patch with America/New_York timezone.
public void testPatch() throws Exception {
init("coord-action-create");
ds = new SyncCoordDataset();
ds.setFrequency(1);
ds.setInitInstance(DateUtils.parseDateOozieTZ("20014-03-07T01:00Z"));
ds.setTimeUnit(TimeUnit.DAY);
ds.setTimeZone(DateUtils.getTimeZone("America/New_York"));
ds.setName("test");
ds.setUriTemplate("hdfs:///tmp/workflows/${YEAR}/${MONTH}/${DAY};region=us");
ds.setType("SYNC");
ds.setDoneFlag("");
appInst.setNominalTime(DateUtils.parseDateOozieTZ("20014-03-08T01:00Z"));
CoordELFunctions.configureEvaluator(eval, ds, appInst);
String expr = "${coord:currentRange(-1,5)}";
String a1=CoordELFunctions.evalAndWrap(eval, expr);
System.out.println(a1.split("#").length);
for(String a :a1.split("#")){
System.out.println(a);
}
Output.
7
20014-03-13T00:00Z
20014-03-12T00:00Z
20014-03-11T00:00Z
20014-03-10T00:00Z
20014-03-09T01:00Z
20014-03-08T01:00Z
20014-03-07T01:00Z
Issue is not with your patch but with
DateUtils.formatDateOozieTZ(nominalInstanceCal), it doesn't use dataset
timezone. Will file different JIRA for that.
core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java
<https://reviews.apache.org/r/18762/#comment72383>
We are logging too many statement here, it might be better if we can log it
only once.
something like this.
boolean shouldlog = true;
if (nominalInstanceCal.compareTo(initInstance) < 0) {
if (shouldlog) {
LOG.warn();
shouldlog = false;
}
- Purshotam Shah
On April 8, 2014, 1:03 a.m., shwethags wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18762/
> -----------------------------------------------------------
>
> (Updated April 8, 2014, 1:03 a.m.)
>
>
> Review request for oozie.
>
>
> Bugs: OOZIE-1709
> https://issues.apache.org/jira/browse/OOZIE-1709
>
>
> Repository: oozie-git
>
>
> Description
> -------
>
> CoordELFunctions.getCurrentInstance() has this code:
> while (current.compareTo(calEffectiveTime) <= 0) {
> current = (Calendar) origCurrent.clone();
> instanceCount[0]++;
> current.add(dsTimeUnit.getCalendarUnit(), instanceCount[0] *
> dsFreq);
> }
>
> For coords with smaller frequency and start time in very past, this is very
> expensive. On prod, we have seen materialisation of each instance taking few
> mins sometimes for coords with 1 min frequency
>
>
> Diffs
> -----
>
> core/src/main/java/org/apache/oozie/coord/CoordELFunctions.java d73bc7d
> core/src/test/java/org/apache/oozie/coord/TestCoordELFunctions.java be35ce4
>
> Diff: https://reviews.apache.org/r/18762/diff/
>
>
> Testing
> -------
>
> UT
>
>
> Thanks,
>
> shwethags
>
>