Modifier and Type | Method and Description |
---|---|
static <T extends Collection<? super Split>> |
decode(String encoded,
T splits,
ClassLoader classLoader)
Deserialize a list of
Split s encoded by the encode(Iterable) method |
static Split |
deserialize(DataInput in,
ClassLoader classLoader)
Deserialize a
Split that was written by the serialize(Split, DataOutput)
method using a provided ClassLoader to load the Split class. |
static String |
encode(Iterable<? extends Split> splits)
|
static void |
serialize(Split split,
DataOutput out)
Serialize a
Split instance. |
public static String encode(Iterable<? extends Split> splits) throws IOException
splits
- the list of splits to serializeString
representation of the splits.IOException
- if failed to serializepublic static <T extends Collection<? super Split>> T decode(String encoded, T splits, ClassLoader classLoader) throws IOException, ClassNotFoundException
Split
s encoded by the encode(Iterable)
methodT
- type of the Collection
encoded
- the encoded string produced by the encode(Iterable)
methodsplits
- a Collection
for storing the decoded splitsclassLoader
- the ClassLoader
for loading the Split
classCollection
passed in the argumentsIOException
- if failed to deserializeClassNotFoundException
- if failed to load the Split
class.public static void serialize(Split split, DataOutput out) throws IOException
Split
instance.split
- the Split
to serializeout
- the DataOutput
that the serialized data is writing toIOException
- if failed to serializepublic static Split deserialize(DataInput in, ClassLoader classLoader) throws IOException, ClassNotFoundException
Split
that was written by the serialize(Split, DataOutput)
method using a provided ClassLoader
to load the Split
class.in
- the DataInput
for reading the serialized dataclassLoader
- the ClassLoader
for loading the actual Split
classSplit
instanceIOException
- if failed to deserializeClassNotFoundException
- if failed to load the split class as indicated by the
encoded stringCopyright © 2023 Cask Data, Inc. Licensed under the Apache License, Version 2.0.