Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-3173

Upgrade joda-time

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.8.0
    • Sinks+Sources
    • None

    Description

      Flume 1.7 depends on joda-time version 2.1 which uses outdated tz database.
      For example following code

      new org.joda.time.DateTime(
          org.joda.time.DateTimeZone.forID("Europe/Moscow")
      ).toString()
      

      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:

      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));
      }
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mcsanady Miklos Csanady
            Azat Azat Nizametdinov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment