public class Utils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Utils.ByteArrayKey
A wrapper of
byte[] that can be used as a hash-map key. |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static <T> org.apache.beam.sdk.util.WindowedValue<T> |
decodeWindowedValue(byte[] item,
Coder coder) |
static org.apache.beam.sdk.util.WindowedValue.FullWindowedValueCoder |
deriveIterableValueCoder(org.apache.beam.sdk.util.WindowedValue.FullWindowedValueCoder elementCoder) |
static <T> byte[] |
encode(T value,
Coder<T> coder) |
static java.lang.String |
getTupleTagId(PValue value) |
static <T> java.util.List<T> |
roundRobinSubList(java.util.List<T> list,
int index,
int count)
Assigns the
list to count sublists in a round-robin fashion. |
static <T> T |
serde(T object)
Returns a deep clone of an object by serializing and deserializing it (ser-de).
|
public static java.lang.String getTupleTagId(PValue value)
@Nonnull public static <T> java.util.List<T> roundRobinSubList(@Nonnull java.util.List<T> list, int index, int count)
list
to count
sublists in a round-robin fashion. One call returns
the index
-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
public static <T> T serde(T object)
public static <T> byte[] encode(T value, Coder<T> coder)
public static <T> org.apache.beam.sdk.util.WindowedValue<T> decodeWindowedValue(byte[] item, Coder coder)
public static org.apache.beam.sdk.util.WindowedValue.FullWindowedValueCoder deriveIterableValueCoder(org.apache.beam.sdk.util.WindowedValue.FullWindowedValueCoder elementCoder)