Package org.apache.beam.runners.jet
Class Utils
- java.lang.Object
-
- org.apache.beam.runners.jet.Utils
-
public class Utils extends java.lang.ObjectVarious common methods used by the Jet based runner.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUtils.ByteArrayKeyA wrapper ofbyte[]that can be used as a hash-map key.
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> org.apache.beam.sdk.values.WindowedValue<T>decodeWindowedValue(byte[] item, org.apache.beam.sdk.coders.Coder coder)static org.apache.beam.sdk.values.WindowedValues.FullWindowedValueCoderderiveIterableValueCoder(org.apache.beam.sdk.values.WindowedValues.FullWindowedValueCoder elementCoder)static <T> byte[]encode(T value, org.apache.beam.sdk.coders.Coder<T> coder)static java.lang.StringgetTupleTagId(org.apache.beam.sdk.values.PValue value)static <T> java.util.List<T>roundRobinSubList(java.util.List<T> list, int index, int count)Assigns thelisttocountsublists in a round-robin fashion.static <T> Tserde(T object)Returns a deep clone of an object by serializing and deserializing it (ser-de).
-
-
-
Method Detail
-
getTupleTagId
public static java.lang.String getTupleTagId(org.apache.beam.sdk.values.PValue value)
-
roundRobinSubList
@Nonnull public static <T> java.util.List<T> roundRobinSubList(@Nonnull java.util.List<T> list, int index, int count)Assigns thelisttocountsublists in a round-robin fashion. One call returns theindex-th sublist.For example, for a 7-element list where
count == 3, it would respectively return for indices 0..2:0, 3, 6 1, 4 2, 5
-
serde
public static <T> T serde(T object)
Returns a deep clone of an object by serializing and deserializing it (ser-de).
-
encode
public static <T> byte[] encode(T value, org.apache.beam.sdk.coders.Coder<T> coder)
-
decodeWindowedValue
public static <T> org.apache.beam.sdk.values.WindowedValue<T> decodeWindowedValue(byte[] item, org.apache.beam.sdk.coders.Coder coder)
-
deriveIterableValueCoder
public static org.apache.beam.sdk.values.WindowedValues.FullWindowedValueCoder deriveIterableValueCoder(org.apache.beam.sdk.values.WindowedValues.FullWindowedValueCoder elementCoder)
-
-