public static class CalendarWindows.MonthsWindows extends PartitioningWindowFn<java.lang.Object,IntervalWindow>
WindowFn
that windows elements into periods measured by months.
By default, periods of multiple months are measured starting at the
epoch. This can be overridden with withStartingMonth(int, int)
.
Months start on the first day of each calendar month, unless overridden by
beginningOnDay(int)
.
The time zone used to determine calendar boundaries is UTC, unless this
is overridden with the withTimeZone(org.joda.time.DateTimeZone)
method.
WindowFn.AssignContext, WindowFn.MergeContext
Modifier and Type | Method and Description |
---|---|
IntervalWindow |
assignWindow(Instant timestamp)
Returns the single window to which elements with this timestamp belong.
|
CalendarWindows.MonthsWindows |
beginningOnDay(int dayOfMonth) |
int |
getDayOfMonth() |
int |
getNumber() |
DateTime |
getStartDate() |
DateTimeZone |
getTimeZone() |
boolean |
isCompatible(WindowFn<?,?> other)
Returns whether this performs the same merging as the given
WindowFn . |
void |
populateDisplayData(DisplayData.Builder builder)
Register display data for the given transform or component.
|
Coder<IntervalWindow> |
windowCoder()
Returns the
Coder used for serializing the windows used
by this windowFn. |
CalendarWindows.MonthsWindows |
withStartingMonth(int year,
int month) |
CalendarWindows.MonthsWindows |
withTimeZone(DateTimeZone timeZone) |
assignWindows, getDefaultWindowMappingFn, getOutputTime
isNonMerging, mergeWindows
getWindowTypeDescriptor
public CalendarWindows.MonthsWindows beginningOnDay(int dayOfMonth)
public CalendarWindows.MonthsWindows withStartingMonth(int year, int month)
public CalendarWindows.MonthsWindows withTimeZone(DateTimeZone timeZone)
public IntervalWindow assignWindow(Instant timestamp)
PartitioningWindowFn
assignWindow
in class PartitioningWindowFn<java.lang.Object,IntervalWindow>
public Coder<IntervalWindow> windowCoder()
WindowFn
Coder
used for serializing the windows used
by this windowFn.windowCoder
in class WindowFn<java.lang.Object,IntervalWindow>
public boolean isCompatible(WindowFn<?,?> other)
WindowFn
WindowFn
.isCompatible
in class WindowFn<java.lang.Object,IntervalWindow>
public void populateDisplayData(DisplayData.Builder builder)
WindowFn
populateDisplayData(DisplayData.Builder)
is invoked by Pipeline runners to collect
display data via DisplayData.from(HasDisplayData)
. Implementations may call
super.populateDisplayData(builder)
in order to register display data in the current
namespace, but should otherwise use subcomponent.populateDisplayData(builder)
to use
the namespace of the subcomponent.
By default, does not register any display data. Implementors may override this method to provide their own display data.
populateDisplayData
in interface HasDisplayData
populateDisplayData
in class WindowFn<java.lang.Object,IntervalWindow>
builder
- The builder to populate with display data.HasDisplayData
public int getNumber()
public int getDayOfMonth()
public DateTime getStartDate()
public DateTimeZone getTimeZone()