Class IntervalWindow
- java.lang.Object
-
- org.apache.beam.sdk.transforms.windowing.BoundedWindow
-
- org.apache.beam.sdk.transforms.windowing.IntervalWindow
-
- All Implemented Interfaces:
java.lang.Comparable<IntervalWindow>
public class IntervalWindow extends BoundedWindow implements java.lang.Comparable<IntervalWindow>
An implementation ofBoundedWindow
that represents an interval fromstart
(inclusive) toend
(exclusive).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IntervalWindow.IntervalWindowCoder
Encodes anIntervalWindow
as a pair of its upper bound and duration.
-
Field Summary
-
Fields inherited from class org.apache.beam.sdk.transforms.windowing.BoundedWindow
TIMESTAMP_MAX_VALUE, TIMESTAMP_MIN_VALUE
-
-
Constructor Summary
Constructors Constructor Description IntervalWindow(org.joda.time.Instant start, org.joda.time.Instant end)
Creates a new IntervalWindow that represents the half-open time interval [start, end).IntervalWindow(org.joda.time.Instant start, org.joda.time.ReadableDuration size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(IntervalWindow o)
boolean
contains(IntervalWindow other)
Returns whether this window contains the given window.org.joda.time.Instant
end()
Returns the end of this window, exclusive.boolean
equals(@Nullable java.lang.Object o)
static Coder<IntervalWindow>
getCoder()
Returns aCoder
suitable forIntervalWindow
.int
hashCode()
boolean
intersects(IntervalWindow other)
Returns whether this window intersects the given window.boolean
isDisjoint(IntervalWindow other)
Returns whether this window is disjoint from the given window.org.joda.time.Instant
maxTimestamp()
Returns the largest timestamp that can be included in this window.IntervalWindow
span(IntervalWindow other)
Returns the minimal window that includes both this window and the given window.org.joda.time.Instant
start()
Returns the start of this window, inclusive.java.lang.String
toString()
-
Methods inherited from class org.apache.beam.sdk.transforms.windowing.BoundedWindow
formatTimestamp, validateTimestampBounds
-
-
-
-
Constructor Detail
-
IntervalWindow
public IntervalWindow(org.joda.time.Instant start, org.joda.time.Instant end)
Creates a new IntervalWindow that represents the half-open time interval [start, end).
-
IntervalWindow
public IntervalWindow(org.joda.time.Instant start, org.joda.time.ReadableDuration size)
-
-
Method Detail
-
start
public org.joda.time.Instant start()
Returns the start of this window, inclusive.
-
end
public org.joda.time.Instant end()
Returns the end of this window, exclusive.
-
maxTimestamp
public org.joda.time.Instant maxTimestamp()
Returns the largest timestamp that can be included in this window.- Specified by:
maxTimestamp
in classBoundedWindow
-
contains
public boolean contains(IntervalWindow other)
Returns whether this window contains the given window.
-
isDisjoint
public boolean isDisjoint(IntervalWindow other)
Returns whether this window is disjoint from the given window.
-
intersects
public boolean intersects(IntervalWindow other)
Returns whether this window intersects the given window.
-
span
public IntervalWindow span(IntervalWindow other)
Returns the minimal window that includes both this window and the given window.
-
equals
public boolean equals(@Nullable java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(IntervalWindow o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<IntervalWindow>
-
getCoder
public static Coder<IntervalWindow> getCoder()
Returns aCoder
suitable forIntervalWindow
.
-
-