falcon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruslan Ostafiychuk" <rostafiyc...@hortonworks.com>
Subject Re: Review Request 26496: Parse json with instances to InstancesResult with correct dateFormat
Date Fri, 10 Oct 2014 11:18:59 GMT


> On Oct. 9, 2014, 6:09 p.m., Raghav Gautam wrote:
> > falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java,
line 174
> > <https://reviews.apache.org/r/26496/diff/1/?file=716643#file716643line174>
> >
> >     for testProcessInstanceStatusDateEmpty() I am getting this exception:
> >     
> >     java.lang.IllegalArgumentException: Illegal pattern character 'X'
> >     	at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:768)
> >     	at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:575)
> >     	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:500)
> >     	at com.google.gson.DefaultDateTypeAdapter.<init>(DefaultDateTypeAdapter.java:49)
> >     	at com.google.gson.GsonBuilder.addTypeAdaptersForDate(GsonBuilder.java:556)
> >     	at com.google.gson.GsonBuilder.create(GsonBuilder.java:544)
> >     	at org.apache.falcon.regression.core.util.InstanceUtil.hitUrl(InstanceUtil.java:175)
> >     	at org.apache.falcon.regression.core.util.InstanceUtil.sendRequestProcessInstance(InstanceUtil.java:93)
> >     	at org.apache.falcon.regression.core.util.InstanceUtil.createAndSendRequestProcessInstance(InstanceUtil.java:750)
> >     	at org.apache.falcon.regression.core.interfaces.IEntityManagerHelper.getProcessInstanceStatus(IEntityManagerHelper.java:391)
> >     	at org.apache.falcon.regression.core.interfaces.IEntityManagerHelper.getProcessInstanceStatus(IEntityManagerHelper.java:383)
> >     	at org.apache.falcon.regression.ProcessInstanceStatusTest.testProcessInstanceStatusDateEmpty(ProcessInstanceStatusTest.java:178)
> >         
> >     If I change the format to "yyyy-MM-dd'T'HH:mm:ssZ" - the test goes through but
it will not parse 2014-10-07T13:35:42-07:00. The basic issue I think here is that we have
both UTC and non-UTC format being returned in the same response (when falcon server is running
in non-UTC).
> >     
> >     I would prefer to have the test working in UTC scenario and wait till devs decide
on supporting UTC in https://issues.apache.org/jira/browse/FALCON-725.
> >     
> >     Makes sense ?
> 
> Ruslan Ostafiychuk wrote:
>     I see that ISO 8601 time zone ('X') is not supported in SimpleDateFormat in JDK6.
Replaced by typeAdapter.

> The basic issue I think here is that we have both UTC and non-UTC format being returned
in the same response (when falcon server is running in non-UTC).

No, GsonBuilder can deserialize fields with different time zones and we always have all "Date"
fields in one time zone (instance field is "String")


- Ruslan


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


On Oct. 10, 2014, 7:17 a.m., Ruslan Ostafiychuk wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26496/
> -----------------------------------------------------------
> 
> (Updated Oct. 10, 2014, 7:17 a.m.)
> 
> 
> Review request for Falcon.
> 
> 
> Bugs: falcon-706
>     https://issues.apache.org/jira/browse/falcon-706
> 
> 
> Repository: falcon-git
> 
> 
> Description
> -------
> 
> "startTime": "2014-10-09T04:28:36-07:00" is accepteble now
> 
> 
> Diffs
> -----
> 
>   falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java
d8bef69 
> 
> Diff: https://reviews.apache.org/r/26496/diff/
> 
> 
> Testing
> -------
> 
> ProcessInstanceStatusTest
> 
> 
> Thanks,
> 
> Ruslan Ostafiychuk
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message