Skip to content

Commit 89fbea4

Browse files
committed
Refactor: separate SplittableTruncateSizedRestrictions
1 parent 6c52b0c commit 89fbea4

11 files changed

Lines changed: 2648 additions & 1971 deletions

File tree

sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/splittabledofn/RestrictionTracker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,6 @@ public static <RestrictionT> TruncateResult of(RestrictionT restriction) {
211211
return new AutoValue_RestrictionTracker_TruncateResult(restriction);
212212
}
213213

214-
public abstract @Nullable RestrictionT getTruncatedRestriction();
214+
public abstract RestrictionT getTruncatedRestriction();
215215
}
216216
}

sdks/java/core/src/main/java/org/apache/beam/sdk/values/KV.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
*/
4141
public class KV<K, V> implements Serializable {
4242
/** Returns a {@link KV} with the given key and value. */
43+
@Pure
4344
public static <K, V> KV<K, V> of(K key, V value) {
4445
return new KV<>(key, value);
4546
}

sdks/java/core/src/main/java/org/apache/beam/sdk/values/WindowedValue.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.Collection;
2121
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
2222
import org.apache.beam.sdk.transforms.windowing.PaneInfo;
23+
import org.checkerframework.dataflow.qual.Pure;
2324
import org.joda.time.Instant;
2425

2526
/**
@@ -29,26 +30,32 @@
2930
*/
3031
public interface WindowedValue<T> {
3132
/** The primary data for this value. */
33+
@Pure
3234
T getValue();
3335

3436
/** The timestamp of this value in event time. */
37+
@Pure
3538
Instant getTimestamp();
3639

3740
/** Returns the windows of this {@code WindowedValue}. */
41+
@Pure
3842
Collection<? extends BoundedWindow> getWindows();
3943

4044
/** The {@link PaneInfo} associated with this WindowedValue. */
45+
@Pure
4146
PaneInfo getPaneInfo();
4247

4348
/**
4449
* A representation of each of the actual values represented by this compressed {@link
4550
* WindowedValue}, one per window.
4651
*/
52+
@Pure
4753
Iterable<WindowedValue<T>> explodeWindows();
4854

4955
/**
5056
* A {@link WindowedValue} with identical metadata to the current one, but with the provided
5157
* value.
5258
*/
59+
@Pure
5360
<OtherT> WindowedValue<OtherT> withValue(OtherT value);
5461
}

0 commit comments

Comments
 (0)