/** * Checks if the provided range r is within the current range. * Note that equal ranges also returns true. * * @param r range * @return true if range r is contained in r */ public boolean contains(Range r) { if ((this.beginTime().getJodaTimeInstant().isBefore(r.beginTime().getJodaTimeInstant()) || this.beginTime().getJodaTimeInstant().isEqual(r.beginTime().getJodaTimeInstant())) && (this.endTime().getJodaTimeInstant().isAfter(r.endTime().getJodaTimeInstant()) || this.endTime().getJodaTimeInstant().isEqual(r.endTime().getJodaTimeInstant()))) { return true; } return false; }
private void setCurrentInputWatermarkAfterRecovery(Instant watermark) { if (!currentInputWatermark.isEqual(BoundedWindow.TIMESTAMP_MIN_VALUE)) { throw new RuntimeException("Explicitly setting the input watermark is only allowed on " + "initialization after recovery from a node failure. Apparently this is not " + "the case here as the watermark is already set."); } this.currentInputWatermark = watermark; }
private void setCurrentOutputWatermarkAfterRecovery(Instant watermark) { if (!currentOutputWatermark.isEqual(BoundedWindow.TIMESTAMP_MIN_VALUE)) { throw new RuntimeException("Explicitly setting the output watermark is only allowed on " + "initialization after recovery from a node failure. Apparently this is not " + "the case here as the watermark is already set."); } this.currentOutputWatermark = watermark; }
@Override public int compareTo(IntervalWindow o) { if (start.isEqual(o.start)) { return end.compareTo(o.end); } return start.compareTo(o.start); }
@Override public boolean equals(Object o) { if (o instanceof TimestampedValueInSingleWindow) { TimestampedValueInSingleWindow<?> that = (TimestampedValueInSingleWindow<?>) o; // Compare timestamps first as they are most likely to differ. // Also compare timestamps according to millis-since-epoch because otherwise expensive // comparisons are made on their Chronology objects. return this.getTimestamp().isEqual(that.getTimestamp()) && Objects.equals(that.getValue(), this.getValue()) && Objects.equals(that.getPane(), this.getPane()) && Objects.equals(that.window, this.window); } else { return super.equals(o); } }
@Override public boolean equals(Object other) { if (!(other instanceof WindowedValue)) { return false; } else { WindowedValue<?> that = (WindowedValue<?>) other; // Compare timestamps first as they are most likely to differ. // Also compare timestamps according to millis-since-epoch because otherwise expensive // comparisons are made on their Chronology objects. return this.getTimestamp().isEqual(that.getTimestamp()) && Objects.equals(this.getValue(), that.getValue()) && Objects.equals(this.getWindows(), that.getWindows()) && Objects.equals(this.getPane(), that.getPane()); } }
@Override public boolean equals(Object o) { if (o instanceof TimestampedValueInGlobalWindow) { TimestampedValueInGlobalWindow<?> that = (TimestampedValueInGlobalWindow<?>) o; // Compare timestamps first as they are most likely to differ. // Also compare timestamps according to millis-since-epoch because otherwise expensive // comparisons are made on their Chronology objects. return this.getTimestamp().isEqual(that.getTimestamp()) && Objects.equals(that.getPane(), this.getPane()) && Objects.equals(that.getValue(), this.getValue()); } else { return super.equals(o); } }
@Override public boolean equals(Object o) { if (o instanceof TimestampedValueInMultipleWindows) { TimestampedValueInMultipleWindows<?> that = (TimestampedValueInMultipleWindows<?>) o; // Compare timestamps first as they are most likely to differ. // Also compare timestamps according to millis-since-epoch because otherwise expensive // comparisons are made on their Chronology objects. if (this.getTimestamp().isEqual(that.getTimestamp()) && Objects.equals(that.getValue(), this.getValue()) && Objects.equals(that.getPane(), this.getPane())) { ensureWindowsAreASet(); that.ensureWindowsAreASet(); return that.windows.equals(this.windows); } else { return false; } } else { return super.equals(o); } }
/** * Checks if the provided range r is within the current range. * Note that equal ranges also returns true. * * @param r range * @return true if range r is contained in r */ public boolean contains(Range r) { if ((this.beginTime().getJodaTimeInstant().isBefore(r.beginTime().getJodaTimeInstant()) || this.beginTime().getJodaTimeInstant().isEqual(r.beginTime().getJodaTimeInstant())) && (this.endTime().getJodaTimeInstant().isAfter(r.endTime().getJodaTimeInstant()) || this.endTime().getJodaTimeInstant().isEqual(r.endTime().getJodaTimeInstant()))) { return true; } return false; }
if (childOrder != null && childOrder.getExpiration() != null && !childOrder.getExpiration().isEqual(order.getExpiration())) throw new Error("Child order expirations must match parent order expirations"); boolean fullyExpired = true;