Class CalendarWindows.YearsWindows

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.beam.sdk.transforms.display.HasDisplayData
    Enclosing class:
    CalendarWindows

    public static class CalendarWindows.YearsWindows
    extends org.apache.beam.sdk.transforms.windowing.PartitioningWindowFn<java.lang.Object,​org.apache.beam.sdk.transforms.windowing.IntervalWindow>
    A WindowFn that windows elements into periods measured by years.

    By default, periods of multiple years are measured starting at the epoch. This can be overridden with withStartingYear(int).

    Years start on the first day of each calendar year, unless overridden by beginningOnDay(int, int).

    The time zone used to determine calendar boundaries is UTC, unless this is overridden with the withTimeZone(java.util.TimeZone) method.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.windowing.WindowFn

        org.apache.beam.sdk.transforms.windowing.WindowFn.AssignContext, org.apache.beam.sdk.transforms.windowing.WindowFn.MergeContext
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.beam.sdk.transforms.windowing.IntervalWindow assignWindow​(org.joda.time.Instant timestamp)  
      CalendarWindows.YearsWindows beginningOnDay​(int monthOfYear, int dayOfMonth)  
      int getDayOfMonth()  
      int getMonthOfYear()  
      int getNumber()  
      java.time.ZonedDateTime getStartDate()  
      java.util.TimeZone getTimeZone()  
      boolean isCompatible​(org.apache.beam.sdk.transforms.windowing.WindowFn<?,​?> other)  
      void verifyCompatibility​(org.apache.beam.sdk.transforms.windowing.WindowFn<?,​?> other)  
      org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.transforms.windowing.IntervalWindow> windowCoder()  
      CalendarWindows.YearsWindows withStartingYear​(int year)  
      CalendarWindows.YearsWindows withTimeZone​(java.util.TimeZone timeZone)  
      • Methods inherited from class org.apache.beam.sdk.transforms.windowing.PartitioningWindowFn

        assignsToOneWindow, assignWindows, getDefaultWindowMappingFn
      • Methods inherited from class org.apache.beam.sdk.transforms.windowing.NonMergingWindowFn

        isNonMerging, mergeWindows
      • Methods inherited from class org.apache.beam.sdk.transforms.windowing.WindowFn

        getWindowTypeDescriptor, populateDisplayData
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • assignWindow

        public org.apache.beam.sdk.transforms.windowing.IntervalWindow assignWindow​(org.joda.time.Instant timestamp)
        Specified by:
        assignWindow in class org.apache.beam.sdk.transforms.windowing.PartitioningWindowFn<java.lang.Object,​org.apache.beam.sdk.transforms.windowing.IntervalWindow>
      • windowCoder

        public org.apache.beam.sdk.coders.Coder<org.apache.beam.sdk.transforms.windowing.IntervalWindow> windowCoder()
        Specified by:
        windowCoder in class org.apache.beam.sdk.transforms.windowing.WindowFn<java.lang.Object,​org.apache.beam.sdk.transforms.windowing.IntervalWindow>
      • isCompatible

        public boolean isCompatible​(org.apache.beam.sdk.transforms.windowing.WindowFn<?,​?> other)
        Specified by:
        isCompatible in class org.apache.beam.sdk.transforms.windowing.WindowFn<java.lang.Object,​org.apache.beam.sdk.transforms.windowing.IntervalWindow>
      • verifyCompatibility

        public void verifyCompatibility​(org.apache.beam.sdk.transforms.windowing.WindowFn<?,​?> other)
                                 throws org.apache.beam.sdk.transforms.windowing.IncompatibleWindowException
        Overrides:
        verifyCompatibility in class org.apache.beam.sdk.transforms.windowing.WindowFn<java.lang.Object,​org.apache.beam.sdk.transforms.windowing.IntervalWindow>
        Throws:
        org.apache.beam.sdk.transforms.windowing.IncompatibleWindowException
      • getTimeZone

        public java.util.TimeZone getTimeZone()
      • getStartDate

        public java.time.ZonedDateTime getStartDate()
      • getDayOfMonth

        public int getDayOfMonth()
      • getMonthOfYear

        public int getMonthOfYear()
      • getNumber

        public int getNumber()