public final class AvroConfigurationSerializer extends Object implements ConfigurationSerializer
| Constructor and Description |
|---|
AvroConfigurationSerializer() |
| Modifier and Type | Method and Description |
|---|---|
Configuration |
fromAvro(AvroConfiguration avroConfiguration)
Converts a given AvroConfiguration to Configuration
|
Configuration |
fromAvro(AvroConfiguration avroConfiguration,
ClassHierarchy classHierarchy)
Converts a given AvroConfiguration to Configuration
|
Configuration |
fromByteArray(byte[] theBytes)
Loads a Configuration from a byte[] created with toByteArray().
|
Configuration |
fromByteArray(byte[] theBytes,
ClassHierarchy classHierarchy)
Loads a Configuration from a byte[] created with toByteArray().
|
Configuration |
fromFile(File file)
Loads a Configuration from a File created with toFile().
|
Configuration |
fromFile(File file,
ClassHierarchy classHierarchy)
Loads a Configuration from a File created with toFile().
|
Configuration |
fromString(String theString)
Decodes a String generated via toString()
|
Configuration |
fromString(String theString,
ClassHierarchy classHierarchy)
Decodes a String generated via toString()
|
Configuration |
fromTextFile(File file)
Loads a Configuration from a File created with toFile().
|
Configuration |
fromTextFile(File file,
ClassHierarchy classHierarchy)
Loads a Configuration from a File created with toFile() with ClassHierarchy
|
AvroConfiguration |
toAvro(Configuration configuration) |
byte[] |
toByteArray(Configuration conf)
Writes the Configuration to a byte[].
|
void |
toFile(Configuration conf,
File file)
Stores the given Configuration in the given File.
|
String |
toString(Configuration configuration)
Writes the Configuration as a String.
|
void |
toTextFile(Configuration conf,
File file)
Stores the given Configuration in the given Text File.
|
@Inject public AvroConfigurationSerializer()
public AvroConfiguration toAvro(Configuration configuration)
public void toFile(Configuration conf, File file) throws IOException
ConfigurationSerializertoFile in interface ConfigurationSerializerconf - the Configuration to storefile - the file to store the Configuration inIOException - if there is an IO error in the process.public void toTextFile(Configuration conf, File file) throws IOException
ConfigurationSerializertoTextFile in interface ConfigurationSerializerconf - the Configuration to storefile - the file to store the Configuration inIOException - if there is an IO error in the process.public byte[] toByteArray(Configuration conf) throws IOException
ConfigurationSerializertoByteArray in interface ConfigurationSerializerIOExceptionpublic String toString(Configuration configuration)
ConfigurationSerializertoString in interface ConfigurationSerializerpublic Configuration fromAvro(AvroConfiguration avroConfiguration) throws BindException
avroConfiguration - BindExceptionpublic Configuration fromAvro(AvroConfiguration avroConfiguration, ClassHierarchy classHierarchy) throws BindException
avroConfiguration - classHierarchy - the class hierarchy used for validation.BindExceptionpublic Configuration fromFile(File file) throws IOException, BindException
ConfigurationSerializerfromFile in interface ConfigurationSerializerfile - the File to read from.IOException - if the File can't be read or parsedBindException - if the file contains an illegal Configurationpublic Configuration fromFile(File file, ClassHierarchy classHierarchy) throws IOException, BindException
ConfigurationSerializerfromFile in interface ConfigurationSerializerfile - the File to read from.classHierarchy - used to validate the configuration againstIOException - if the File can't be read or parsedBindException - if the file contains an illegal Configurationpublic Configuration fromTextFile(File file) throws IOException, BindException
ConfigurationSerializerfromTextFile in interface ConfigurationSerializerfile - the File to read from.IOException - if the File can't be read or parsedBindException - if the file contains an illegal Configurationpublic Configuration fromTextFile(File file, ClassHierarchy classHierarchy) throws IOException, BindException
ConfigurationSerializerfromTextFile in interface ConfigurationSerializerIOExceptionBindExceptionpublic Configuration fromByteArray(byte[] theBytes) throws IOException, BindException
ConfigurationSerializerfromByteArray in interface ConfigurationSerializertheBytes - the bytes to deserialize.IOException - if the byte[] can't be deserializedBindException - if the byte[] contains an illegal Configuration.public Configuration fromByteArray(byte[] theBytes, ClassHierarchy classHierarchy) throws IOException, BindException
ConfigurationSerializerfromByteArray in interface ConfigurationSerializertheBytes - the bytes to deserialize.classHierarchy - used to validate the configuration againstIOException - if the byte[] can't be deserializedBindException - if the byte[] contains an illegal Configuration.public Configuration fromString(String theString) throws IOException, BindException
ConfigurationSerializerfromString in interface ConfigurationSerializertheString - to be parsedIOException - if theString can't be parsed.BindException - if theString contains an illegal Configuration.public Configuration fromString(String theString, ClassHierarchy classHierarchy) throws IOException, BindException
ConfigurationSerializerfromString in interface ConfigurationSerializertheString - to be parsedclassHierarchy - used to validate the configuration againstIOException - if theString can't be parsed.BindException - if theString contains an illegal Configuration.Copyright © 2015 The Apache Software Foundation. All rights reserved.