You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "Azat Nizametdinov (JIRA)" <ji...@apache.org> on 2017/09/11 08:27:00 UTC

[jira] [Commented] (FLUME-3173) Upgrade joda-time

    [ https://issues.apache.org/jira/browse/FLUME-3173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16160911#comment-16160911 ] 

Azat Nizametdinov commented on FLUME-3173:
------------------------------------------

Alternatively joda-time can be replaced by Java 8 Date and Time API.

> Upgrade joda-time
> -----------------
>
>                 Key: FLUME-3173
>                 URL: https://issues.apache.org/jira/browse/FLUME-3173
>             Project: Flume
>          Issue Type: Bug
>          Components: Sinks+Sources
>    Affects Versions: 1.7.0
>            Reporter: Azat Nizametdinov
>
> Flume 1.7 depends on joda-time version 2.1 which uses outdated tz database.  
> For example following code
> {code}
> new org.joda.time.DateTime(
>     org.joda.time.DateTimeZone.forID("Europe/Moscow")
> ).toString()
> {code}
> returns time with offset {{+04:00}}, but Moscow timezone is UTC+3 since 2014.
> Furthermore this version of joda-time does not allow to specify custom tz databse folder in contrast to newer versions.
> It affects {{RegexExtractorInterceptorMillisSerializer}}. Test to reproduce the bug:
> {code}
> public void testMoscowTimezone() throws Exception {
>     TimeZone.setDefault(TimeZone.getTimeZone("Europe/Moscow"));
>     String pattern = "yyyy-MM-dd HH:mm:ss";
>     SimpleDateFormat format = new SimpleDateFormat(pattern);
>     String dateStr = "2017-09-10 10:00:00";
>     Date expectedDate = format.parse(dateStr);
>     RegexExtractorInterceptorMillisSerializer sut = new RegexExtractorInterceptorMillisSerializer();
>     Context context = new Context();
>     context.put("pattern", pattern);
>     sut.configure(context);
>     assertEquals(String.valueOf(expectedDate.getTime()), sut.serialize(dateStr));
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)